(1) Create an OS directory for storing various files related to the replication database.
(2) create a routine service.
(3) create a parameter file.
- Connect to the primary database to create a text parameter file.
- Edit the text parameter file.
- Create a server parameter file.
(4) copy the data file backup, parameter file, and archive log of the primary database to the host where the replication database is located.
(5) Start the routine and create a control file.
(6) restore the replication database.
(7) Open the copy database.
Host where the primary database is located:
C: \> sqlplus sys/orcl @ demo as sysdba
SQL * Plus: Release 10.2.0.1.0-production on Wednesday February 4 13:45:37 2009
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connect:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the partitioning, OLAP and Data Mining options
SQL> select name from V $ datafile;
Name
-------------------------------------------------------------------------------
D: \ demo \ system01.dbf
D: \ demo \ undotbs01.dbf
D: \ demo \ sysaux01.dbf
D: \ demo \ users01.dbf
SQL> alter database begin backup;
The database has been changed.
SQL> host Copy D: \ demo \ system01.dbf D: \ backup
1 file has been copied.
SQL> host Copy D: \ demo \ undotbs01.dbf D: \ backup
1 file has been copied.
SQL> host Copy D: \ demo \ sysaux01.dbf D: \ backup
1 file has been copied.
SQL> host Copy D: \ demo \ users01.dbf D: \ backup
1 file has been copied.
SQL> alter Database End backup;
The database has been changed.
SQL> alter system archive log current;
The system has been changed.
SQL> alter Database Backup controlfile to trace resetlogs;
The database has been changed.
SQL> archive log list
Database Log mode archiving Mode
Enable automatic archiving
Archive end point c: \ demo \ archive
Oldest online log sequence 58
Next archive log sequence 60
Current Log sequence 60
Host where the database is copied:
C: \> mkdir D: \ demo
C: \> mkdir D: \ demo \ bdump
C: \> mkdir D: \ demo \ udump
C: \> mkdir D: \ demo \ archive
C: \> oradim-New-Sid demo-syspwd Oracle
The instance has been created.
Host where the primary database is located:
SQL> Create pfile = '% ORACLE_HOME % \ database \ inittemp. ora' from spfile;
The file has been created.
Modify:
Background_dump_dest = 'd: \ demo \ bdump'
Control_files = 'd: \ demo \ control01.ctl'
Log_archive_dest_1 = 'location = D: \ demo \ archive'
User_dump_dest = 'd: \ demo \ udump'
SQL> Create spfile = '% ORACLE_HOME % \ database \ spfiletemp. ora' from pfile = '% oracle_h
Ome % \ database \ inittemp. ora ';
The file has been created.
C: \> Copy D: \ backup \ *. DBF \ test \ D \ demo
D: \ backup \ sysaux01.dbf
D: \ backup \ system01.dbf
D: \ backup \ undotbs01.dbf
D: \ backup \ users01.dbf
Four files have been copied.
C: \> Copy D: \ demo \ archive \ *. arc \ test \ D \ demo \ archive
D: \ demo \ archive \ cb5c05410967449300000000026_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000027_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000028_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000029_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000030_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000031_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000032_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000033_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000034_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000035_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000036_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000037_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000038_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000039_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000040_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000041_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000042_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000043_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000044_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000045_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000046_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000047_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000048_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000049_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000050_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000051_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000052_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000053_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000054_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000055_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000056_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000057_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000058_0020.cbc29ecf.arc
D: \ demo \ archive \ cb5c05410967449300000000059_0020.cbc29ecf.arc
34 files have been copied.
C: \> copy % ORACLE_HOME % \ database \ spfiletemp. ora \ test \ D \ oracle \ product \ 10.2.0 \ DB
_ 1 \ database \ spfiledemo. ora
1 file has been copied.
Host where the database is copied:
C: \> set oracle_sid = demo
C: \> sqlplus sys/Oracle AS sysdba
SQL * Plus: Release 10.2.0.1.0-production on Wednesday February 4 14:12:59 2009
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Already connected to the idle routine.
SQL> startup nomount
The Oracle routine has been started.
Total system global area 603979776 bytes
Fixed size 1250380 bytes
Variable Size 260049844 bytes
Database buffers 335544320 bytes
Redo buffers 7135232 bytes
SQL> Create controlfile reuse Database "Demo" resetlogs archivelog
2 maxlogfiles 16
3 maxlogmembers 3
4 maxdatafiles 100
5 maxinstances 8
6 maxloghistory 292
7. logfile
8 Group 1 ('d: \ demo \ redo01.log) size 50 m,
9 group 2 ('d: \ demo \ redo02.log ') size 50 m,
10 group 3 ('d: \ demo \ redo03.log ') size 50 m
11 datafile
12 'd: \ demo \ system01.dbf ',
13 'd: \ demo \ undotbs01.dbf ',
14 'd: \ demo \ sysaux01.dbf ',
15 'd: \ demo \ users01.dbf'
16 character set zhs16gbk;
The control file has been created.
SQL> set logsource 'd: \ demo \ archive'
SQL> recover database using backup controlfile until cancel
ORA-00279 :?? 1699580 (? 02/04/2009 13:45:50 ??) ???? 1 ????
ORA-00289 :?? : D: \ demo \ archive \ cb5c05410967449300000000059_0000000.arc
ORA-00280 :?? 1699580 (???? 1 )??? #59?
Specified log: {<RET> = suggested | filename | auto | cancel}
D: \ demo \ archive \ cb5c05410967449300000000059_0020.cbc29ecf.arc
ORA-00279 :?? 1699661 (? 02/04/2009 13:48:39 ??) ???? 1 ????
ORA-00289 :?? : D: \ demo \ archive \ cb5c05410967449300000000060_0020.cbc29ecf.arc
ORA-00280 :?? 1699661 (???? 1 )??? #60?
ORA-00278 :???????????
'D: \ demo \ archive \ cb5c05410967449300000000059_0020.cbc29ecf.arc'
Specified log: {<RET> = suggested | filename | auto | cancel}
Cancel
Media recovery has been canceled.
SQL> alter database open resetlogs;
The database has been changed.