Monday 23 June 2014

RAC Nodes Time Difference issue bcoz of NTP in 11gR2

In One of our client Time difference between the nodes were keep on increasing drastically.

I fed up by setting that manually between the nodes.

Finally Got a permanent Solution.

We have configured time synchronization using NTP network protocol. But late we have decided oracle to manage the time sync.

For this we have to stop NTP & enable CTSS thats it.. :)

CTSS - Cluster time synchronization Service.


 Time Synchronization – Steps

(Needs to be tested on a test Setup  -  Not tested)

1.       Stop the database

Oracle]$srvctl stop database –d erpdb –o immediate

2.Stop all cluster related services on both the nodes (stopping HAS would stop all the services)
Grid]$crsctl stop has

3.Stop ntp process and remove all the configuration files related to ntpd
# /sbin/service ntpd stop
#/sbin/service ntpd status
#chkconfig ntpd off
#mv  /etc/ntp.conf   /etc/ntp.conf_bkp

Remove the ntpd.pid file.
#rm  /var/run/ntpd.pid
Or  #mv /var/run/ntpd.pid /var/run/ntpd.pid_bkp

4.Now set the date by using date command in Linux by keeping 3 seconds difference between both Nodes
For Example:
Node1]date –s   12:00:00
Node]date –s  12:00:03

       5.As of Now ctss is in observer Mode.
       Reboot Both Nodes, Start high availability Service,

      6. Now check ctss status
      Grid]$crsctl check ctss
      It should be in Active Mode

      7.Start the database and related Services.

Friday 20 June 2014

Creating a Manual Standby from RMAN Backup and switching it to primary

Please find the steps that I have followed,
1.Move Rman backup to Standby Server,
sql>startup nomount;
>rman target /
rman > restore standby controlfile from '/backup/rman/hhhhh';
rman> sql "alter database mount standby database"
rman > catalog backuppiece '/backup/rman/hhhh';
rman > catalog backuppiece '/backup/rman/hhhh';
run
{
set newname for datafile 4 to '/oradata1/db/data/users01.dbf';
set newname for datafile 3 to '/oradata1/db/data/undotbs01.dbf'; 
set newname for datafile 2 to '/oradata1/db/data/sysaux01.dbf';        
set newname for datafile 1 to '/oradata1/db/data/system01.dbf';
set newname for datafile 5 to '/oradata1/db/data/undotbs02.dbf';
set newname for datafile 6 to '/oradata1/db/data/indx_1.dbf';    
set newname for datafile 7 to '/oradata1/db/data/16k.dbf';
set newname for datafile 8 to '/oradata1/db/data/bs.dbf';
set newname for datafile 9 to '/oradata1/db/data/er.dbf';        
set newname for datafile 10 to '/oradata1 db/data/prod.dbf'; 
set newname for datafile 11 to '/oradata2/db/data/prod_2.dbf';
set newname for datafile 12 to '/oradata2/db/data/prod_3.dbf';
set newname for datafile 13 to '/oradata2/db/data/prod_4.dbf';
set newname for datafile 14 to '/oradata2/db/data/rman.dbf';
set newname for datafile 15 to '/oradata2/db/data/om.dbf';
set newname for datafile 16 to '/oradata2/db/data/om_1.dbf';
set newname for datafile 17 to '/oradata2/db/data/ys.dbf';
set newname for datafile 18 to '/oradata2/db/data/example.dbf';
set newname for datafile 19 to '/oradata2/db/data/prod_5.dbf';
set newname for datafile 20 to '/oradata2/db/data/01.dbf';
set newname for datafile 21 to '/oradata2/db/data/system02.dbf';
set until scn 2281756927;
Restore database;
Switch datafile all;
Recover database;
}
sql> Recover standby database;
2.To open the database,
sql> Alter database recover managed standby database finish force;
sql>Alter database commit to switchover to primary;
sql>alter database open;
(While opening the database, it will try to create redologs on the specified path in controlfile.
If that path physically does not exist, it will fail.. We can create new redolgs here by specifying rename command -SQL)

>lsnrctl start