This post covers Oracle EBS (R12) Database Cloning from RMAN backup, one of the most common tasks that Oracle Apps DBAs do (apart from Installation, Patching & AD Administration).
If you are new to Oracle AppsDBA or already working as Apps DBA but on version 11i or R12.1 then suggest you first go through with below FREE videos from Oracle ACE, Author, and Oracle Apps Expert Atul Kumar
- [Video] Oracle Apps DBA (R12.2) Architecture
- [Video] Oracle Apps DBA (R12.2) Installation: FREE Training
- [Video] File System in Oracle E-Business Suite R12.2: Dual, APPL_TOP, INST_TOP, COMMON_TOP, FMW_HOME
- [Video] Oracle Apps DBA (R12.2) Services: Start/Stop
- [Video] Oracle Apps DBA (R12.2) Patching (ADOP): FREE Training
Oracle EBS (R12) Database Cloning using RMAN
Some situations require the database to be recreated separately, without using Rapid Clone. Typical scenarios are when system downtime is not feasible, or advanced database replication tools like RMAN are being used to copy the database in hot backup mode.
The cloning process consists of three phases, each of which is made up of several logical sections and their steps.
1. Prepare Source Database System
a) Log on to the target system as the ORACLE user
b) Execute preclone on Database tier of the source system. (For this example, DEMO is my source system)
$ perl adpreclone.pl dbTier
2. Copy the source database to the target system
a) Log on to the source system database node as the ORACLE user, and then:
- Perform a normal shutdown of the source system database
- Copy the database (.dbf) files from the source system to the target system
- Copy the source database ORACLE_HOME to the target system
- Start the source Applications system database and application tier processes
3. Configure Target Database System
This section documents the steps needed to allow the manual creation of the target database control files within the Rapid Clone process. This method needs to be used for databases located on raw partitions, or when cloning a hot backup.
a) Log on to the target system as the ORACLE user
b) Configure the [RDBMS ORACLE_HOME]
$ cd [RDBMS ORACLE_HOME]/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack
c) Create the target database control files manually
In this step, you copy and recreate the database using your preferred method, such as RMAN restore, Flash Copy, Snap View, or Mirror View.
1. Make sure the directory mentioned in the CHANNEL DEVICE TYPE DISK FORMAT is created. i.e /backup/rman/
$ mkdir -p /backup/rman
Note: Currently this directory is empty. We’ll see what this has after the backup is taken.
$ ls -l /backup/rman
2. We can take a backup using image copy or in backup set. It is strongly recommended to use RMAN backup sets to backup the database.
RMAN stores the backup in backup sets, which are nothing but whole bunch of files which contains the backed-up data. Only RMAN understands the format of these files. So, if you backup an Oracle DB using RMAN, only RMAN knows how to read the backup and restore it.
Typically we’ll use “BACKUP AS BACKUPSET” to backup a database. So, to take a full backup of the database without the archive logs, do the following.
RMAN> BACKUP AS BACKUPSET DATABASE
3. To take a full backup of the database with the archive logs, do the following:
RMAN> BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG;
On a high-level, the following three steps are performed in recovering the database from RMAN backup.
a) Restore controlfile from backup
b) Restore the databse
c) Recover the database
Note: Execute rman restore commands only on a test instance. If you try these restore commands in a production instance, and if something goes wrong, you’ll lose your production data.
1. Restore ControlFile from Backup
First, you may want to restore the control file from the backup before you start the restore.
This step is required only if you are restoring the backup on a new server where the control file doesn’t exist. Or, if the control file on the system you are restoring is corrupted or missing.
RMAN> SET DBID 12345;
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM “/backup/rman/ctl_c-12345-20141003-03”;
RMAN> ALTER DATABASE MOUNT;
Before you start the RMAN restore process, do the following:
a) Set the DBID. You can get the dbid from the name of the control file. This is the number that comes after “ctrl_c-” and the next hyphen. Please note that this depends on the controlfile format that was set on your system. Do a show all to view the format. For this example, the format was: “ctl_%F”
b) Startup the database in nomount option
c) Restore the controlfile form the backup. In this example, the RMAN backup is located under /backup/rman directory. Under this directory, you may have multiple control files. Based on the tiemstamp pick the appropriate one for which you have the full backup.
d) After restoring the control file, mount the database.
When the RMAN backup was taken, if a tag was specified, you can also restore controlfile based a tag name as shown below.
RMNAN> RESTORE CONTROLFILE FROM TAG ‘WEEKLY_FULL_BKUP’;
You can also use the autobackup option to restore the controlfile as shown below:
RMNAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
2. Restore the Database
To restore from the RMAN full backup that is located under the /backup/rman directory, execute the following command.
RMAN> RESTORE DATABASE;
3. Recover Database (and ResetLogs)
If you’ve restored the controlfile from the backup, you need to perform this step.
In the last step, recover the database, and then you should open the database with resetlogs options as show below:
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;
d) Start the target database in open mode
e) Run AutoConfig in the INSTE8_SETUP mode on the database tier as follows:
$ sh <RDBMS_ORACLE_HOME>/appsutil/bin/adconfig.sh contextfile=<CONTEXT_FILE> run=INSTE8_SETUP
f) Run the library update script against the database
$ cd [RDBMS ORACLE_HOME]/appsutil/install/[CONTEXT NAME]
$ sqlplus “/ as sysdba” @adupdlib.sql [libext]
Where [libext] should be set to ‘sl’ for HP-UX, ‘so’ for any other UNIX platform, or ‘dll’ for Windows.
g) Configure the Target database.
The database must be running and open before performing this step.
$ perl adcfgclone.pl dbconfig <Database Target Context File>
Where Database target context file is: [RDBMS ORACLE_HOME]/appsutil/[Target CONTEXT_NAME].xml.
Note: The dbconfig option will configure the database with the required settings for the new target, but it will not recreate the control files.
- Cloning Oracle E-Business Suite Release 12.2 with Rapid Clone (Doc ID 1383621.1)
This post is from our Oracle Apps DBA (R12.2) Training, in which we cover Architecture & Changes in Oracle E-Business Suite R12.2, Staging & Installation, File System & Important Files in R12.2, Start/Stop, Patching, AD Administration, Cloning, Concurrent Managers, AutoConfig, Password Management and Troubleshooting and much more.
Next Task For You
Begin your journey towards becoming an Apps DBA by joining our FREE Masterclass on How To Become an Oracle Apps DBA (R12) & Earn A Lot More In 2020.