From
11g above, you can use rman to duplicate database from an active database
instead of from a backup.
Two big disadvantages of the ACTIVE database duplication method are:
Two big disadvantages of the ACTIVE database duplication method are:
·
Negative performance impact on the source
database. This impact applies to the whole duplication time.
·
High network traffic on the connection between
the source and target databases.
Test envorinment:
Source
SID: testprd
host:192.168.96.3
Target
SID: testrman
host:
192.168.96.4On 192.168.96.4
1. Create folders:
mkdir -p /orasw/app/oracle/admin/testrman
mkdir -p
/orasw/app/oracle/admin/testrman/adump
mkdir -p
/orasw/app/oracle/admin/testrman/dpdump
mkdir -p
/orasw/app/oracle/admin/testrman/pfile
mkdir -p /11g12c/oradata/testrman
mkdir -p /11g12c/oradata/testrman/arc
mkdir -p /11g12c/redoa/testrman
mkdir -p /11g12c/redob/testrman
2. Init.ora
Set the following parameters:
*.db_name='testrman'
DB_UNIQUE_NAME=testrman
LOG_ARCHIVE_DEST='/11g12c/oradata/testrman/arc'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
DB_FILE_NAME_CONVERT='testprd','testrman'
LOG_FILE_NAME_CONVERT='testprd','testrman'
3.
ln -s
/orasw/app/oracle/admin/testrman/pfile/init.ora $ORACLE_HOME/dbs/inittestrman.ora
4.
orapwd
file=/orasw/app/oracle/product/12.1.0/dbs/orapwtestrman password=*****
5. Add to the tnsnames.ora on source and
destination server.
TESTRMAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.96.4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TESTRMAN)
(UR = A)
)
)
6. Listener.ora on destination server
[testrman]
/orasw/app/oracle/product/12.1.0/network/admin >cat listener.ora
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=testrman
(GLOBAL_DBNAME=testrman)
(ORACLE_HOME=/orasw/app/oracle/product/12.1.0/)))
7. Start testrman with nomount:
[testrman]
/orasw/app/oracle/admin/testrman/pfile >sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on
Tue Jan 24 15:23:31 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 2925120 bytes
Variable Size 264244672 bytes
Database Buffers 146800640 bytes
Redo Buffers 5459968 bytes
SQL> quit
8. Duplicate database:
rman target sys/****@testprd auxiliary sys/****@testrman
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate auxiliary channel a1
type disk;
allocate auxiliary channel a2
type disk;
duplicate target database to
testrman from active database;
}
No comments:
Post a Comment