Friday, 21 June 2013

Hosts file location on various platform

Windows 7:         %systemroot%\system32\drivers\etc\
                        or, c:\windows\system32\drivers\etc\

 where,
 %systemroot% is usually c:\windows unless you installed Windows on a different partition.

Tuesday, 11 June 2013

How to Enable Telnet Client in Windows 7

Telnet Client is used to connect to remote machine by using the Telnet protocol. For example, I'm an old fashion IT guy, and I still like to configure Cisco Switches/Routers using telnet. If you started to use Windows 7, you will notice that telnet is not enabled by default !! Don't panic, it is just a matter of few clicks and telnet will be enabled again.
Telnet Client allows a computer to connect to a remote Telnet server and run applications on that server. Once logged on, a user is given a command prompt that can be used as if it had been opened locally on the Telnet server's console. Commands that you type at the Telnet client command prompt are sent to the Telnet Server and executed there, as though you were locally logged on to a command prompt session at the server. Output from the commands that you run are sent back to the Telnet client where they are displayed for you to view.

When you first try to run a telnet command, Windows will informs you that telnet is not recognized as a command




To enable Telnet Client on Windows 7, follow these steps :
  1. Click on Start    then right click on Control Panel

  2. From Control Panel, click on Programs

  3. Under Programs and Features, click on Turn Windows Features on or off

  4. From the Windows Features window, using the slider, scroll down till you reach Telnet Client, select the checkbox beside it, then click on OK



    The selected feature will be installed.



    Once it is installed, the Windows Features windows will be closed.
  5. To confirm that Telnet is installed, open command prompt and type telnet /?



Summary

By default, Telnet Client is not enabled in Windows 7. To enable it, you have to add the Telnet Client Windows Feature.

Another Method:
  • Open a command prompt window.
  • Click Start,type cmd in start search box, and then press Enter.
  • Type the following command
pkgmgr /iu:"TelnetClient"
  • If the User Account Control(UAC) dialog box appears, confirm that the action it displays is want you want, and then click continue.
  • When the command prompt appears again, the installation is complete

Friday, 26 April 2013

ORACLE Export/Import






Oracle Import :

imp
Username:.......
Password:.......
Import data Only: no
Import file: EXPDAT.DMP
List contents of import file only (yes/no): no > no
Ignore create error due to object existence:>no
Import grants>yes
Import table data>yes
Import entire export file>no
Username:........


[root@fws Desktop]# cd /opt
[root@fws opt]# source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
[root@fws opt]# ls
Disk1                             New Text Document.txt
f101(1).sql                       oracle-xe-11.2.0-1.0.x86_64.rpm
f111(4).sql                       putty.rpm
image.sql                         rh
libaio-0.3.109-5.fc17.x86_64.rpm  SAJIB(1.oct.13).sql
lsnrctl status                    SAJIB.5.oct.13.DMP
lsnrctl status~                   teamviewer_linux.rpm
[root@fws opt]# imp

Import: Release 11.2.0.2.0 - Production on Tue Oct 8 03:51:27 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: system
Password:

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Import data only (yes/no): no > no

Import file: expdat.dmp > SAJIB.5.oct.13.DMP

Enter insert buffer size (minimum is 8192) 30720>

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by SAJIB, not by you

import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
List contents of import file only (yes/no): no > no

Ignore create error due to object existence (yes/no): no > no

Import grants (yes/no): yes > yes

Import table data (yes/no): yes > yes

Import entire export file (yes/no): no > no
Username: sajib

Enter table(T) or partition(T:P) names. Null list means all tables for user
Enter table(T) or partition(T:P) name or . if done:

