Vous êtes sur la page 1sur 4

Creating a Clone database manually:

Step 1:
Take a cold backup of primary database.
Run the cold backup script.
Step 2:
Backup the control files using trace.
SQL alter database backup controlfile to trace!
"erify #hether the trace files are generated in udump!
Step$:
%reate a ne# en&ironment file' pass#ord file for ne# S() *i.e.' the clone
database+
cp .,-R.,)Ben& .,%L./-en&
cp orap#,-R.,)B orap#d,%L./-
Step 0:
Restore the cold backup files into clone database.
cp 1appora1app1oracle1oradata1,-R.,B)12.dbf 1appora1app1oracle1oradata1,%L./-1
NOTE: Do not copy the temp datafile as temp table space will be individual to each
database.
Step 3:
Startup the database in no mount.
Set en&ironment to ,%L./- database and and start up in /.4.5/T state.
6 . .,%L./-en&
6s7lplus 81 as sysdba9
SQL startup nomount pfile:9;;mount<pont1dbs1init,%L./-.ora9
Step =:
%reate control files.
Run the create control file s7l file
SQL>createcontrol.s7l
createcontrol.sql
%R-?T- %./TR.L@(L- S-T )?T?B?S- A,%L./-A R-S-TL.BS
/.?R%C("-L.B
4?,L.B@(L-S 1=
4?,L.B4-4B-RS 2
4?,)?T?@(L-S 1DD
4?,(/ST?/%-S 1
4?,L.BC(ST.RE $DD
L.B@(L-
BR.5F 1 G1appora1app1oracle1oradata1,%L./-1redoD1.logG S(H- 1Dm'
BR.5F 2 G1appora1app1oracle1oradata1,%L./-1redoD2.logG S(H- 1Dm'
BR.5F $ G1appora1app1oracle1oradata1,%L./-1redoD$.logG S(H- 1Dm
)?T?@(L-
G1appora1app1oracle1oradata1,%L./-1rman<eds.dbfG'
G1appora1app1oracle1oradata1,%L./-1rmantbsD1.dbfG'
G1appora1app1oracle1oradata1,%L./-1sysauID1.dbfG'
G1appora1app1oracle1oradata1,%L./-1systemD1.dbfG'
G1appora1app1oracle1oradata1,%L./-1testeIampleD1.dbfG'
G1appora1app1oracle1oradata1,%L./-1undotbsD1.dbfG'
G1appora1app1oracle1oradata1,%L./-1usersD1.dbfG'
G1appora1app1oracle1oradata1,%L./-1eIampleD1.dbfG
%C?R?%T-R S-T J-K(S.KK3LF1
!
NOTE 1: We use SET instead of RESE in the fi!st line of the sc!ipt because the
datafiles heade! is havin" #ERO#D$ as S%D as we too& cold bac&up f!om p!ima!y
databse.
This should be set to #'(ONE.
NOTE ): %n the datafile section we do not include temp table space.

Step M:
.pen the database using reset logs.
SQL alter database open resetlogs!
Step K:
As mentioned above we have to create a temp table space and have to add a temp
data file.
?dd the temp table space.
alter tablespace temp add tempfile
81appora1app1oracle1oradata1,%L./-1tempD1.dbf9 siNe 2Dm reuse autoeItend on
neIt =DDk maIsiNe 3g!
Creating Clone using RMAN Duplicate command (10g)
tep 1: Con!igure "istener.ora and tnsnames.ora !iles
tnsnames.ora file
?5,)B :
*)-S%R(FT(./ :
*?))R-SS<L(ST :
*?))R-SS : *FR.T.%.L : T%F+*C.ST : localhost.localdomain+*F.RT : 1321++
+
*%.//-%T<)?T? :
*S-R"(%-</?4- : ?5,)B+
+
+
tep #: copy t$e parameter !ile and pass%ord !ile.
cp init,-R.,)B.ora init,%L./-.ora
cp orap#,-R.,)B orap#,%L./-
tep &: modi!ied parameter !ile !or target database (duplicate) here
log<file<name<con&ert and db<file<name<con&ert and control file location is important'
further your choice.
ADD t$e !ollo%ing parameters
2.db<file<name<con&ert:91appora1app1oracle1oradata1,-R.,)B19'G1appora1app1oracle1or
adata1?5,)B9
2.log<file<name<con&ert:91appora1app1oracle1oradata1,-R.,)B19'G1appora1app1oracle1o
radata1?5,)B9
tep ': start your target database nomount stage
Ooracle>linuIappser&er PQ6 . .?5,)Ben&
Ooracle>linuIappser&er PQ6 s7lplus 81 as sysdba9
SQL startup nomount pfile:9init?5,)B.ora9
tep (: )rom source database
SQL alter system s#itch logfile!
tep *: +ac,up database and arc$i-elog ource database
Ooracle>linuIappser&er PQ6 rman target sys.lords1#&/01R20D+
R4?/ backup database plus archi&elog!
tep 3: Connect au4iliary database
)rom C"2N1 database
R4?/ connect target sys.lords1#&/01R20D+ auIiliary sys.lords1#&/A50D+
connected to auIiliary database: ?5,)B *not mounted+
tep 6: Create duplicate database.
R4?/ duplicate target database to ?5,)B!
tep 7: My duplicate database succes!ully created.
-nter userRname: sys1lords
SQL select status from &6instance!
ST?T5S
SSSS
.F-/
SQL select name from "6database!
/?4-
SSS
?5,)B
Note:
8$ile %e create clone manually t$e D+9D !or bot$ primary and clone are same
%$ere as using RMAN t$e D+9D %ill be di!!erent.
:$is you can -eri!y using
select D+9D !rom -;database<