Copy a database on the same machine

Source: Internet
Author: User

Copy the IBS library to orcl1.

Create a password file on two databases:

Set oracle_sid = IBS

Orapwd file = F: \ bbcldb \ orcl1 \ pwdibs1.ora Password = system entries = 30

Set oracle_sid = orcl1

Orapwd file = F: \ bbcldb \ orcl1 \ pwdorcl1.ora Password = system entries = 30

Create a new service

Oradim-New-Sid orcl1

Modify the listener tnsname. ora file of the Primary and Secondary Databases

IBS parameter file:

IBS. _ db_cache_size = 18253611008
IBS. _ java_pool_size = 134217728
IBS. _ large_pool_size = 134217728
IBS. _ oracle_base = 'e: \ app \ Administrator '# oracle_base set from Environment
IBS. _ pga_aggregate_target = 15971909632
IBS. _ sga_target = 22951231488
IBS. _ shared_io_pool_size = 0
IBS. _ shared_pool_size = 4026531840
IBS. _ streams_pool_size = 134217728
*. Audit_file_dest = 'e: \ app \ Administrator \ admin \ IBS \ adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = 'f: \ bbcldb \ IBS \ control01.ctl ', 'e: \ app \ Administrator \ flash_recovery_area \ IBS \ control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'ibs'
*. Db_recovery_file_dest = 'e: \ app \ Administrator \ flash_recovery_area'
*. Db_recovery_file_dest_size = 536870912000
*. Diagnostic_dest = 'e: \ app \ Administrator'
*. Dispatchers = '(Protocol = TCP) (Service = ibsxdb )'
*. Memory_target = 8848692224
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1'
*. Log_archive_format = 'arc % S _ % R. % t'
*. Log_file_name_convert = 'f: \ bbcldb \ IBS ', 'f: \ bbcldb \ orcl1'
*. Db_file_name_convert = 'f: \ bbcldb \ IBS ', 'f: \ bbcldb \ orcl1'

Orcl1 parameter file:

Orcl1. _ db_cache_size = 25769803776
Orcl1. _ Java _pool_size = 134217728
Orcl1. _ large_pool_size = 134217728
Orcl1. _ oracle_base = 'e: \ app \ Administrator '# oracle_base set from Environment
Orcl1. _ pga_aggregate_target = 31406948352
Orcl1. _ sga_target = 30467424256
Orcl1. _ shared_io_pool_size = 0
Orcl1. _ shared_pool_size = 3758096384
Orcl1. _ stream s_pool_size = 268435456
*. Audit_file_dest = 'e: \ app \ Administrator \ admin \ orcl1 \ adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = 'e: \ app \ Administrator \ oradata \ orcl1 \ control01.ctl ', 'e: \ app \ Administrator \ flash_recovery_area \ orcl1 \ control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'orcl1'
*. Db_recovery_file_dest = 'e: \ app \ Administrator \ flash_recovery_area'
*. Db_recovery_file_dest_size = 4102029312
*. Diagnostic_dest = 'e: \ app \ Administrator'
*. Dispatchers = '(Protocol = TCP) (Service = orcl1xdb )'
*. Memory_target = 9842915328
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sec_case_sensitive_logon = false
*. Undo_tablespace = 'undotbs1'
*. Log_archive_format = 'arc % S _ % R. % t'
*. Log_file_name_convert = 'f: \ bbcldb \ IBS ', 'f: \ bbcldb \ orcl1'
*. Db_file_name_convert = 'f: \ bbcldb \ IBS ', 'f: \ bbcldb \ orcl1'

These three lines must be added to the two files.

Set oracle_sid = IBS

C: \ Users \ Administrator> RMAN target sys/system Auxiliary
Sys/system @ orcl1

Recovery MANAGER: Release 11.2.0.1.0-production on Fri Dec 30 18:09:41 2011

Copyright (c) 1982,200 9, Oracle and/or its affiliates. All rights reserved.

Connected to target database: IBS (dbid = 623540487)
Connected to auxiliary database: orcl1 (not mounted)

RMAN> duplicate target database to orcl1 from active database nofilenamecheck;

Starting duplicate dB at 30-dec-11
Using target database control file instead of recovery catalog
Allocated channel: ora_aux_disk_1
Channel ora_aux_disk_1: SID = 201 device type = Disk

Contents of memory script:
{
SQL clone "alter system set db_name =
''Ibs ''comment =
''Modified by RMAN duplicate ''scope = spfile ";
SQL clone "alter system set db_unique_name =
''Orcl1' comment =
''Modified by RMAN duplicate ''scope = spfile ";
Shutdown clone immediate;
Startup clone force nomount
Backup as copy current controlfile auxiliary format 'e: \ app \ Administrator \ or
AData \ orcl1 \ control01.ctl ';
Restore clone controlfile to 'e: \ app \ Administrator \ flash_recovery_area \ orcl1
\ Control02.ctl 'from
'E: \ app \ Administrator \ oradata \ orcl1 \ control01.ctl ';
Alter clone database Mount;
}
Executing memory script

SQL statement: Alter system set db_name = ''ibs ''comment = ''modified by RMAN
Duplicate ''scope = spfile

SQL statement: Alter system set db_unique_name = ''orcl1' comment = ''modified
By RMAN duplicate ''scope = spfile