. importing SAJIB's objects into SAJIB
. . importing table              "ADD_STOCK_FIBER"          4 rows imported
. . importing table                    "APEX$_ACL"          0 rows imported
. . importing table               "APEX$_WS_FILES"          0 rows imported
. . importing table             "APEX$_WS_HISTORY"          0 rows imported
. . importing table               "APEX$_WS_LINKS"          0 rows imported
. . importing table               "APEX$_WS_NOTES"          0 rows imported
. . importing table                "APEX$_WS_ROWS"          0 rows imported
. . importing table                "APEX$_WS_TAGS"          0 rows imported
. . importing table      "APEX$_WS_WEBPG_SECTIONS"          0 rows imported
. . importing table "APEX$_WS_WEBPG_SECTION_HISTORY"          0 rows imported
. . importing table          "APEX_ACCESS_CONTROL"         42 rows imported
. . importing table            "APEX_ACCESS_SETUP"          2 rows imported
. . importing table                          "BAF"         20 rows imported
. . importing table                          "BZB"         38 rows imported
. . importing table                         "CEPZ"         61 rows imported
. . importing table                          "CGB"         57 rows imported
. . importing table                         "CHKB"         59 rows imported
. . importing table                         "CHMB"          0 rows imported
. . importing table                         "CHWB"          0 rows imported
. . importing table               "DEMO_CUSTOMERS"          7 rows imported
. . importing table                  "DEMO_ORDERS"         10 rows imported
. . importing table             "DEMO_ORDER_ITEMS"         49 rows imported
. . importing table            "DEMO_PRODUCT_INFO"         10 rows imported
. . importing table                  "DEMO_STATES"         51 rows imported
. . importing table                   "DEMO_USERS"          2 rows imported
. . importing table                         "DEPT"          4 rows imported
. . importing table                         "DWHB"         67 rows imported
. . importing table                          "EMP"         14 rows imported
. . importing table                          "FGB"          0 rows imported
. . importing table                          "FWT"         29 rows imported
. . importing table                          "GEC"         71 rows imported
. . importing table                           "HQ"        332 rows imported
. . importing table                         "IMGB"         41 rows imported
. . importing table                         "KEPZ"         26 rows imported
. . importing table                          "KGB"          1 rows imported
. . importing table                          "KSB"         79 rows imported
. . importing table                          "LKB"         35 rows imported
. . importing table                       "MCOURT"          0 rows imported
. . importing table                          "MEB"         31 rows imported
. . importing table                          "MGB"         19 rows imported
. . importing table                          "NGB"         41 rows imported
. . importing table                          "NKB"        146 rows imported
. . importing table                          "PLB"         64 rows imported
. . importing table              "RADIO_LINK_INFO"         49 rows imported
. . importing table                           "SI"          0 rows imported
. . importing table                          "SPB"          1 rows imported
. . importing table                  "STOCK_FIBER"          6 rows imported
. . importing table                  "SWITCH_INFO"         56 rows imported
. . importing table                       "TEST10"          1 rows imported
. . importing table                  "UNIQUE_TEST"          4 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[root@fws opt]#

Wednesday, 24 April 2013

Oracle-ARCHIVELOG

command on command Prompt:
...............................
sqlplus /nolog
connect / as sysdba

or sqlplus / as sysdba


Backing Up and Recovering:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



***Enabling ARCHIVELOG Mode for Media Failure Protection:***
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>sqlplus / as sysdba
>select log_mode from v$database;
>SHUTDOWN IMMEDIATE
>STARTUP MOUNT
>ALTER DATABASE ARCHIVELOG;
>ALTER DATABASE OPEN;
>exit;



***Flash Recovery Area***
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Two parameters:
* DB_RECOVERY_FILE_DEST and
* DB_RECOVERY_FILE_DEST_SIZE

Flash Recovery Area Default Location:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Linux:    /usr/lib/oracle/xe/app/oracle/flash_recovery_area/
Windows:  c:\oraclexe\app\oracle\flash_recovery_area/

To change the flash recovery area location:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>sqlplus /as sysdba
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'new_path';
>@?/sqlplus/admin/movelogs
Example:(for windows)
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'E:\FRA';
>@?/sqlplus/admin/movelogs

 "C:\oraclexe\app\oracle\product\11.2.0\server/sqlplus/admin/movelogs.sql"



