Showing posts with label Installation & Configuration. Show all posts
Showing posts with label Installation & Configuration. Show all posts

Thursday, January 19, 2017

How to Convert Physical Standby to Logical Standby Database

Before converting physical standby to logical convert resolve the following prerequisite conditions for creating a Logical Standby Database.

1. Determine Support for Data Types and Storage Attributes for Tables. If the primary database contains unsupported tables, log apply services automatically exclude the tables when applying redo logs to the logical standby database.

SQL> SELECT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_UNSUPPORTED;
OWNER                          TABLE_NAME
------------------------------ ------------------------------
ERPUSER                        EMPLOYEE_HIST

2. Ensure Table Rows in the Primary Database Can Be Uniquely Identified. If your application ensures the rows in a table are unique, you can create a disabled primary key RELY constraint on the table else create the primary key.

SQL> SELECT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_NOT_UNIQUE;
OWNER                          TABLE_NAME
------------------------------ ------------------------------
ERPUSER                          EMPLOYEE_SALARY

SQL> ALTER TABLE EMPLOYEE_SALARY ADD PRIMARY KEY (EMPLOYEE_ID) RELY DISABLE;

Now Convert Physical Standby to Logical Standby Database 


1. Cancel Recovery Manager in Physical Standby Database.

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

2. Apply the parameters change in primary database.

ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ERPPRIM' SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=ERPPSTAND LGWR ASYNC NOAFFIRM DELAY=0 OPTIONAL COMPRESSION=ENABLE MAX_FAILURE=0 MAX_CONNECTIONS=1 REOPEN=180 NET_TIMEOUT=30 DB_UNIQUE_NAME="ERPPSTAND", VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)' SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_3='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=ERPPRIM'  SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE  SCOPE=BOTH SID='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE  SCOPE=BOTH SID='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_3=ENABLE  SCOPE=BOTH SID='*';

3. Build a Dictionary in the Redo Data on Primary Database

EXECUTE DBMS_LOGSTDBY.BUILD;

4. Convert to a Logical Standby Database in Standby Database.

ALTER DATABASE RECOVER TO LOGICAL STANDBY ERPPSTAND;

5. Shutdown and Startup Logical Standby Database in Mount Stage

SHUTDOWN; 
STARTUP MOUNT;

6. Adjust Initialization Parameter on Logical Standby Database

ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ERPPSTAND' SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=ERPPRIM LGWR ASYNC NOAFFIRM DELAY=0 OPTIONAL COMPRESSION=ENABLE MAX_FAILURE=0 MAX_CONNECTIONS=1 REOPEN=180 NET_TIMEOUT=30 DB_UNIQUE_NAME="ERPPRIM", VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)' SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_3='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=ERPPSTAND'  SCOPE=BOTH SID='*';

ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE  SCOPE=BOTH SID='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE  SCOPE=BOTH SID='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_3=ENABLE  SCOPE=BOTH SID='*';

7. Open the Logical Standby Database

SQL> ALTER DATABASE OPEN RESETLOGS;

8. Start Logical Apply on Standby

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;


Tuesday, August 9, 2016

Oracle 11.2.0.4 Grid Installation Failed in Red Hat Linux 7.1 (ohasd failed to start)

I got this problem at the time of installation Oracle 11.2.0.4 grid in Red Hat Linux 7.1. I tryed several way to solve this problem but failed finally this problem has beed solved by the applying patch 18370031. This is bug for Oracle Clusterware 11g Release 2 (11.2.0.4.0). The following steps you have to perform to resolve this issue.

1. Deinstall previous GRID configuration.
2. Download and Apply the patch 18370031 using OPatch after orainstRoot.sh and  before executing root.sh scripts.
3. Execute root.sh scripts.

[root@spftldb02 app]# /home/grid/app/grid/product/11.2.4/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /home/grid/app/grid/product/11.2.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /home/grid/app/grid/product/11.2.4/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node spftldb02 successfully pinned.
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2016-08-04 13:04:22.340:
[client(10083)]CRS-2101:The OLR was formatted using version 3.
2016-08-04 13:04:22.768:
[client(10110)]CRS-1001:The OCR was formatted using version 3.

