Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Duplicate DB experiment on the same host (including GI)

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Illustrative text:

Oracle version 11g operating system: oracle linux 5

Main DB (target DB)-> connection-> Duplicate DB

-create a directory for Duplicate DB based on the main library

-create a parameter file (pfile) for Duplicate DB based on the parameter file (pfile) of the main library. If it is not found in the above path, create a pfile:create pfile from spfile; in the main library and then go to the $ORACLE_HOME/dbs path and ls will see it.

-vim / etc/hosts in the figure is to add IP parsing [root@sink ~] # cat / etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 sink localhost.localdomain localhost:: 1 localhost6.localdomain6 localhost6 192.168.10.6 sink

-Delete sink. That is the content under the sink instance. Here we are creating a test library based on the sink library, so the parameter information of the sink instance cannot exist.

-to modify the size of memory_target, it is better to have a gap with the original value, because it is the memory running by a host. If you do not modify it, an error will be reported, indicating that the test library cannot be opened.

-if there is a db_unique_name that needs to delete this line, if it is not deleted, it will be a library. Unique means an alias, which is equivalent to creating an auxiliary library. You need to set up db_unique_name when you manually TSPITR and RMAN TSPITR. Here you set up a new library, so you don't need it.

-pay attention to the path of control_files. It's best to set it under one path for easy modification. Of course, it can also be multiplexed. It's just troublesome. I still don't have a good command of this part. I'm not good at teaching tricks. Let's set the same path here.

-esc to bottom line command mode:% s/sink/test/g replaces all sink with test

-finally, add the bottom two path transformations (data files, redo log files). You'd better go to the main library to take a look at the asm path. This is just a reference path. Your actual path must be different from mine.

-after GI is configured, listener.ora snooping is taken over by GI, so configure snooping in grid user network configuration

-in duplicate, the test library must be in nomunt state, so if you want to connect to listeners, you can only register statically, so configure static registration for test on default listeners.

-the following tnsname.ora message is that I have taken too many screenshots. Don't worry about it.

-ORACLE_HOME needs to pay special attention not to make mistakes. I made mistakes at that time. Then the status I saw in the following lsnrctl status is always BLOCKED. There is a big hole here. It is best to check the actual path at echo $ORACLE_HOME under the command line.

-when you come to oralce users, there are too many screenshots for listener.ora messages. (please forgive me for not handling the pictures properly. I am only a rookie with little knowledge. I insist on writing a blog just to stimulate enthusiasm and share insights.)

-go to the path of oracle network configuration and configure tnsname.ora,sink (main DB) test (duplicate DB)

-default is sink instance

-Direct! sql-> Open sink (main DB)

-export to test instance

-startup nomount the test library

-restart listener snooping under grid user

It is found that test is connected, and the status message displayed as UNKNOW indicates that test is using the static registration just configured. If it is BLOCKED, there is a problem with your configuration of static registration. Test does not use static registration.

-start main DB (sink)-Connect-> duplicate DB (test)

-Note: error comes from the target library, and target DB refers to main DB (main library sink), so restart the sink library below.

-restart target DB

-after rebooting, you enter the RMAN environment normally.

-duplicate starts duplicate target DB to (to) test library

-this is a screenshot of the end of the duplicate command, as shown in figure database opened. Indicates that the clone is complete

-go back to the cloned test library and do a simple query to view the information of test

-all right, it feels like it worked.

PS: welcome to reprint. If you need to reprint, please indicate the source link. Thank you.

This is the last step to execute the output of the clone, leaving it for the next study, because I don't know what kind of process it is in the process of Duplicate DB. I'll put it on hold here, and I'll fix it next time.

Xshell for Xmanager Enterprise 5 (Build 0738)

Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.

[C:\] $

Connecting to 192.168.10.6:22...

Connection established.

To escape to local shell, press' Ctrl+Alt+]'.

