How to create a NetApp FlexClone RAC Database

In the past I used these procedures to create a FlexClone Oracle RAC database.

Mainly for refreshing a data-warehouse from production.

1- Create pfile from spfile production
create pfile=’/home/oracle/create_clone/initCDWD.ora’ from spfile;
create pfile=’/home/oracle/create_clone/initCDWQ.ora’ from spfile;
2- Create backup control file to trace
alter database backup controlfile to trace as ‘/home/oracle/backup_controlfile/ct_CDWP_resetlogs_151106.sql’ resetlogs; (WE USE THIS ONE FOR FLEX CLONE)
3- Hot Backup Begin
4- Take NetApp snapshot
5- Hot Backup End
6- Perform a Log Switch on Instance 1
7- Perform a Log Switch on Instance 2
8- Wait for 60 seconds so ARC process finishes writing the arc file
9- Take a snapshot of Arch Logs file system
10- Create a Flex Clone file system from the SnapShot
11- Edit pfile created in the step 1 with all the instances changes and cluster_database=false parameter set (Very Important)
*.remote_listener=’LISTENERS_CDWP’ Keep as is…
12- Edit the control file created on step 2 with all new file locations, database name and etc.
13- Create all directories for udump, bdump and etc (IN ALL NODES)
14- Set ORACLE_SID
15- Create password file
16- Create soft links of password file and pfile
17- Delete control files from the FlexClone
18- Startup nomount
19- Create control file from backup controfile
20- recover database using backup controlfile until cancel;
recover database using backup controlfile until cancel;
21- Apply all arch logs from both instances. (this is one of the trick part as SCN can be on either node and only the actual control file knows that, since we have created the new control file in the step 16 all history information were lost), ALSO make sure to change the arch log file name.
22- Add ADD LOGFILE THREAD 2 (Make sure do this before OPEN)
23- Alter database open resetlogs
24- Add TEMP files
25- Shutdown database
26- Edit pfile and set cluster_database=true
27- Startup instance 1
28- Add database to CRS with srvctl
srvctl add database -d <DB NAME> -o $ORACLE_HOME
29- Add instance 1 to CRS
srvctl add instance -d <DB NAME> -i <INSTANCE1>
30- Add instance 2 to CRS
srvctl add instance -d <DB NAME> -i <INSTANCE2>
31- Copy pfile to node 2
32- Login to calrac02 and start up instance 2
33- Create spfile in a share drive
34- Edit the pfile on both nodes to point to this spfile in the share drive
35- Shutdown the database with srvctl stop database –d (Database Name)
36- Startup the database with srvctl start database –d (Database Name)
37- Change all the passwords
38- Change all the DB LINKS

2 thoughts on “How to create a NetApp FlexClone RAC Database

  1. To overcome the trick on step (21), you can query the v$datafile_header, v$log for SCN information, once you END the hot backup.

    this gives us clear indication till what SCN you should recover to bring up the database. And you can apply at least till that SCN to open the database with reset logs option.

    Like

  2. I don’t quite understand what I specifically need to do in step 21 in order to process the log files from both original instances. What does it mean by “Also make sure to change the arch log file name.”? Also, why do I need to do step 22 after the recovery, but before the open? Should this really be done before or during the recovery in order for it to process both log threads? Do you have a sample script or commands for this part of the recovery. Instead of interactive, we would like to script it.

    Thanks,
    Matt

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.