ohasd failed to start at /home/grid/app/grid/product/11.2.4/grid/crs/install/roothas.pl line 377, <ALERTLOG> line 4.
/home/grid/app/grid/product/11.2.4/grid/perl/bin/perl -I/home/grid/app/grid/product/11.2.4/grid/perl/lib -I/home/grid/app/grid/product/11.2.4/grid/crs/install /home/grid/app/grid/product/11.2.4/grid/crs/install/roothas.pl execution failed

[grid@spftldb02 ~]$ cd /home/grid/app/grid/product/11.2.4/grid/deinstall
[grid@spftldb02 deinstall]$ ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2016-08-04_02-21-58PM/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############


######################### CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /home/grid/app/grid/product/11.2.4/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall is: /home/grid/app/grid
Checking for existence of central inventory location /home/grid/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /home/grid/app/grid/product/11.2.4/grid
Checking for sufficient temp space availability on node(s) : 'spftldb02.spftl.com'

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2016-08-04_02-21-58PM/logs//crsdc.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2016-08-04_02-21-58PM/logs/netdc_check2016-08-04_02-22-10-PM.log

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2016-08-04_02-21-58PM/logs/asmcadc_check2016-08-04_02-22-10-PM.log

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: n
ASM was not detected in the Oracle Home

######################### CHECK OPERATION END #########################


####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /home/grid/app/grid/product/11.2.4/grid
The cluster node(s) on which the Oracle home deinstallation will be performed are:null
Oracle Home selected for deinstall is: /home/grid/app/grid/product/11.2.4/grid
Inventory Location where the Oracle home registered is: /home/grid/app/oraInventory
ASM was not detected in the Oracle Home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2016-08-04_02-21-58PM/logs/deinstall_deconfig2016-08-04_02-22-08-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2016-08-04_02-21-58PM/logs/deinstall_deconfig2016-08-04_02-22-08-PM.err'

######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /tmp/deinstall2016-08-04_02-21-58PM/logs/asmcadc_clean2016-08-04_02-23-25-PM.log
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2016-08-04_02-21-58PM/logs/netdc_clean2016-08-04_02-23-25-PM.log

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END


---------------------------------------->

Run the following command as the root user or the administrator on node "spftldb02".

/tmp/deinstall2016-08-04_02-21-58PM/perl/bin/perl -I/tmp/deinstall2016-08-04_02-21-58PM/perl/lib -I/tmp/deinstall2016-08-04_02-21-58PM/crs/install /tmp/deinstall2016-08-04_02-21-58PM/crs/install/roothas.pl -force  -deconfig -paramfile "/tmp/deinstall2016-08-04_02-21-58PM/response/deinstall_Ora11g_gridinfrahome1.rsp"

Press Enter after you finish running the above commands

<----------------------------------------

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/home/grid/app/grid/product/11.2.4/grid' from the central inventory on the local node : Done

Delete directory '/home/grid/app/grid/product/11.2.4/grid' on the local node : Done

Delete directory '/home/grid/app/oraInventory' on the local node : Done

Delete directory '/home/grid/app/grid' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2016-08-04_02-21-58PM' on node 'spftldb02'

## [END] Oracle install clean ##


######################### CLEAN OPERATION END #########################


####################### CLEAN OPERATION SUMMARY #######################
Oracle Restart was already stopped and de-configured on node "spftldb02"
Oracle Restart is stopped and de-configured successfully.
Successfully detached Oracle home '/home/grid/app/grid/product/11.2.4/grid' from the central inventory on the local node.
Successfully deleted directory '/home/grid/app/grid/product/11.2.4/grid' on the local node.
Successfully deleted directory '/home/grid/app/oraInventory' on the local node.
Successfully deleted directory '/home/grid/app/grid' on the local node.
Oracle Universal Installer cleanup was successful.


Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'spftldb02' at the end of the session.

Run 'rm -rf /opt/ORCLfmap' as root on node(s) 'spftldb02' at the end of the session.
Run 'rm -rf /etc/oratab' as root on node(s) 'spftldb02' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL & DECONFIG TOOL END #############

