Oracle 11g New Feature - Duplicating a Database Using 11g RMAN From Active Database Option without ANY BACKUP
Oracle 11g New Feature - Duplicating a Database Using 11g RMAN From Active Database Option without ANY BACKUP
We have Target Database name as ORCL
And we are creating a Auxiliary database with name as AUXDB
Image Source - docs.oracle.com
- Check log_mode of Target Database. Target must be in archivelog mode. Otherwise put the database in archivelog mode.
- Create Pfile from Target Database Spfile
- Open pfile with notepad and replace (Ctrl + H) all orcl to auxdb except for parameter local_listener.
- On Windows Platform You need to Create a new Instance for auxdb which also creates a password file for the same.
- Create All the folders in Oracle Folder Structures.
- Create net service name for database auxdb with name say auxdb.
- Add static database service name to listener using net manager.
- Minimum one archivelog is required to make this duplication successful.
- Connect to auxdb and startup instance at nomount stage.
- Now set these two parameters to convert your datafiles and logfile names.
- Now you need to connect Recovery Manager to start the duplicating (cloning) process.
- If all steps are done correctly you will have a new database clone created successfully without any RMAN Backup.
shutdown immediate
startup mount
alter database archivelog;
alter database open;
C:\set ORACLE_SID=orcl
C:\sqlplus / as sysdba
SQL> create pfile='C:\app\Administrator\product\11.2.0\dbhome_1\database\initauxdb.ora' from spfile;
SQL> host notepad C:\app\Administrator\product\11.2.0\dbhome_1\database\initauxdb.ora
SQL> host oradim -new -sid auxdb -syspwd admin
SQL> host mkdir C:\app\Administrator\oradata\auxdb
SQL> host mkdir C:\app\Administrator\flash_recovery_area\auxdb
SQL> host mkdir C:\app\Administrator\admin\auxdb
SQL> host mkdir C:\app\Administrator\admin\auxdb\adump
SQL> host mkdir C:\app\Administrator\admin\auxdb\dpdump
SQL> host mkdir C:\app\Administrator\admin\auxdb\pfile
C:\set ORACLE_SID=orcl
C:\sqlplus / as sysdba
SQL> alter system switch logfile;
C:\set ORACLE_SID=auxdb
C:\sqlplus / as sysdba
SQL> startup nomount //Instance started with pfile
SQL> create spfile from pfile;
SQL> shut immediate
SQL> startup nomount //Instance started with spfile now
SQL> show parameter convert
SQL> alter system set db_file_name_convert = 'orcl','auxdb' scope=spfile;
SQL> alter system set log_file_name_convert = 'orcl','auxdb' scope=spfile;
SQL> shut immediate
SQL> startup nomount
C:\set ORACLE_SID=auxdb
C:\>rman auxiliary sys/admin@auxdb
RMAN> connect target sys/admin@orcl
RMAN> duplicate target database to auxdb from active database;
Awesome !!custom erp company in chennai
ReplyDelete