Create user-managed copy database notes on the same host

Source: Internet
Author: User

(1) Create an OS directory for storing various related files of the replication database.

(2) create a routine service.

(3) create a parameter file.

  1. Connect to the primary database to create a text parameter file.
  2. Edit the text parameter file.
  3. Create a server parameter file.

(4) copy the data files of the primary database to the directory where the database is copied.

(5) Start the routine and create a control file.

(6) restore the replication database.

(7) Open the copy database.

 

C: \> sqlplus sys/orcl @ demo as sysdba

SQL * Plus: Release 10.2.0.1.0-production on Wednesday February 4 11:35:50 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
Copied       1 file.

SQL> host Copy D: \ demo \ undotbs01.dbf D: \ backup
Copied       1 file.

SQL> host Copy D: \ demo \ sysaux01.dbf D: \ backup
Copied       1 file.

SQL> host Copy D: \ demo \ users01.dbf D: \ backup
Copied       1 file.

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          Archive Mode
Automatic archiving           Enable
Archive endpoint          C: \ demo \ archive
Earliest online log Sequence   56
Next archive log Sequence 58
Current Log Sequence         58

SQL> exit
From Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the partitioning, OLAP and Data Mining options disconnected

C: \> mkdir D: \ dupdb

C: \> mkdir D: \ dupdb \ bdump

C: \> mkdir D: \ dupdb \ udump

C: \> mkdir D: \ dupdb \ archive

C: \> oradim-New-Sid dupdb-syspwd Oracle
The instance has been created.

C: \> sqlplus sys/orcl @ demo as sysdba

SQL * Plus: Release 10.2.0.1.0-production on Wednesday February 4 11:29:18 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> Create pfile = '% ORACLE_HOME % \ database \ initdupdb. ora' from spfile;

The file has been created.

Modify:

Db_name = 'dupdb'
Instance_name = dupdb
Service_names = dupdb
Background_dump_dest = 'd: \ dupdb \ bdump'
Control_files = 'd: \ dupdb \ control01.ctl'
User_dump_dest = 'd: \ dupdb \ udump'
Log_archive_dest_1 = 'location = D: \ dupdb \ archive'

SQL> Create spfile = '% ORACLE_HOME % \ database \ spfiledupdb. ora' from pfile = '% ORACLE _
Home % \ database \ initdupdb. ora ';

The file has been created.

SQL> host Copy D: \ backup \ *. DBF D: \ dupdb
D: \ backup \ sysaux01.dbf
D: \ backup \ system01.dbf
D: \ backup \ undotbs01.dbf
D: \ backup \ users01.dbf
Copied       4 files.

SQL> exit
From Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the partitioning, OLAP and Data Mining options disconnected

C: \> set oracle_sid = dupdb

C: \> sqlplus sys/Oracle AS sysdba

SQL * Plus: Release 10.2.0.1.0-production on Wednesday February 4 11:43:44 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 area603979776 bytes
Fixed size                1250380 bytes
Variable Size           260049844 bytes
Database Buffers        335544320 bytes
Redo Buffers              7135232 bytes
SQL> Create controlfile reuse set Database "dupdb" resetlogsArchivelog
 2    Maxlogfiles 16
 3    Maxlogmembers 3
 4    Maxdatafiles 100
 5    Maxinstances 8
 6    # Maxloghistory 292
 7Logfile
 8  Group 1 (
 9    'D: \ dupdb \ redo01.log'
10  ) Size 50 m,
11  Group 2 (
12    'D: \ dupdb \ redo02.log'
13  ) Size 50 m,
14  Group 3 (
15    'D: \ dupdb \ redo03.log'
16  ) Size 50 m
17Datafile
18  'D: \ dupdb \ system01.dbf ',
19  'D: \ dupdb \ undotbs01.dbf ',
20  'D: \ dupdb \ sysaux01.dbf ',
21  'D: \ dupdb \ users01.dbf'
22Character Set zhs16gbk;

The control file has been created.

SQL> set logsource 'd: \ demo \ archive'
SQL> recover database using backup controlfile until cancel

ORA-00279 :?? 1694834 (? 02/04/2009 11:36:18 ??) ???? 1 ????
ORA-00289 :?? : D: \ demo \ archive \ cb5c05410967449300000000057_0000000.arc
ORA-00280 :?? 1694834 (???? 1 )??? #57?

Specified log: {<RET> = suggested | filename | auto | cancel}
D: \ demo \ archive \ cb5c05410967449300000000057_0020.cbc29ecf.arc
ORA-00279 :?? 1695038 (? 02/04/2009 11:39:40 ??) ???? 1 ????
ORA-00289 :?? : D: \ demo \ archive \ cb5c05410967449300000000058_0020.cbc29ecf.arc
ORA-00280 :?? 1695038 (???? 1 )??? #58?
ORA-00278 :???????????
'D: \ demo \ archive \ cb5c05410967449300000000057_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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.