System Description
—————————————-
##################################################################################
RAC 10g with ASM(Primary):-
——————————————-

Node 1:- Instance Name:-pagasm1 IP:-172.17.240.91 Hostname:-pag1 Service Name:-pagasm
Node 2:- Instance Name:-pagasm2 IP:-172.17.240.92 Hostname:-pag2 Service Name:-pagasm

10g File system(DR)
—————————–

Instance Name:-pagasm Service name:-pagasm Hostname:-01hw105894 IP:-172.17.240.208
##################################################################################

########################################### FOR FAILOVER #########################

1) Remove the physical connection between the primary and DR site
OR
1) Hash out the tnsnames entries of the primary from the DR site’s tnsnames.ora file.

2) Check to confirm that there is no connection between the primary and DR with the help of the tnsping command.

3) At the DR site fire the following queries

SQL> alter database recover managed standby database cancel;
SQL> alter database activate standby database;
SQL> alter database open;
SQL> select open_mode,database_role,name from v$database; (OUTPUT : READ WRITE PRIMARY )

4) You have performed a failover and the system with the hostname 01hw105894 is the new primary.

5) Perform the required transactions on the new primary.

########################### RESTORATION FROM NEW PRIMARY TO THE ORIGINAL RAC PRIMARY##############################

1) Shutdown the database at the new primary(01hw105894) site.

2) Bring the database upto the mount stage.( because RMAN cold backup is taken at the mount phase).

3) After bringing the database to the mount phase exit from SQL prompt and log into RMAN.

C:\>rman target /

4) In the RMAN prompt fire the following commands to take the backup.

RMAN> run
2>{
3>alloacte channel dup1 type disk;
4>allocate channel dup2 type disk;
5>backup device type disk format ‘C:\rman\db_%U’ database;
6>backup device type disk format ‘C:\rman\ct_%U’ current controlfile;
7>release channel dup1;
8>release channel dup2;
9>}

Backup will be taken at the C:\rman location.

5) Shutdown this database.

6)Take the RMAN backup from the DR site and paste it at the same location on either 1 of the node.( I chose node1 so from now on i will use node 1 but you can do it from any of the node)

7)Now you have to remove the controlfile and datafile entries at the RAC site .We will do it with the help of the drop database command.

8)Bring up the RAC database upto the mount phase but in restricted mode.

SQL>startup mount restrict;

SQL>drop database;

With the help of this command all the datafiles ,controlfiles and redo files will be deleted.

9) Now bring the database upto the nomount phase.

SQL>startup nomount;

Now exit from the SQL prompt and log into RMAN.

C:\>rman target /

10)At the RMAN prompt fire the following queries to restore the database;

RMAN>restore controlfile from ‘C:\rman\ct_…..’;

With the help of this command controlfile will be restored.

RMAN>alter database mount;

RMAN>run
2>{
3>allocate channel dup1 type disk;
4>allocate channel dup2 type disk;
5>set newname for datafile 1 to ‘+DB_BSK_GRP/PAGASM/DATAFILE/syastem01.dbf’;
6>set newname for datafile 2 to ‘+DB_BSK_GRP/PAGASM/DATAFILE/sysaux01.dbf’;
7>set newname for datafile 3 to ‘+DB_BSK_GRP/PAGASM/DATAFILE/undotbs01.dbf’;
8>set newname for datafile 4 to ‘+DB_BSK_GRP/PAGASM/DATAFILE/tools01.dbf’;
9>set newname for datafile 5 to ‘+DB_BSK_GRP/PAGASM/DATAFILE/users01.dbf’;
10>restore database;
11>switch datafila all;
12>release channel dup1;
13>release channel dup2;
14>}

With the help of this command all the datafiles will be restored .

11) Now log into the SQL prompt.Over here we will have to change the location of the redolog files with the help of the alter database rename file command.

SQL>alter database rename file ‘The file system location of redolog files’ to ‘+DB_BSK_GRP/PAGASM/ONLINELOG/………’;

12) Open the database with resetlogs option.

SQL>alter database oprn resetlogs;

13) All your files have now been restored at the primary site.so it is now again your paimary..

14)YOu can check this with the help of the following query..

SQL>select open_mode,database_role from v$database;

15) As we were doing it from 1 node only.shutdown the database on node 1.

16)To bring up the database on both the nodes.

C:\>srvctl start database -d pagasm

Database is now up from both the nodes.

You can check by going to the crs home…

C:\oracle\product\10.20\crs\bin>crs_stat -t

Everything shold come as ONLINE

####################### AGAIN CONFIGURING THE DATAGUARD################################

1) Now that the RAC primary is up..we will create a standby controlfile and ship it to the DR site.

SQL>alter database create standby controlfile as ‘C:\rman\STBY.CTL’;

2) Ship this standby controlfile to the DR site and replace the original controlfile with this controlfile.

3) After replacing with the standby controlfile .

SQL>startup nomount;
SQL>alter database mount standby database;
SQL>alter database recover managed standby database disconnect from session;

4) Your DR is again up and running.

 

Leave a Reply