http://onlineappsdba.com/index.
php/2008/03/24/oracle-applications-11i-hot-backup-
cloning-with-rapid-clone/
Clone8 - HOTCLONE
RapidClone
----------
hot Cloning
-----------
convert from noarchivelog to archivelog
shutdown immediate
startup mount
alter database archivelog;
alter database open;
PROD
----
Stage2: Prepare the Source System (PRODSERVER)
Prepare the source system (System can be up)
-- on the dbtier
cd /d03/oracle/UAT/db/tech_st/11.1.0/appsutil/scripts/UAT_linux4/
perl adpreclone.pl dbTier
-- on the application tier
. ./APPSUAT_linux4.env
cd $ADMIN_SCRIPTS_HOME
perl adpreclone.pl appsTier
perl adpreclone.pl dbTier - clone (required information of the source -
context file )
perl adpreclone.pl appTier - clone (required information of the source -
context file )
Stage3: Put the Database in Begin Backup Mode and copy the Database Files
alter database begin backup;
alter database backup controlfile to trace;
cd /d03/oracle/UAT/db/apps_st/data
-- copy the datafile
scp -pr *.* root@newserver:/d03/oracle/hotclone/db/apps_st/data
-- copy the oracle home
alter database end backup;
alter system switch logfile;
cd /d03/oracle/UAT/db/tech_st/11.1.0/admin/UAT_linux4/diag/rdbms/uat/UAT/
Copy the source system to the target system
copy the entire application and database from source to target (inst_top -
don't copy)
Stage4: Copy the Application Tier File System Files
Stage5: Copy the Source Database files and Application Files to Target server
Stage 6: Configure the Target Database (TESTSERVER)
a>Configure the <RDBMS ORACLE_HOME
cd /d03/oracle/HOTC/db/tech_st/11.1.0/appsutil/clone/bin/
perl adcfgclone.pl dbTechStack
export KSH_VERSION='@(#)PD KSH v5.2.14 99/07/13.2'
b> Create the target database control file manually
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2166536 bytes
Variable Size 427819256 bytes
Database Buffers 624951296 bytes
Redo Buffers 14000128 bytes
SQL> @controlfile.sql
CREATE CONTROLFILE set DATABASE "HOTC" RESETLOGS NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: control file could not be created
ORA-00202: control file: '/d03/oracle/HOTC/db/apps_st/data/cntrl01.dbf'
ORA-27038: created file already exists
Additional information: 1
cd /d03/oracle/HOTC/db/apps_st/data
mkdir control
mv cntrl* control
sqlplus "/as sysdba"
@controlfile
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
-- we need apply the archivelogfiles
SQL> @controlfile.sql
Control file created.
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
ORA-00279: change 10132145207694 generated at 10/19/2011 10:51:30 needed for
thread 1
ORA-00289: suggestion :
/d03/oracle/HOTC/db/apps_st/data/archive/1_4_764594988.dbf
ORA-00280: change 10132145207694 for thread 1 is in sequence #4
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SQL> alter database open resetlogs;
Database altered.
-- Create the temp files
ALTER TABLESPACE TEMP1 ADD TEMPFILE '/d03/oracle/HOTC/db/apps_st/data/temp03.dbf'
SIZE 524288000 REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP1 ADD TEMPFILE '/d03/oracle/HOTC/db/apps_st/data/temp01.dbf'
SIZE 1048576000 REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP2 ADD TEMPFILE '/d03/oracle/HOTC/db/apps_st/data/temp02.dbf'
SIZE 524288000 REUSE AUTOEXTEND OFF;
(3) Run the library update script against the database
cd $ORACLE_HOME/appsutil/install/<CONTEXT NAME
sqlplus "/ as sysdba" @adupdlib.sql so
Where <libext> is �sl� for HP-UX,
�so� for any other UNIX platform and not required for Windows.
(4)Configure the target database (the database must be open)
cd $ORACLE_HOME/appsutil/clone/bin
perl adcfgclone.pl dbconfig
/d03/oracle/HOTC/db/tech_st/11.1.0/appsutil/HOTC_linux4.xml
where target context file is: <RDBMS ORACLE_HOME>/appsutil/<Target
CONTEXT_NAME>.xml
or
cd $ORACLE_HOME/appsutil/scripts/HOTC_linux4
sh adautocfg.sh
Stage 7 : Configure the Target Application Tier
cd /d03/oracle/HOTC/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier
Configure target system
perl adcfgclone.pl dbTier - hostname, SID, port, where are your
datafiles ....recreate the control file - brings up the database - DEV
perl adcfgclone.pl appsTier- hostname,port, APPL_TOP, common_top, 10.1.2,
10.1.3 - creates a new context file - bring up the application
Web browser -
Finishing Tasks
varies from client to client -
5 minutes
Site%Name - profile - "DEV - Clone of PROD as 18-jul-2011"
Custom_top changes
PRoduction password - FNDCPASS (autoconfig on dbTier and appsTier) -
apps/apps - sysadmin/sysadmin
4 hours
Hot cloning/RMAN cloning
------------------------
http://onlineappsdba.com/index.php/2008/03/24/oracle-applications-11i-hot-backup-
cloning-with-rapid-clone/
database is up and running and we clone
alter database begin backup;
--- copy the datafiles,redologfiles, archvielog files (generated during the copy
processes)
alter database end backup;
alter system switch logfile;
alter database backup controlfile to trace;
copy the trace file -
Target - TEST
-----
Modify the trace file
cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
perl adcfgclone.pl dbTechStack - prepares the environment - TEST
initTEST.ora, tnsnames.ora,listener.ora -
startup nomount
@control.sql - mounted stage
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
-- few archvielog file
CANCEL
-- Media recovery cancelled
-- Still needs archive logs
RMAN cloning
------------
Backup production
-----------------
rman
connect target
backup database plus archivelogs;
NFS Setup
---------
On server - linux1
/backup/hotbackup/PROD 192.168.1.10(rw,sync,no_root_squash)
service nfs restart
On client - linux2
mkdir -p /backup/hotbackup/PROD
mount linux1:/backup/hotbackup/PROD /backup/hotbackup/PROD
On prod -
select member from v$logfile
union
select name from v$controlfile
union
select name from v$datafile;
create password file
orapwd file=orapwPROD password=oracle entries=5
On cloned instance- FRB
-- make an entry in tnsnames.ora
PROD=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=linux1.com)(PORT=1521))
(CONNECT_DATA=
(SID=PROD)
)
)
-- check connection
sqlplus sys/oracle@prod as sysdba
-- make an entry for ifile in initDEV.ora
cat ifile.ora
event="10298 trace name context forever, level 32"
_no_recovery_through_resetlogs=TRUE
db_file_name_convert =("/data/PROD/db","/data2/TEST/db")
log_file_name_convert =("/data/PROD/db","/data2/TEST/db")
log_file_name_convert =("/redo/PROD/db","/data2/TEST/db")
-- copy the Oracle home from PROD to TEST
cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
perl adcfgclone.pl dbTechStack - prepares the environment - TEST
startup nomount
cat dup.rman
run {
set until time "to_date('JUN 27 2011 17:27:00','Mon DD YYYY HH24:MI:SS')";
allocate auxiliary channel C1 device type disk;
allocate auxiliary channel C2 device type disk;
allocate auxiliary channel C3 device type disk;
allocate auxiliary channel C4 device type disk;
duplicate target database to "TEST";
}
cat > run.sh
$ORACLE_HOME/bin/rman target sys/oracle@prod auxiliary / @dup.rman -- 95 %
succesfully
-- Mounted
-- I need more archivelogfiles
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
-- Apply archive logs
NFS - mounted
/backup - PROD machine
TEST
mkdir -p /backup
/backup
-- copy the RMAN backup files from PROD to TEST