Manual Cloning Of Oracle Database Using Rman
This post includes a step by step guide to manually clone a Database using Rman. In some cases it may be useful to have the flexibility to configure and implement.
Question: I want to use RMAN to copy a database to a different server, in a different disk directory. Can I use RMAN to restore a database to another server?
Answer: Cloning the database on the remote host requires two servers. Both servers should have Oracle Software installed on them.
Make sure the Operating System is the same on both the servers. On the first server, we should have one database which will be duplicated to the second host. The first server will be named as 'production server' and the database on it will be called 'production database' (SID of the production database is db1). However, the second server will have a name as 'auxiliary server' and the database which will be created on it will be called 'auxiliary database' (SID of the auxiliary database is aux). The server name of the production database is PRODSERVER and the server name of the auxiliary database is DUPSERVER Also see: Before cloning the production database, we should configure some initial actions as follows: Step 1 - Create a password file for the auxiliary instance It's possible to create a password file on the production server as well as on the auxiliary server. Because the passwords of target and auxiliary databases password files should not be similar as it's a security threat. However, it should be mentioned that when creating standby database from RMAN, the password file has to be same.
But here, as we don't create standby database, the new password file should be created. Create a password file using ORAPWD utility as follows. $ orapwd file=$ORACLEHOME/dbs/orapwaux password=test entries=3; Step 2 - Configure auxiliary instance listener net configuration To clone the production database to auxiliary server, the connection should be configured between two servers i.e. Must be able to access the production database from auxiliary server and vice versa. Thus, you need to make changes to tnsnames.ora and listener.ora files.
If you haven't, these files are located in the $ORACLEHOME/network/admin directory, create them using netca utility. First of all, change LISTENER.ORA file on auxiliary server and add the following lines. LISTENER.ORA #auxiliary instance (SIDDESC = (SIDNAME = aux) (ORACLEHOME = /u01/oracle/product/10.2.0/db1) ) The reason why we made a change to listener.ora file is because we make auxiliary server to listen for the connections which comes from the production database.
While duplicating the database, we'll connect to the auxiliary instance from the production database and as an auxiliary instance should understand and accept the connections which come from production database, we configured the listener.ora file. Without stopping and starting the listener, we apply new changes made to listener configuration by running the following command.
$ tnsping aux Attempting to contact (DESCRIPTION = (ADDRESSLIST = (ADDRESS=(PROTOCOL=TCP)(HOST= DUPSERVER)(PORT=1521))) (CONNECTDATA= (ORACLESID=aux))) OK (40 msec) It means that we have access to the auxiliary server from production server and we successfully configured connection between two servers Step 3 - Create a parameter file for an Auxiliary database We'll use this parameter file to start auxiliary instance in NOMOUNT mode. You can create pfile from spfile of production database and copy it to the auxiliary server. You can also create a parameter file which consists only of the following few parameters:.
DBNAME: As we create duplicate database at the remote host, we can keep database name the same as the production database name. However, this parameter will be different when we duplicate database on the local host, because it's impossible to have two databases with the same name in one host. CONTROLFILES: This parameter defines the name of Control Files which will be restored to auxiliary instance. DBBLOCKSIZE: This parameter must be the same as in the target instance. COMPATIBLE: If production database uses specific compatible parameter, add this parameter to auxiliary parameter file with the same value.
SGATARGET: This parameter specifies the total size of all SGA components. To automatically size these components, make it the same as in the production database.
However it is not mandatory that this be the same size as in the production database. The cloning may be done to create a Test / Development environment on a smaller server with lesser RAM. You need also to create the following directories on the auxiliary server and add them to the parameter file:. adump. bdump. udump. cdump.
Flash Recovery Area. SQL STARTUP NOMOUNT ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 92276304 bytes Database Buffers 188743680 bytes Redo Buffers 2973696 bytes Step 5 - Backup the production database and copy all backup files to auxiliary server As the auxiliary instance is ready, you need to backup the production database and copy backup files to auxiliary server. As the backup will be recovered on the auxiliary server, the production database should be in ARCHIVELOG mode Connect to target instance and take the compressed backup of the database using nocatalog. The backup of the database can be taken by connecting to the RMAN catalog database as well.
# mkdir u02 # cd u02/ # mkdir oradata # cd oradata/ # mkdir db1 # cd db1/ # chown -R oracle:oinstall /u02/ Step 7 - Copy the backup of the production database to the same directory residing on the auxiliary database server As we configured the database to use Flash Recovery Area, all RMAN backups will be stored under the flash recovery area folder. So the same folder should be created at the auxiliary server and all backup files should be copied to that folder. When you issue the DUPLICATE DATABASE command, RMAN searches the auxiliary server for the backup files which should reside at the same folder where they were at the production server.
Identify the location of RMAN backups on the production server and create the same folders on the auxiliary server. Then copy all backup files from the production server to the auxiliary server Step 8 - Duplicate the Database After all above steps are done correctly, we're ready to create the clone database. For this, we connect to both production and auxiliary database from RMAN and issue the command 'DUPLICATE TARGET DATABASE TO aux'. Get the Complete Oracle Backup & Recovery Details The landmark book provides real world advice for resolving the most difficult Oracle performance and recovery issues. For 40% off directly from the publisher. �� Burleson is the American Team Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.
Feel free to ask questions on our. Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their. Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page.
Oracle Rman List Backup Summary
Burleson Consulting The Oracle of Database Support Copyright © 1996 - 2017 All rights reserved by Burleson Oracle ® is the registered trademark of Oracle Corporation. Remote Emergency Support provided.