One of the RAC environments I'm working with is a very critical production database, there are several development, test and training clones of it, and from time to time a new clone needs to be created.
The main backup strategy we are using is based on EMC snapshots, so we can easily create clones from snapshots.
Still sometimes you get not standard requirements, or find circumstances that require creative solutions.
The special request was:
- Replicate the 64 bit prod database to a 32 bit training environment
- Production is ASM based, training will be File System based
- There is no, and cannot be communication between Prod and Train
The workaround I did use has several steps but worked fine:
- Open read-only a prod snapshot on a recovery server. In my case I did use a server where we automatically open read only the prod snapshots for backup verification.
- Mount NFS the data File System of the training server on the recovery server
- Generate a create controlfile script using :
alter database backup controlfile to trace;
- Find the trace on user_dump_destination, rename it to CRCTL.sql and move it to the NFS mounted File System
- Backup the database using rman backup as copy. You will get files named like:
- Once the backup finish make a list of the file names order according the FNO-# ; from FNO-1 until the last file
- Optionally you may rename the files to a more simple name, like :
mv data_D-PRODDB_I-2123417810_TS-UNDOTBS2_FNO-21_g5il8cge UNDOTBS2_01.dbf
- Edit the create controlfile script, change the database name using the 'set database ' clause. Replace the datafile names on the CRCTL.sql script you generated on step 3 with the names of the datafiles you got from Rman (or you renamed on step 7) take care to order them according their File Number: FNO-1, FNO-2 etc.
- If this is the first time you clone a database in this server you will need to create the init.ora, and set the bdump, udump, cdump and archived log destinations
- Recreate the controlfile using the CRCTL.sql and open the database with resetlogs.
- Shutdown the database and open it in migrate mode:
- Execute utlirp.sql to change the word size from 64 to 32 bits
- Shutdown immediate
- Startup normal
The database I worked with was a 500GB database, I did use a 2 CPU Linux box to open it read only and backed it up using 8 channels. The throughput was of 1GB per minute.
This is the rman script:
echo `date` >start.backup
# Environment Variables
# Path Variables
# Backup database
rman target / nocatalog <<EOF
allocate channel backup_disk1 type disk format '$v_bdest/%U';
allocate channel backup_disk2 type disk format '$v_bdest/%U';
allocate channel backup_disk3 type disk format '$v_bdest/%U';
allocate channel backup_disk4 type disk format '$v_bdest/%U';
allocate channel backup_disk5 type disk format '$v_bdest/%U';
allocate channel backup_disk6 type disk format '$v_bdest/%U';
allocate channel backup_disk7 type disk format '$v_bdest/%U';
allocate channel backup_disk8 type disk format '$v_bdest/%U';
backup as COPY database include current controlfile;
release channel backup_disk1;
release channel backup_disk2;
release channel backup_disk3;
release channel backup_disk4;
release channel backup_disk5;
release channel backup_disk6;
release channel backup_disk7;
release channel backup_disk8;
echo `date` >end.backup
# EOF backup_to_fs