Database clone/replication with RMAN under windows
I'm trying to figure out how to use RMAN to back up a database from one location and restore it on a second server.
Here are the details:
- Version: Ora11gR2 (64 bit) Standard
- OS: Windows Server 2008
- Storage: ASM (using Grid infrastructure, stand alone)
- Server 1: global name XYZ
- Server 2: global name CLONEDB
Both servers are actually up and running, I can log into them, create users/tables, etc. (And both servers have identical file structures and sys passwords.)
I've looked at a lot of research on how to do just a basic backup from one server and recreate/clone the data on the second server. Unfortunately, I seem to be getting more confused than anything... either it will be for Linux, or involve moving to different directories.)
So here's what I have so far:
- On the source database (XYZ) start up RMAN:
rman target / nocatalog
configure controlfile autobackup on;
configure controlfile autoback format for device type disk to 'C:\temp\CF_%F';
configure channel device type disk format 'C:\temp\bkp_%U';
run { backup database; backup archivelog all; }
Now, different authors have given different sets of commands to do the backups. If anyone knows a better way, let me know
Now, on the second database, most authors want you to do the following:
set ORACLE_SID=CLONEDB
oradim -new -sid CLONEDB -pfile C:\temp\initCLONEDB.ora'
This is where I start to get confused:
- I already have an instance up and running, with services under the name CLONEDB. So this step fails. So was I understanding things right? Do I need to eliminate the CLONEDB first, or can I do the import into an existing instance? Or should I make the ORACLE_SID=XYZ (from the source database)? And if I do can CLONEDB keep running (and access the data)?
- The initCLONEDB is supposedly a pfile generated on the source machine, with simply the instance name changed. Is that correct?
The next step is to create a password file:
orapwd file=C:\oracle\product\11.2.0\dbhome_1\database\pwdCLONEDB.ora password=sys entries=10
But if CLONEDB is an existing instance, is that step really necessary?
The final steps are to start up the database in nomount mode and then use:
RMAN> duplicate database to CLONEDB backup location 'C:\temp\';
I don't need anything fancy done. I'm just trying to get the basics worked out. (And unfortunately I haven't had the benefit of training, or of long-term DB admins to work with.)