Last login: Thu Jan 4 19:33:04 2018 from 192.168.10.1

[root@sink ~] # su-oracle

[oracle@sink ~] $rman target sys/oracle@sink auxiliary sys/oracle@test

Recovery Manager: Release 11.2.0.4.0-Production on Thu Jan 4 19:33:54 2018

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

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-00554: initialization of internal recovery manager package failed

RMAN-04005: error from target database:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

[oracle@sink ~] $rman target sys/oracle@sink auxiliary sys/oracle@test

Recovery Manager: Release 11.2.0.4.0-Production on Thu Jan 4 19:34:33 2018

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

Connected to target database: SINK (DBID=207714324)

Connected to auxiliary database: TEST (not mounted)

RMAN > duplicate target database to "test" from active database nofilenamecheck

Starting Duplicate Db at 04-JAN-18

Using target database control file instead of recovery catalog

Allocated channel: ORA_AUX_DISK_1

Channel ORA_AUX_DISK_1: SID=20 device type=DISK

Contents of Memory Script:

{

Sql clone "create spfile from memory"

}

Executing Memory Script

Sql statement: create spfile from memory

Contents of Memory Script:

{

Shutdown clone immediate

Startup clone nomount

}

Executing Memory Script

Oracle instance shut down

Connected to auxiliary database (not started)

Oracle instance started

Total System Global Area 538640384 bytes

Fixed Size 2254992 bytes

Variable Size 415238000 bytes

Database Buffers 117440512 bytes

Redo Buffers 3706880 bytes

Contents of Memory Script:

{

Sql clone "alter system set db_name =

'' SINK'' comment=

'' Modified by RMAN duplicate'' scope=spfile''

Sql clone "alter system set db_unique_name =

'' TEST'' comment=

'' Modified by RMAN duplicate'' scope=spfile''

Shutdown clone immediate

Startup clone force nomount

Backup as copy current controlfile auxiliary format'/ u01qapplash oracleandoradataUniple TestUniverse control01.ctl'

Restore clone controlfile to'/ u01 from

'/ u01 apprenticespact oracleandoradataUniple testUniverse control01.ctl'

Alter clone database mount

}

Executing Memory Script

Sql statement: alter system set db_name =''SINK'' comment=' 'Modified by RMAN duplicate'' scope=spfile

Sql statement: alter system set db_unique_name =''TEST'' comment=' 'Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 538640384 bytes

Fixed Size 2254992 bytes

Variable Size 415238000 bytes

Database Buffers 117440512 bytes

Redo Buffers 3706880 bytes

Starting backup at 04-JAN-18

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: SID=40 device type=DISK

Channel ORA_DISK_1: starting datafile copy

Copying current control file

Output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_sink.f tag=TAG20180104T193452 RECID=2 STAMP=964553692

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 04-JAN-18

Starting restore at 04-JAN-18

Allocated channel: ORA_AUX_DISK_1

Channel ORA_AUX_DISK_1: SID=18 device type=DISK

Channel ORA_AUX_DISK_1: copied control file copy

Finished restore at 04-JAN-18

Database mounted

Contents of Memory Script:

{

Set newname for datafile 1 to

"/ u01/app/oracle/oradata/test/system01.dbf"

Set newname for datafile 2 to

"/ u01/app/oracle/oradata/test/sysaux01.dbf"

Set newname for datafile 3 to

"/ u01/app/oracle/oradata/test/undotbs01.dbf"

Set newname for datafile 4 to

"/ u01/app/oracle/oradata/test/users01.dbf"

Set newname for datafile 5 to

"/ u01/app/oracle/oradata/test/example01.dbf"

Set newname for datafile 6 to

"/ u01/app/oracle/oradata/test/tbssss.256.963504823"

Backup as copy reuse

Datafile 1 auxiliary format

"/ u01/app/oracle/oradata/test/system01.dbf" datafile

2 auxiliary format

"/ u01/app/oracle/oradata/test/sysaux01.dbf" datafile

3 auxiliary format

"/ u01/app/oracle/oradata/test/undotbs01.dbf" datafile

4 auxiliary format

"/ u01/app/oracle/oradata/test/users01.dbf" datafile

5 auxiliary format

"/ u01/app/oracle/oradata/test/example01.dbf" datafile

6 auxiliary format

"/ u01/app/oracle/oradata/test/tbssss.256.963504823"

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

Starting backup at 04-JAN-18

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00001 name=/u01/app/oracle/oradata/sink/system01.dbf

Output file name=/u01/app/oracle/oradata/test/system01.dbf tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00002 name=/u01/app/oracle/oradata/sink/sysaux01.dbf

Output file name=/u01/app/oracle/oradata/test/sysaux01.dbf tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00005 name=/u01/app/oracle/oradata/sink/example01.dbf

Output file name=/u01/app/oracle/oradata/test/example01.dbf tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00006 name=+DATA/sink/datafile/tbssss.256.963504823

Output file name=/u01/app/oracle/oradata/test/tbssss.256.963504823 tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00003 name=/u01/app/oracle/oradata/sink/undotbs01.dbf

Output file name=/u01/app/oracle/oradata/test/undotbs01.dbf tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

Channel ORA_DISK_1: starting datafile copy

Input datafile file number=00004 name=/u01/app/oracle/oradata/sink/users01.dbf

Output file name=/u01/app/oracle/oradata/test/users01.dbf tag=TAG20180104T193459

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 04-JAN-18

Sql statement: alter system archive log current

Contents of Memory Script:

{

Backup as copy reuse

Archivelog like "/ dsk1/arch_sink/1_12_963448790.dbf" auxiliary format

"/ dsk1/arch_test/1_12_963448790.dbf"

Catalog clone archivelog "/ dsk1/arch_test/1_12_963448790.dbf"

Switch clone datafile all

}

Executing Memory Script

Starting backup at 04-JAN-18

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting archived log copy

Input archived log thread=1 sequence=12 RECID=8 STAMP=964553753

Output file name=/dsk1/arch_test/1_12_963448790.dbf RECID=0 STAMP=0

Channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01

Finished backup at 04-JAN-18

Cataloged archived log

Archived log file name=/dsk1/arch_test/1_12_963448790.dbf RECID=8 STAMP=964553755

Datafile 1 switched to datafile copy

Input datafile copy RECID=2 STAMP=964553755 file name=/u01/app/oracle/oradata/test/system01.dbf

Datafile 2 switched to datafile copy

Input datafile copy RECID=3 STAMP=964553755 file name=/u01/app/oracle/oradata/test/sysaux01.dbf

Datafile 3 switched to datafile copy

Input datafile copy RECID=4 STAMP=964553755 file name=/u01/app/oracle/oradata/test/undotbs01.dbf

Datafile 4 switched to datafile copy

Input datafile copy RECID=5 STAMP=964553755 file name=/u01/app/oracle/oradata/test/users01.dbf

Datafile 5 switched to datafile copy

Input datafile copy RECID=6 STAMP=964553755 file name=/u01/app/oracle/oradata/test/example01.dbf

Datafile 6 switched to datafile copy

Input datafile copy RECID=7 STAMP=964553755 file name=/u01/app/oracle/oradata/test/tbssss.256.963504823

Contents of Memory Script:

{

Set until scn 1158304

Recover

Clone database

Delete archivelog

}

Executing Memory Script

Executing command: SET until clause

Starting recover at 04-JAN-18

Using channel ORA_AUX_DISK_1

Starting media recovery

Archived log for thread 1 with sequence 12 is already on disk as file / dsk1/arch_test/1_12_963448790.dbf

Archived log file name=/dsk1/arch_test/1_12_963448790.dbf thread=1 sequence=12

Media recovery complete, elapsed time: 00:00:00

Finished recover at 04-JAN-18

Oracle instance started

Total System Global Area 538640384 bytes

Fixed Size 2254992 bytes

Variable Size 415238000 bytes

Database Buffers 117440512 bytes

Redo Buffers 3706880 bytes

Contents of Memory Script:

{

Sql clone "alter system set db_name =

'' TEST'' comment=

'' Reset to original value by RMAN'' scope=spfile''

Sql clone "alter system reset db_unique_name scope=spfile"

Shutdown clone immediate

Startup clone nomount

}

Executing Memory Script

Sql statement: alter system set db_name =''TEST'' comment=' 'Reset to original value by RMAN'' scope=spfile

Sql statement: alter system reset db_unique_name scope=spfile

Oracle instance shut down

Connected to auxiliary database (not started)

Oracle instance started

Total System Global Area 538640384 bytes

Fixed Size 2254992 bytes

Variable Size 415238000 bytes

Database Buffers 117440512 bytes

Redo Buffers 3706880 bytes

Sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 200

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 ('/ u01amp SIZE SIZE 50 M REUSE)

GROUP 2 ('/ u01amp SIZE SIZE 50 M REUSE

GROUP 3 ('/ u01amp SIZE SIZE 50 M REUSE

DATAFILE

'/ u01 apprenticeship oradataUniple TestUniverse system01.dbf'

CHARACTER SET ZHS16GBK

Contents of Memory Script:

{

Set newname for tempfile 1 to

"/ u01/app/oracle/oradata/test/temp01.dbf"

Switch clone tempfile all

Catalog clone datafilecopy "/ u01/app/oracle/oradata/test/sysaux01.dbf"

"/ u01/app/oracle/oradata/test/undotbs01.dbf"

"/ u01/app/oracle/oradata/test/users01.dbf"

"/ u01/app/oracle/oradata/test/example01.dbf"

"/ u01/app/oracle/oradata/test/tbssss.256.963504823"

Switch clone datafile all

}

Executing Memory Script

Executing command: SET NEWNAME

Renamed tempfile 1 to / u01/app/oracle/oradata/test/temp01.dbf in control file

Cataloged datafile copy

Datafile copy file name=/u01/app/oracle/oradata/test/sysaux01.dbf RECID=1 STAMP=964553762

Cataloged datafile copy

Datafile copy file name=/u01/app/oracle/oradata/test/undotbs01.dbf RECID=2 STAMP=964553762

Cataloged datafile copy

Datafile copy file name=/u01/app/oracle/oradata/test/users01.dbf RECID=3 STAMP=964553762

Cataloged datafile copy

Datafile copy file name=/u01/app/oracle/oradata/test/example01.dbf RECID=4 STAMP=964553762

Cataloged datafile copy

Datafile copy file name=/u01/app/oracle/oradata/test/tbssss.256.963504823 RECID=5 STAMP=964553762

Datafile 2 switched to datafile copy

Input datafile copy RECID=1 STAMP=964553762 file name=/u01/app/oracle/oradata/test/sysaux01.dbf

Datafile 3 switched to datafile copy

Input datafile copy RECID=2 STAMP=964553762 file name=/u01/app/oracle/oradata/test/undotbs01.dbf

Datafile 4 switched to datafile copy

Input datafile copy RECID=3 STAMP=964553762 file name=/u01/app/oracle/oradata/test/users01.dbf

Datafile 5 switched to datafile copy

Input datafile copy RECID=4 STAMP=964553762 file name=/u01/app/oracle/oradata/test/example01.dbf

Datafile 6 switched to datafile copy

Input datafile copy RECID=5 STAMP=964553762 file name=/u01/app/oracle/oradata/test/tbssss.256.963504823

Contents of Memory Script:

{

Alter clone database open resetlogs

}

Executing Memory Script

Database opened

Finished Duplicate Db at 04-JAN-18

RMAN >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report