Wednesday, December 30, 2009

Time difference between the RAC nodes is out of sync

If the time difference between the RAC nodes is out of sync (time difference > 30 sec) then it will result one of the following issues

1. CRS installation failure on remote node
2. RAC node reboots periodically
3. CRS Application status UKNOWN or OFFLINE

To avoid these issues configure NTP (Network Time Protocol) on both nodes using any one of the following methods

1. system-config-time or system-config-date or dateconfig

Type command system-config-time or system-config-date or dateconfig at terminal --> Click “Network Time Protocol” ->check “Enable Network Time Protocol” and select NTP server --> Click OK

2. date MMDDHHMMSYY
Type command date with current date and time

3. /etc/ntp.conf
Update /etc/ntp.conf file with timeservers IP addresses and start or restart the ntp daemon
$ /etc/init.d/ntp start
or
$ /etc/rc.d/init.d/ntp start

Once RAC nodes are time sync you might need to shutdown and startup the CRS applications manually.
$ crs_stop ora.testrac1.ons
$ crs_start ora.testrac1.ons

In case if you encounter CRS-0223: Resource 'ora.testrac1.ons’ has placement error then stop and start all CRS Applications to resolve the issue.

$ crs_stop -all
$ crs_start -all

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

Set DISPLAY variable & Enable access control

Before starting the Oracle Universal Installer, the DISPLAY environment must be set correctly for display terminal support. To set the DISPLAY environment run the following command where hostname is the hostname or IP address of the system where the X server is running:

$ export DISPLAY=hostname:0.0

It may be necessary to enable access control on the system where the X server is running, so that the clients can connect. The "xhost" command is used to set access controls. The xhost command must be run on the console of the system where the X server is running. It cannot be done remotely.

To enable access control so that clients from any host can connect to the X server, type the following command:
$ xhost +
access control disabled, clients can connect from any host

To enable access control only to certain clients run the following command
$ xhost +hostname
For ex:- $ xhost +server1
Server1 being added to access control list

Common Errors:-
1. Error: Can't open display
    Error: Couldn't find per display Information

    Solution: 1. Run xhost + to enable access control
                    2. Set your DISPLAY

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

Wednesday, December 23, 2009

Duplicate RAC Database Using RMAN

Oracle provides following methods to convert a single instance database to RAC. You can choose any method based upon your convince.
1. Manual (Using RMAN)
2. Enterprise Manager
3. DBCA
4. RCONFIG (from 10gR2)

Duplicating RAC database is very simple, first duplicate RAC Database to a single instance using RMAN and convert the single instance into a RAC cluster. Please note that straight RAC to RAC duplicate is not possible.

Follow the simple steps to duplicate RAC Database using ASM or other filesystem.



Step1: Create a parameter file for duplicate database(auxiliary)
The easy ways is copy Init.ora parameter from Target database, replace the Target database name with Auxiliary database name and comment all RAC related parameters for ex:- cluster_database, cluster_instances, thread ...Etc

Set CONTROL_FILES to two copies of the control file to +DISKGRP or file system

Step 2: Set DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT to convert the datafile and redo log file names from +DISKGRP1 to +DISKGRP2 or /dbs1 to /dbs2 (For Non-ASM file systems)

Also Set DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_DEST_n to ‘+DISKGRP2’ or /dbs2

Step 3: set _no_recovery_through_resetlogs=TRUE parameter to avoid internal Bug 4355382 ORA-38856: FAILED TO OPEN DATABASE WITH RESETLOGS WHEN USING RAC BACKUP

Step 4: Create a password file for auxiliary database using below command.
$ orapwd file=orapwdupDB password=xxxxxxxx

Step 5: Create a static listener for auxiliary database and reload, because auxiliary database will not register itself with the listener.

(SID_DESC =
(GLOBAL_DBNAME =dupDB.oracleracexpert.com)
(ORACLE_HOME = /oracle/product/db/10202)
(SID_NAME = dupDB)
)

Step 6: Take Full database backup of Target database
RMAN > backup database plus archivelog;

Copy the backup dumps from Target to Auxiliary host. If backup directory structure is different then update the RMAN configuration of the target database to reflect the new backup location

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oracle/rman/dupDB';

Step7: Set ORACLE_SID and start auxiliary database in NO MOUNT state
$ export ORACLE_SID=dupDB
SQL> startup nomount

Step 8: Duplicate Target Database using RMAN Duplicate command
RMAN> CONNECT TARGET /;
RMAN> CONNECT CATALOG rman/*****@catadb;
RMAN> CONNECT AUXILIARY sys/*****@dupDB;
RMAN> DUPLICATE TARGET DATABASE TO dupDB;

Step 9: Add second thread of online redo logs and enable that thread:
SQL> alter database add logfile thread 2
group 3 ('+DISKGRP1','+DISKGRP2') size 50m reuse;
SQL> alter database add logfile thread 2
group 4 ('+DISKGRP1','+DISKGRP2') size 50m reuse;
SQL> alter database enable public thread 2;

For Non-ASM file systems replace ‘+DISKGRP1’, ‘+DISKGRP2' with actual file systems path

Step 10: Uncomment or add all RAC related parameters, shutdown the instance and startup both Instances.

Step 11: create spfile on the shared storage, because all instances must use the same server parameter file. See the link to “Create spfile from pfile”.

Step12: Register RAC instances with CRS
$ srvctl add database -d dupDB -o /oracle/product/db/10202
$ srvctl add instance -d dupDB -i dupDB1 -n testrac01
$ srvctl add instance -d dupDB -i dupDB2 -n testrac02

Step13: Shutdown and startup instances using srvctl
$ srvctl start database –d dupDB

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/