[grid@spftldb02 deinstall]$

[root@spftldb02 ~]# rm -rf /etc/oraInst.loc
[root@spftldb02 ~]# rm -rf /opt/ORCLfmap
[root@spftldb02 ~]# rm -rf /etc/oratab


[grid@spftldb02 OPatch]$ ./opatch napply -local /home/grid/app/grid/product/11.2.4/grid/18370031
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /home/grid/app/grid/product/11.2.4/grid
Central Inventory : /home/grid/app/oraInventory
   from           : /home/grid/app/grid/product/11.2.4/grid/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /home/grid/app/grid/product/11.2.4/grid/cfgtoollogs/opatch/opatch2016-08-04_14-41-51PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   18370031

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y



Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/grid/app/grid/product/11.2.4/grid')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '18370031' to OH '/home/grid/app/grid/product/11.2.4/grid'

Patching component oracle.crs, 11.2.0.4.0...
Patch 18370031 successfully applied.
Log file location: /home/grid/app/grid/product/11.2.4/grid/cfgtoollogs/opatch/opatch2016-08-04_14-41-51PM_1.log

OPatch succeeded.
[grid@spftldb02 OPatch]$
[grid@spftldb02 OPatch]$


[root@spftldb02 ~]# /home/grid/app/grid/product/11.2.4/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /home/grid/app/grid/product/11.2.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /home/grid/app/grid/product/11.2.4/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node spftldb02 successfully pinned.
Adding Clusterware entries to oracle-ohasd.service

spftldb02     2016/08/04 14:43:37     /home/grid/app/grid/product/11.2.4/grid/cdata/spftldb02/backup_20160804_144337.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@spftldb02 ~]#

Saturday, May 30, 2015

PRCD-1120 : The resource for database RAC could not be found.

[oracle@OEL5RACN1 ~]$ srvctl status database -d RACDB -v
PRCD-1120 : The resource for database RACDB could not be found.
PRCR-1001 : Resource ora.rac.db does not exist

This is indicate that Database are not registered in OCR.

Solution : Register database into OCR  (database and instances).