To Changing the Flash Recovery Area Size:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = new_size;
>exit;
Example:
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 20G;
>exit;



Monitoring Location & Space in the Flash Recovery Area:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


SELECT
NAME,
TO_CHAR(SPACE_LIMIT, '999,999,999,999') AS SPACE_LIMIT,
TO_CHAR(SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE, '999,999,999,999')
AS SPACE_AVAILABLE,
ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1)
AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;


Restoring and Recovering the Database:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> On Windows: Click Start, point to Programs (or All Programs), point to
Oracle Database 11g Express Edition, and then select Restore Database.

> On Linux with Gnome: In the Applications menu, point to Oracle Database
11g Express Edition, and then select Restore Database.

> On Linux with KDE: Click the icon for the K Menu, point to Oracle Database
11g Express Edition, and then select Restore Database.






Saturday, 20 April 2013

Setting Enviroment Variables on Linux platform for Oracle

Setting Enviroment Variables on Linux platform

For Bourne,Korn or Bash shell

>source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

For C shell:
>source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.csh

 not path for 11g2

>source /usr/lib/oracle/xe/app/oracle/product/11.2.0/server/bin/oracle_env.sh



For Remote login

SQL>EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

[sajib@fws ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 05-OCT-2013 22:33:15

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                05-OCT-2013 22:01:03
Uptime                    0 days 0 hr. 32 min. 12 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/fws/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=::1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully



[sajib@fws ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Oct 5 22:34:37 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

Check HTTP Port:


SQL>SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

-- If the above returns 0 then run this

Set HTTP Port:

EXEC DBMS_XDB.SETHTTPPORT(8080);

 SQL>SELECT LOG_MODE FROM SYS.V$DATABASE;

 ARCHIVELOG  or  NO ARCHIVELOG

SQL> select dbms_xdb.gethttpport from dual;

GETHTTPPORT
-----------
       8080


SQL> show parameter DB_RECOVERY_FILE_DEST;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/fast_recovery_
                         area
db_recovery_file_dest_size         big integer 10G


SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 50G;

System altered.

SQL> show parameter DB_RECOVERY_FILE_DEST;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/fast_recovery_
                         area
db_recovery_file_dest_size         big integer 50G



SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  622149632 bytes
Fixed Size            2229048 bytes
Variable Size          394267848 bytes
Database Buffers      222298112 bytes
Redo Buffers            3354624 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
ARCHIVELOG

[root@fws Desktop]# lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 08-OCT-2013 02:57:19

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                08-OCT-2013 02:36:40
Uptime                    0 days 0 hr. 20 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/fws/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fws.colbd.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fws.colbd.com)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully
[root@fws Desktop]#



 expdp system schemas=sajib directory=dmpdir dumpfile=sajib.dmp logfile=expsajib.log

expdp system/051502718 schemas=sajib directory=dmpdir dumpfile=expsajib.dmp logfile=expsajib.log

EXPORT COMMAND
for Full Data Mode:
exp full=y file=dba.dmp grants=y rows=y
exp full=y file=dba.dmp log=dba.log

for User Mode:
exp sajib/sajib file=sajib.dmp owner=sajib grants=y rows=y compress=y log=sajib.log

IMPORT COMMAND

imp full=y ignore=y file=expdat.dmp

Thursday, 18 April 2013

How do I stop firewall?


Start Iptables under Linux


Q. How do I start Iptables firewall under RHEL / Red Hat / CentOS / Fedora Linux from a shell prompt? How do I stop firewall?

A. First, you need to configure firewall rules by editing text file located at /etc/sysconfig/iptables. You can also use setup command to configure firewall. Just type the following as root user:

# setup

Select Firewall configuration and just follow on screen instructions.
Once configuration is updated type the following command at a shell prompt:

To start firewall from a shell enter:

# chkconfig iptables on
# service iptables start

To stop firewall, enter:

# service iptables stop



For Details about iptables:
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables#.UXFvBMr0nIV 






Tuesday, 20 November 2012

How to mirror the system and boot partition (RAID1) in Windows Server 2003

This step-by-step article describes how to mirror the system and boot partition in Windows Server 2003. This scenario is based on the assumption that the system and boot files are located on disk 0 and that disk 1 is unallocated space.

Requirements

  • At least two hard-disk drives; IDE, small computer system interface (SCSI), or mixed architecture is permissible.
  • The second drive must be at least the size of the volume on which the operating system boot and system files reside to permit mirroring.
  • The Windows Server 2003 system and boot files must reside on the same volume to be mirrored.
Note The memory dump file is written only to the boot hard disk. Windows Server 2003 can continue to work with a mirrored system disk configuration even if one of the disks in the mirror is removed. However, the memory dump file cannot be written to the remaining system disk in the mirror. You must schedule a system restart for the memory dump file to be written to the remaining hard disk.

Set up the disk management system

  1. Click Start, point to Administrative Tools, and then click Computer Management to open the Computer Management console.
  2. Expand the Storage node.
  3. Click Disk Management.
  4. On the View menu, point to Top, and then click Disk List.

    In the right pane, the attributes of each disk in the system are displayed.
  5. On the View menu, point to Bottom, and then click Graphical View.

    At the bottom of the right pane, a color-coded graphical view of the disks on the system is displayed:
    • Disk description panel: The disk description panel (which is gray) is located to the left of the volume description, which is in color. The disk description contains information about each disk's disk number, whether its configuration is basic or dynamic, its size, and its online or offline status.
    • Volume description panel: The volume description panels are color-coded. They hold information about each volume, such as the drive letter (if assigned), whether the volume is allocated or unallocated, the partition or volume size, and the health status of the volume.

Upgrade to dynamic disks

RAID systems require dynamic disks in Windows Server 2003. Any disks that you are upgrading must contain at least 1 megabyte (MB) of free space at the end of the disk for the upgrade to succeed. Disk Management automatically reserves this free space when it creates partitions or volumes on a disk, but disks with partitions or volumes that are created by other operating systems may not have this free space available.

Note You must be logged on as an administrator or a member of the Administrators group to complete this procedure. If your computer is connected to a network, network policy settings may also prevent you from completing this procedure.

To upgrade a basic disk to a dynamic disk, follow these steps:
  1. Before you upgrade disks, quit any programs that are running on those disks.
  2. Right-click the gray disk description panel, and then click Upgrade to Dynamic Disk.
  3. If the second disk is not a dynamic disk, follow these steps to upgrade it to a dynamic disk.

Mirror the boot and system volume

In this scenario, disk 1 is the disk on which the image of disk 0 will be mirrored.

Note Partitions are referred to as volumes when the disks are dynamic.
  1. Disk 1 must be unallocated space before you can proceed with mirroring.
  2. Right-click disk 0 (which contains the boot and system files), and then click Add Mirror.
  3. A dialog box opens in which any disk on your system that is available for mirroring is displayed. Select the disk of your choice (in this example, it is disk 1), and then click Add Mirror.

    Both disk 0 and disk 1 will now have the same color code, the same drive letter, and the volumes will have the status note "Regenerating" displayed while the information is being copied from the first disk to the second disk. The system will automatically size the volume of the new mirror to the same size as that of the original boot and system volume.
  4. If you now want to boot from the new mirrored disk, you have to change the Boot.ini ARC path that points the computer to the partition in which the system files are located.

Troubleshooting

After you upgrade a basic disk to a dynamic disk, any existing partitions on the basic disk become (dynamic) simple volumes. You cannot change the dynamic volumes back to partitions.

A dynamic disk cannot contain partitions or logical drives, nor can it be accessed by MS-DOS or by any Windows operating systems other than Windows Server 2003.

Important Do not use a hardware RAID solution and a software RAID solution on the same disk.