EBS CLONING:
A cloning is a process of creating identical copy of EBS of source
system on a target system. If we simply copy the EBS it will create problem
because there are numerous configuration files in the file system that must be
modified, depending on the physical configuration of the target environment.
BENEFIT OF CLONING:
- Creating a copy of a production system for patch testing
- Creating a staging area to reduce the downtime required for patching
- Refreshing a test system from a production system
- Moving an existing system to a different machine or platform
CLONING TOOLS:
1.
Rapid clone tool
CLONING OPTION:
- Single node to Single node
- Recloning (of database only)
- Clone existing Clone
- Multi-node to Multi-node
- Single node to Multi-node
- Multi-node to Single node
RAPID CLONE:
Ø Rapid Clone does not modify the source system. Rapid Clone requires
all the expected binary files to be in place on the source system, and may fail
to operate correctly if any are missing.
Ø The adpreclone.pl script
prepares the source system to be cloned by collecting information about the
database, and creating generic templates. The template files are located in /appsutil/template
on the database tier.
Ø After running adpreclone.pl, you copy the relevant files and
directories from the source system files to the target system, and then run the
adcfgclone.pl on target system.
Ø Edit the context file on
the target system after adcfgclone.pl
completes, then running AutoConfig
to update the system with the new value.
EDB CLONING STEP BY STEP:
1.
First we r going to login to
your Linux server by host name and password using the putty and VNC viewer (in
my scenario because our EBS was install on Amazon Server).
2.
Start the DB tier by using the
following command. We need to login as Oracle
user for starting or stopping the DB tier.
§ su oracle
§ cd /data01/oracle/VIS/db/tech_st/11.1.0/script// OR cd $ORACLE_HOME
§ adstrtal.sh
3.
Start the APP tier by using the
following command. We need to login as Applmgr
user for starting or stopping the APP tier.
§ Su Applmgr
§ Cd /data01/oracle/VIS/APPS//admin/scripts/ OR cd
$ADMIN_SCRIPTS_HOME
§ Adstrtal.sh
4.
Now run adpreclone.pl to
perform the pre cloning steps in DB tier it prepares the source system to be
cloned by collecting information about the database, and creating generic
templates.
§ su oracle
§ cd /data01/oracle/VIS/db/tech_st/11.1.0/script// OR cd $ORACLE_HOME
§ Perl adpreclone.pl
5.
Now run adpreclone.pl to
perform the pre cloning steps in DB tier it prepares the source system to be
cloned by collecting information about the database, and creating generic
templates.
§ Su Applmgr
§ Cd /data01/oracle/VIS/APPS//admin/scripts/ OR cd $ADMIN_SCRIPTS_HOME
§ Perl adpreclone.pl
6.
Now copy the db tier and app
tire to the target system (50.18.192.24) using special copy command here data02
is directory in target machine.
§ scp –i /root/appsclass.pem
–r /data01/oracle/VIS/apps/ root@50.18.192.24: /datao2/clone/apps/
7.
After running adpreclone.pl,
you copy the relevant files and directories from the source system files to the
target system, and then run the adcfgclone.pl
on target system.
8.
Set the environment variable.
ORACLE DATABASE CLONING:
A cloning is a
process of creating identical copy of database of source system on a target
system. If we simply copy the database it will create problem because there are
numerous configuration files that must be modified, depending on the physical
configuration of the target environment.
BENEFIT OF CLONING:
·
Creating a copy of a production
system for patch testing
·
Creating a staging area to
reduce the downtime required for patching
·
Refreshing a test system from a
production system
·
Moving an existing system to a
different machine or platform
CLONING TOOLS:
·
Using OEM
·
Manually by using command
prompt.
MANUALLY CLONING OF THE
DATABASE:
We can manually copy database to another location with the same features
Steps:
1.
Start the database
If we created database using DBCA then go to
app->administrator->oradata-> (here db will there that you want to
clone)->make new folder with the clone name of db. OR
If we created database to our preferred location then create new
folder to that drive with clone database name.
2.
Go to flash recovery area which
will present in app->administrator. Make another folder with clone database
name.
3.
Create new instance
Ø oradim –new –sid clone
syspwd ****
4.
Login to source database using
sqlplus as sys/sys as sysdba.
5.
Now create pfile for target
database from source database spfile. using command
Ø Create pfile =’d:/data/pfileclone.ora’
from spfile
6.
Now create control file for
target database using this command
Ø Alter database backup
controlfile to trace as ‘d: /data/controlfile.ora’
7.
Now shutdown your source
database only in normal or immediate mode
Ø Shutdown immediate OR
Ø Shutdown normal
8.
Now copy source database‘s all
files except the control file to the target database clone. Using copy command
or simply os copy command.
9.
Open pfileclone.ora with
notepad and replace all source database
name by clone
Database name and
also take a look of path.
10.
Now login to clone sit to
sqlplus by providing password that u given to earlier while creating the sid.
Ø Set oracle_sid=clone
Ø Sqlplus sys/****** as
sysdba
11.
Now create spfile from pfile
that earlier you created manually from the source database spfile.
Ø Create spfile from
pfile=’D:/data/pfileclone.ora’
12.
Start-up the database at no
mount stage so it can be run with the control file
Ø Startup nomount
13.
Now we have to create control
file using the script and the script we can get from the source database
control file itself by changing some items as replace all source database name
with clone database name removing unwanted line and replacing reuse with set
etc. I m providing the all required steps do it carefully.
Ø Open control file that we created earlier
on location d:/data/controlfile.ora with notepad
Ø Copy all the line starting
with Create controlfile till the semicolon (;) and save this to another
location using the name create.sql
Ø Save as like “create.sql”
in some windows.
Ø Replace all source
database name with clone database name ex replace all sourcedb to clone using
find and replace option in notepad.
Ø Delete all -->
Ø Delete all spaces
Ø Replace reuse with set
Ø Replace noresetlogs to
resetlogs
Ø Save the file it will look
like a sql script
14.
Run script using following
command
Ø @D:/ create.sql
15.
Now run the reset log command
it will reset the database and file will be created in the clone db folder as
well as the flash recovery area.
Ø Alter database open
resetlogs;
Ø Shutdown immediate
Ø Startup normal
Ø Now this is your clone db
16.
Now only this we need to change
is to change the db id it can be done by using the command prompt command are
given below.
Ø nid target =d:/clone
Ø Yes
CLONING USING OEM:
We can also perform the cloning operation using the OEM which is
very easy and it’s GUI
Steps:
1.
Startup database and open OEM
in the browser using the link given below. Or at the oracle home start-up click
on the link. Mainly it is https:/ followed by host name then port number then
language then consol then logon/logon
2.
Login as sysdba using password
and user name example sys/*** as sysdba
3.
Go to data movement
4.
Click on clone database
5.
Specify the source for the
cloning operation.
Ø Choose Use
Recovery Manager (RMAN) to copy database files and click on the continue
6.
Source option
Ø sSpecify the source host credential
It can be done using the control panel the steps are as follow
a.
Control panel
b.
System and security
c.
Administrative tools
d.
Local security policies
e.
Local policies
f.
User right assignment
g.
Log as a batch server (right
click here)
h.
Add user
i.
Add computer name here as
DARKNIGHT (NOT AS DARKNIGHT-PC)
j.
Give user name as DARKNIGHT and
password as password of system (ur computer password) if u don’t have password
in ur system then create one.
7.
Select Destination:
Ø Give destination name
Ø destination credential
Ø destination password
Ø clone database name
Ø clone database instance name etc
8.
Destination option:
Ø select flash recovery or OFA
9.
Database configuration
Ø Provide password of all users
10.
Schedule the cloning
11.
Submit the job