[grid@OEL5RACN1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA_01.dg
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.FRA_01.dg
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.LISTENER.lsnr
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.OCRS_FILES.dg
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.asm
               ONLINE  ONLINE       oel5racn1                Started
               ONLINE  ONLINE       oel5racn2                Started
ora.eons
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.gsd
               OFFLINE OFFLINE      oel5racn1
               OFFLINE OFFLINE      oel5racn2
ora.net1.network
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.ons
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
ora.registry.acfs
               ONLINE  ONLINE       oel5racn1
               ONLINE  ONLINE       oel5racn2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       oel5racn1
ora.oc4j
      1        OFFLINE OFFLINE
ora.oel5racn1.vip
      1        ONLINE  ONLINE       oel5racn1
ora.oel5racn2.vip
      1        ONLINE  ONLINE       oel5racn2
ora.racdb.db
      1        OFFLINE OFFLINE
      2        OFFLINE OFFLINE
ora.scan1.vip
      1        ONLINE  ONLINE       oel5racn1
[grid@OEL5RACN1 ~]$
[oracle@OEL5RACN1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
[oracle@OEL5RACN1 ~]$ srvctl add database -d RACDB1 -o /u01/app/oracle/product/11.2.0/db_1
[oracle@OEL5RACN1 ~]$ srvctl start database -d RACDB1
Database RACDB1 cannot be started since it has no configured instances.
[oracle@OEL5RACN1 ~]$ srvctl config database -d RACDB1
Database unique name: RACDB1
Database name:
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RACDB1
Database instances:
Disk Groups:
Services:
Database is administrator managed
[oracle@OEL5RACN1 ~]$ srvctl start database -d RACDB
[oracle@OEL5RACN1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node oel5racn1
Instance RACDB2 is running on node oel5racn2
[oracle@OEL5RACN1 ~]$

[Note : If your instance are not added you also need to add instance into CRS the following way ]
[oracle@OEL5RACN1 ~]$ srvctl add instance -d RACDB -i RACDB1 -n OEL5RACN1

Thursday, May 28, 2015

Add New Disk Group In ASM

Disk Redundancy : There are three disk redundancy in Oracle ASM which are used at the time of Disk group creation.

NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware mirroring or RAID.

Disk Group REBALANCE: REBALANCE would not required normally, ASM automatically rebalances disk groups when their configuration changes. We can do an manual REBALANCE operation to control the speed.

POWER: This is specifies the degree of parallelism, and thus the speed of the rebalance operation.

[

CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

CREATE DISKGROUP RMAN_BACKUP NORMAL REDUNDANCY
  FAILGROUP fail_group_1 DISK
    '/dev/oracleasm/disks/file01' NAME disk1,
    '/dev/oracleasm/disks/file02' NAME disk2
  FAILGROUP fail_group_2 DISK
    '/dev/oracleasm/disks/file03' NAME disk1,
    '/dev/oracleasm/disks/file04' NAME disk2;

 CREATE DISKGROUP DATA_DISK01 HIGH REDUNDANCY
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file01'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file02'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file03'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file04'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file05'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file06'
 ATTRIBUTE 'compatible.asm' = '11.2.0.0.0';

 ]

=== From root User

List of LUN Available for ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Prepare Disk For ASM

[root@OEL564ASMN1 ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ~]#

List of Disk For ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         652     5237158+  83  Linux
[root@OEL564ASMN1 ~]# oracleasm createdisk RMAN_BKP /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
RMAN_BKP
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
Discovered disk: ORCL:RMAN_BKP [10474317 blocks (5362850304 bytes), maxio 512]
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@OEL564ASMN1 ~]#

=== From grid User

[grid@OEL564ASMN1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 28 14:17:16 2015

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

SQL> conn /as sysasm
Connected.
SQL> SELECT GROUP_NUMBER, NAME FROM V$ASM_DISKGROUP;

GROUP_NUMBER Disk Name
------------ ------------
           1 DATA
           2 FRA

SQL> SET LINE 2000
SQL> COLUMN group_number                FORMAT 999,999       HEAD 'Group Number'
SQL> COLUMN MOUNT_STATUS         FORMAT a10           HEAD 'Mount Status'
SQL> COLUMN HEADER_STATUS               FORMAT a12           HEAD 'Header Status'
SQL> COLUMN MODE_STATUS         FORMAT a10           HEAD ' Mode Status'
SQL> COLUMN STATE                       FORMAT a10           HEAD 'State'
SQL> COLUMN TOTAL_MB                    FORMAT 999,999       HEAD 'Total Size In MB'
SQL> COLUMN FREE_MB                     FORMAT 999,999       HEAD 'Free Space In MB'
SQL> COLUMN NAME                        FORMAT a12           HEAD 'Disk Name'
SQL> COLUMN PATH                        FORMAT a45           HEAD 'Disk Location'
SQL> COLUMN LABEL                       FORMAT a12           HEAD 'Disk Level'
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           0 CLOSED     PROVISIONED  ONLINE     NORMAL                    0                0              /dev/oracleasm/disks/RMAN_BKP
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1

SQL>
SQL> CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

Diskgroup created.

SQL>
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1
           3 CACHED     MEMBER       ONLINE     NORMAL                5,114            5,064 RMAN_BACKUP_ /dev/oracleasm/disks/RMAN_BKP
                                                                                             0000
SQL>


Monday, May 25, 2015

Install Oracle ASM packages and create ASM disk groups.

We will perform the following task for configuring ASM disk group. All task will perform from root user.

1. Install ASM rpm.
2. Configuring and load the ASM kernel module.
3. Creating ASM disk volumes.
4. Creating ASM disks.
5. Test disks discovery.

1. Install ASM rpm.

To configure ASM we have to install the following rpm. You can find this rpm file from OTN

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.8-1.el5.i386.rpm

[root@OEL564ASMN1 ASM]# ls -ltr
total 244
-rwxrwxr-x 1 root root 137486 Apr 11 12:14 oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
-rwxrwxr-x 1 root root  85303 Apr 11 12:16 oracleasm-support-2.1.8-1.el5.i386.rpm
-rwxrwxr-x 1 root root  13929 Apr 11 12:17 oracleasmlib-2.0.4-1.el5.i386.rpm
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-support-2.1.8-1.el5.i386.rpm
warning: oracleasm-support-2.1.8-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-194.el########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]

2. Configuring and load the ASM kernel module.

[This script completes the following tasks.
Creates the /etc/sysconfig/oracleasm configuration file
Creates the /dev/oracleasm mount point
Mounts the ASMLib driver file system
]

[root@OEL564ASMN1 ASM]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

[This will load oracleasm kernel module ]

[root@OEL564ASMN1 ASM]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm

Mounting ASMlib driver filesystem: /dev/oracleasm

3. Creating ASM disk volumes.

Showing available disk for Oracle ASM Disk Volume.
[root@OEL564ASMN1 ASM]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

[ We will use /dev/sdb and /dev/sdc for ASM Disk group ]

[root@OEL564ASMN1 ASM]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3916, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
Using default value 3916

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ASM]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

4. Creating ASM disks.

[root@OEL564ASMN1 ~]# oracleasm createdisk DATAVOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]# oracleasm createdisk FRAVOL1 /dev/sdc1
Writing disk header: done

Instantiating disk: done

5. Test disks discovery. (discovery is being used by the oracle DBCA)

[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
[root@OEL564ASMN1 ~]#

Candidate of ASM Disk Not Showing.

Problem: When I am going to Configure ASM in oracle grid infrastructure standalone server installation, I am not able to showing Candidate disk group of ASM.

Solution: Find the ASM disk group location and edit Change Disk Discovery Path.

1. Disk location are empty like this.


2. Open terminal and find you disk group by the following command.



3.Now click Change Disk Discovery Path and you will see the following screen.


4. Now edit Disk Discovery Path Value with your ASM Disk group location.


5. Now Click OK and you can see your ASM Disk group.

6. Now Select Your Disk group and go ahead.

Wednesday, July 9, 2014

Configure RMAN in oracle database


C:\Users\rajib.pradhan>SET ORACLE_SID=ORCL

C:\Users\rajib.pradhan>SQLPLUS /NOLOG

SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 1 01:56:39 2015

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

SQL> CONN /AS SYSDBA
Connected.

1. Checking Archive Log Mode Enable/Disable.
=============================================
SQL> SELECT LOG_MODE FROM V$DATABASE;

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

2. Enable Archive Log Mode.
=============================================
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2177456 bytes
Variable Size            1291847248 bytes
Database Buffers          838860800 bytes
Redo Buffers                5001216 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> ALTER DATABASE OPEN;

Database altered.

3. Checking Parameter recovery file
=============================================
SQL> SHOW PARAMETER db_recovery_file_dest;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      D:\app\flash_recovery_area
db_recovery_file_dest_size           big integer 3912M

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Now Configure In RMAN
=============================================
C:\Users\rajib.pradhan>SET ORACLE_SID=ORCL

C:\Users\rajib.pradhan>RMAN TARGET /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 1 02:03:58 2015

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

connected to target database: ORCL (DBID=1397951475)

RMAN> SHOW ALL;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFORCL.ORA'; # default

Configure Control File Auto backup Mode.
=============================================
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Configure Control File Backup Destination
=============================================
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\app\RMAN_BACKUP\cf_%F';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\app\RMAN_BACKUP\cf_%F';
new RMAN configuration parameters are successfully stored

Configure Datafile Backup Destination
=============================================
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'K:\ORCL_RMAN_BACKUP\df_%d_%t_%s_%p';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   'K:\ORCL_RMAN_BACKUP\df_%d_%t_%s_%p';
new RMAN configuration parameters are successfully stored

Backup Database.
=============================================
RMAN> BACKUP DATABASE;

Starting backup at 01-FEB-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\APP\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00002 name=D:\APP\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00005 name=D:\APP\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00003 name=D:\APP\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00004 name=D:\APP\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 01-FEB-15
channel ORA_DISK_1: finished piece 1 at 01-FEB-15
piece handle=D:\APP\RMAN_BACKUP\DF_ORCL_870488830_4_1 tag=TAG20150201T022710 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 01-FEB-15

Starting Control File and SPFILE Autobackup at 01-FEB-15
piece handle=D:\APP\RMAN_BACKUP\CF_C-1397951475-20150201-01 comment=NONE
Finished Control File and SPFILE Autobackup at 01-FEB-15

Checking Backup List.
=============================================
RMAN> LIST BACKUP;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    1.04G      DISK        00:00:49     01-FEB-15
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20150201T022710
        Piece Name: D:\APP\RMAN_BACKUP\DF_ORCL_870488830_4_1
  List of Datafiles in backup set 2
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1170457    01-FEB-15 D:\APP\ORADATA\ORCL\SYSTEM01.DBF
  2       Full 1170457    01-FEB-15 D:\APP\ORADATA\ORCL\SYSAUX01.DBF
  3       Full 1170457    01-FEB-15 D:\APP\ORADATA\ORCL\UNDOTBS01.DBF
  4       Full 1170457    01-FEB-15 D:\APP\ORADATA\ORCL\USERS01.DBF
  5       Full 1170457    01-FEB-15 D:\APP\ORADATA\ORCL\EXAMPLE01.DBF

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    9.36M      DISK        00:00:01     01-FEB-15
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20150201T022806
        Piece Name: D:\APP\RMAN_BACKUP\CF_C-1397951475-20150201-01
  SPFILE Included: Modification time: 01-FEB-15
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 1170900      Ckp time: 01-FEB-15

RMAN> EXIT

Recovery Manager complete.

C:\Users\rajib.pradhan>

Wednesday, May 15, 2013

Installation and configuration Oracle Database 11g R2 64bit In Red Hat 5.5, 5.8 And 6.2 Step by Step.



Required Software
1.            Operating System Red Hat Linux 5.5 64 bit.
2.            OracleDatabase 11g R2 64 bit for Linux.

######################  Setup Start Oracle Database 11g R2  ########################## 

1. Set IP and host name the following way.
    System >Administration >Network
    Now set IP in device tag and set host name in Hosts tag.
    Now check your IP and host name the following way.
 
2. Open terminal and write the following

[root@micr~#]vi /etc/hosts
127.0.0.1            localhost.localdomain  localhost
10.11.201.200    micr.localdomain  micr        # micr is the host name

Now ping your user name in the following way.

[root@micr~#]ping micr

(Hints replay 10.11.201.200   IP address. If replay 127.0.0.1 problem)

3. Set minimum parameter settings in the following way.

[root@micr~#]vi /etc/sysctl.conf
 Now press i for insert the following lines. And past the following lines.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912                 # Set this value calculation RAM size*1024*1024*1024
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

[ N.B: If any item is duplicate then set comments previous item Using #)

Check for duplicate item 
[root@micr~#]/sbin/sysctl –p

4. Now set limits the following way 
[root@micr~#]vi /etc/security/limits.conf
 Now press i for insert the following lines. And past the following lines.

oracle              soft     nproc   2047
oracle              hard    nproc   16384
oracle              soft     nofile  4096
oracle              hard    nofile  65536
oracle              soft     stack   10240

5.Now install the following packages if they are not already present from your DVD.

cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*
 
6. Create the new groups and users.
 
[root@micr~#]groupadd oinstall                                                         -- Add new group oinstall
[root@micr~#]groupadd dba                                                             -- Add new group dba
[root@micr~#]groupadd oper                                                            -- Add new group oper
[root@micr~#]groupadd asmadmin                                                    -- Add new group asmadmin
[root@micr~#]useradd -g oinstall  -G dba,oper,asmadmin oracle        -- Creating user with group permition.
[root@micr~#]passwd oracle                                                             -- Set password for oracle user.

8.     Disable secure Linux

[root@micr~#]vi /etc/selinux/config
Making sure the SELINUX flag is set as follows.
SELINUX=disabled

9.    Disable Firewall Configuration

Open terminal and execute the following you can see Security Level Configuration Tool and disable firewall.
[root@micr~#]system-config-securitylevel

10.    Now reboot your system.
 [root@micr~#]reboot

11.     Now logon as root user and perform the following 

Create and grant permission the directories in which the Oracle software will be installed.
[root@micr~#]mkdir -p /u01/app/oracle/product/11.2.0/db_1             -- Creating directory.
[root@micr~#]chown -R oracle:oinstall /u01                                       -- Changing ownership
[root@micr~#]chmod -R 775 /u01                                                     -- Changing Mode

12.     Now logout from root and login as oracle user and set bash profile in the following way.

[oracle@micr~#]vi  .bash_profile
# Now set the following parameter.
ORACLE_HOSTNAME=micr.localdomain; export ORACLE_HOSTNAME  #( User Name = micr)
ORACLE_UNQNAME=micrdb; export ORACLE_UNQNAME             #(Database name = micrdb)
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID= micrdb; export ORACLE_SID                                        #(Database name = micrdb)
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

11.      Now extract database and go to runInstaller path and perform the following.

[N.B. – All file disks 1 and disk 2 combine with one folder (database).]
 Copy all file from Disk -2 and past in disk-1 in path =database/stage
Open terminal and execute the following.

[oracle@micr~#]./runInstaller

######################  End Of Oracle Database 11g R2 Installation ################### 

##############################  Setup Auto Start ###############################

12. Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.
[oracle@micr~#]vi  /etc/oratab

micrdb:/u01/app/oracle/product/11.2.0/db_1:Y

13. Logon as root user

14. Create a new startup script
[oracle@micr~#]vi /etc/init.d/dbora

# Past The Lines

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/u01/app/oracle/product/11.2.0/db_1      # Oracle Database Home Location
ORA_OWNER=oracle                                                   # Oracle Database User Name
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
esac

15. Change the permission
[oracle@micr~#]chmod 750 /etc/init.d/dbora

16. Add it to chkconfig
[oracle@micr~#] chkconfig --level 345 dbora on

17. Start and Stop the service using,
[oracle@micr~#]/etc/init.d/dbora start
[oracle@micr~#]/etc/init.d/dbora stop

18. Now reboot Your Server You can see database auto started.

If You face any problem you can Feel free to contract with me. My email Id is:- rajiboracledev@yahoo.com
Thanks

############################ End of  Setup Auto Start ############################### 

Monday, May 13, 2013

ORA-12203: TNS:unable to connect to destination

Cause: Invalid address specified or destination is not listening. This error can also occur because of underlying network or network transport problems.

Action: Verify that the net service name you entered was correct.Verify that the ADDRESS portion of the connect descriptor which corresponds to the net service name is correct. Ensure that the destination process (for example the listener) is running at the remote node.

Ensure your listener are configuration like this.

[oracle@OEL64BN1 ~]$ cat /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
i# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
      (SID_NAME = orcl)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle


[oracle@OEL64BN1 ~]$

In SID_LIST_LISTENER You have to ensure all of SID are listed which you want to access. [ If SID are not listed listener will use all of SID running in this host ]

Check Your tnsnames.ora (Location =/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora ) file is correct like as

ORCL=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


The ORA-12203 can be the result of an invalid TNS address. In an attempt to eliminate the TNS-12203, verify that the service name is correct and that the name of the host computer defined as part of the TNS address is also valid and correct.
Obviously the other problem, as stated in the Oracle documentation about ORA-12203, the destination may not be not listening. Eliminating the TNS-12203 may involve insuring that the listener is running at the remote node. If the listener service is not running, does not exist and the database has just been newly created on the machine by restoring it from a backup, the listener service will need to be created in order to resolve the ORA-12203.


$ORACLE_HOME/network/log
For resolving an TNS-12203 error, the database alert log may also be a good resource to make sure the database is actually starting. 

Also, it is important to note that if you are experiencing ORA-12203 in newer versions of Oracle, you may be experiencing the brunt of an Oracle bug.