Oracle instance shut down

Oracle instance started

Total system global area 9820950528 bytes

Fixed size 2184112 bytes
Variable Size 5033167952 bytes
Database buffers 4764729344 bytes
Redo buffers 20869120 bytes

Starting backup at 30-dec-11
Allocated channel: ora_disk_1
Channel ora_disk_1: SID = 187 device type = Disk
Channel ora_disk_1: Starting datafile copy
Copying Current Control File
Output file name = E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ database \ sncfibs. o
RA tag = tag20111230t181012 recid = 1 Stamp = 771271813
Channel ora_disk_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 30-dec-11

Starting restore at 30-dec-11
Allocated channel: ora_aux_disk_1
Channel ora_aux_disk_1: SID = 193 device type = Disk

Channel ora_aux_disk_1: Copied control file copy
Finished restore at 30-dec-11

Database mounted

Contents of memory script:
{
Set newname for datafile 1
"F: \ bbcldb \ orcl1 \ system01.dbf ";
Set newname for datafile 2
"F: \ bbcldb \ orcl1 \ sysaux01.dbf ";
Set newname for datafile 3
"F: \ bbcldb \ orcl1 \ undotbs01.dbf ";
Set newname for datafile 4
"F: \ bbcldb \ orcl1 \ users01.dbf ";
Set newname for datafile 5
"F: \ bbcldb \ orcl1 \ ci_datalrg01.dbf ";
Set newname for datafile 6
"F: \ bbcldb \ orcl1 \ datausr01.dbf ";
Set newname for datafile 7
"F: \ bbcldb \ orcl1 \ datalrg01.dbf ";
Set newname for datafile 8
"F: \ bbcldb \ orcl1 \ datasml01.dbf ";
Set newname for datafile 9
"F: \ bbcldb \ orcl1 \ indexlr1_1.dbf ";
Set newname for datafile 10
"F: \ bbcldb \ orcl1 \ indexsml. DBF ";
Set newname for datafile 11
"F: \ bbcldb \ orcl1 \ datalrg02.dbf ";
Set newname for datafile 12
"F: \ bbcldb \ orcl1 \ datalrg03.dbf ";
Set newname for datafile 13
"F: \ bbcldb \ orcl1 \ datalrg04.dbf ";
Set newname for datafile 14
"F: \ bbcldb \ orcl1 \ datalrg05.dbf ";
Set newname for datafile 15
"F: \ bbcldb \ orcl1 \ datalrg06.dbf ";
Set newname for datafile 16
"F: \ bbcldb \ orcl1 \ datalrg07.dbf ";
Set newname for datafile 17
"F: \ bbcldb \ orcl1 \ indexlr1_2.dbf ";
Set newname for datafile 18
"F: \ bbcldb \ orcl1 \ indexlr1_3.dbf ";
Set newname for datafile 19
"F: \ bbcldb \ orcl1 \ indexlr00004.dbf ";
Set newname for datafile 20
"F: \ bbcldb \ orcl1 \ indexlr1_5.dbf ";
Set newname for datafile 21
"F: \ bbcldb \ orcl1 \ indexlr1_6.dbf ";
Set newname for datafile 22
"F: \ bbcldb \ orcl1 \ indexlr2.167.dbf ";
Set newname for datafile 23
"F: \ bbcldb \ orcl1 \ datalrg08.dbf ";
Backup as copy Reuse
Datafile 1 Auxiliary format
"F: \ bbcldb \ orcl1 \ system01.dbf" datafile
2 auxiliary format
"F: \ bbcldb \ orcl1 \ sysaux01.dbf" datafile
3 auxiliary format
"F: \ bbcldb \ orcl1 \ undotbs01.dbf" datafile
4 auxiliary format
"F: \ bbcldb \ orcl1 \ users01.dbf" datafile
5 auxiliary format
"F: \ bbcldb \ orcl1 \ ci_datalrg01.dbf" datafile
6 auxiliary format
"F: \ bbcldb \ orcl1 \ datausr01.dbf" datafile
7 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg01.dbf" datafile
8 auxiliary format
"F: \ bbcldb \ orcl1 \ datasml01.dbf" datafile
9 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr1_1.dbf" datafile
10 auxiliary format
"F: \ bbcldb \ orcl1 \ indexsml. DBF" datafile
11 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg02.dbf" datafile
12 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg03.dbf" datafile
13 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg04.dbf" datafile
14 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg05.dbf" datafile
15 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg06.dbf" datafile
16 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg07.dbf" datafile
17 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr1_2.dbf" datafile
18 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr1_3.dbf" datafile
19 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr00004.dbf" datafile
20 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr1_5.dbf" datafile
21 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr1_6.dbf" datafile
22 auxiliary format
"F: \ bbcldb \ orcl1 \ indexlr2.167.dbf" datafile
23 auxiliary format
"F: \ bbcldb \ orcl1 \ datalrg08.dbf ";
SQL 'alter system archive log current ';
}
Executing memory script

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Executing command: Set newname

Starting backup at 30-dec-11
Using channel ora_disk_1
Channel ora_disk_1: Starting datafile copy
Input datafile file number = 00007 name = F: \ bbcldb \ IBS \ datalrg01.dbf

 

 

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.