Professional Documents
Culture Documents
Clonings Classnotes
Clonings Classnotes
production environment
preproduction
PQA primary quality assurance
SQA secondary quality assurance
dev
test/stage/UAT user acceptance testing
production means where the live applications will connect and work.
production is very business critical environments.
production
preproduction
PQA
SQA
test
dev
production
preproduction
test
dev
production
test
dev
1000+ databases
200+ production
200+ preproduction
200+ test
200+ dev
500+ databases
100+ production
100+ preproduction
100+ test
100+ dev
200+ databases
50+ production
50+ preproduction
50+ test
50+ dev
1. cold cloning
2. hot cloning
3. rman cloning with duplicate
4. rman cloning with out duplicate
5. BCV cloning.
1. cold cloning:
production:
clone server
install the same version os including patch level
install the same version of oracle software including patch level
create env file
create same/different directory structure
configure pfile
compatible
db_block_size
undo_management
log_archive_format
memory_target -- these parameters should be same as production
startup nomount
@recreate controlfile with resetlogs
alter database open resetlogs;
2. hot cloning:
will take the hot backup and will do the clone that is called hot cloning.
production
clone server.
startup nomount
@recreate controlfile with resetlogs
recover database using backup controlfile until cancel;
alter database open resetlogs;
will take the rman backup in production and will do the clone that is
called backup based duplicate.
production:
1. take the rman backup and copy the backup to clone server
rman target=/
rman>backup database include current controlfile plus archivelogs;
password file:
cd $ORACLE_HOME/dbs
orapwd file=orapwabc1 password=sys force=y ignorecase=y
1. it will create the spfile and it will shutdown and start the instance
if DB is running with pfile.
2. it will change the dbname to production dbname and dbunique name to
clone name
3. it will restore the controlfile
4. it will go to mount state
5. it will restore the database
6. it will recover the database
7. it will change the dbname to clone dbname
8. it will open the database with open resetlogs
scenario1:
production
clone server:
configure the listener
configure the password file
scenario 2:
we can execute the duplicate command on clone side also.
production
clone side:
configure tnsentry
2. active dupliction:
active duplication means without taking the backup we can do the cloning
so directly it will read the production datafiles and it will do the
clone
limitations:
1. network should be fast between production and clone server for data
transfer.
2. we should enough cpu/memory/IO resources on production otherwise
production database performance may degrade.
production:
configure tnsentry
configure the password file
rman target=sys/sys auxiliary=sys/sys@tnsabc1
clone server
configure the listener
configure the password
production:
1. take the rman backup and copy the backup to the clone server
rman target=/
rman>backup database include current controlfile plus archivelog;
startup nomount
rman> restore controlfile from '/prod/abc/admin/rman/piecename';
alter database mount
catalog backuppiece '/prod/abc1/admin/rman/piece1';
catalog backuppiece '/prod/abc1/admin/rman/piece2';
catalog backuppiece '/prod/abc1/admin/rman/piece3';(if backuplocation is
different we have to register the rman backuppieces in rman repository)
restore database;
switch datafiles all; it will change the datafile location in controlfile
switch tempfile all; it will change the tempfile location in controlfile
recover database;
rename the redolog file member (if directory structure is different)
2. using nid:
shutdown immediate
startup mount
nid target=sys/sys dbname=abc1 setnewname=y
it will change the dbname in controlfile and datafile headers.
shutdown immediate
modify in the parameter file
startup
how to change the dbid
shutdown immediate
startup mount
nid target=sys/sys setnewname=n
it will change the dbid in controlfile and datafile headers.
shutdown immediate
startup mount
alter database open resetlogs;