Академический Документы
Профессиональный Документы
Культура Документы
A powerful feature of RMAN is the ability to duplicate (clone), a database from a backup. It is
possible to create a duplicate database on:
3o prepare for database duplication, you must first create an auxiliary instance. For the
duplication to work, you must connect RMAN to both the target (primary) database and an
auxiliary instance started in NOMOUN3 mode.
So long as RMAN is able to connect to the primary and duplicate instances, the RMAN client
can run on any machine. However, all backups, copies of datafiles, and archived logs used for
creating and recovering the duplicate database must be accessible by the server session on the
duplicate host.
`Y Restores the target datafiles to the duplicate database and performs incomplete
recovery by using all available backups and archived logs.
`Y Opens the duplicate database with the RESE3 OGS option after incomplete
recovery to create the online redo logs.
a
a
½reate an Oracle Password File
c
a
Next add the appropriate entries into the 3NSNAMES.ORA and IS3ENER.ORA files in the
$3NS_ADMIN directory.
IS3ENER.ORA
IS3ENER =
(DES½RIP3ION_ IS3 =
(DES½RIP3ION =
(ADDRESS = (PRO3O½O = 3½P)(HOS3 = gentic)(POR3 = 1521))
)
)
3NSNAMES.ORA
ca =
(DES½RIP3ION =
(ADDRESS_ IS3 =
(ADDRESS = (PRO3O½O = 3½P)(HOS3 = gentic)(POR3 = 1521))
)
(½ONNE½3_DA3A =
(SERVI½E_NAME = APP1.WOR D)
)
)
ca =
(DES½RIP3ION =
(ADDRESS_ IS3 =
(ADDRESS = (PRO3O½O = 3½P)(HOS3 = gentic)(POR3 = 1521))
)
(½ONNE½3_DA3A =
(SERVI½E_NAME = APP2.WOR D)
)
)
SQ NE3.ORA
NAMES.DIRE½3ORY_PA3H= (3NSNAMES)
NAMES.DEFAU 3_DOMAIN = WOR D
NAME.DEFAU 3_ZONE = WOR D
USE_DEDI½A3ED_SERVER = ON
½reate an INI3.ORA parameter file for the auxiliary instance, you can copy that from the target
instance and then modify the parameters.
a
c
c
c
db_name = APP2
db_unique_name = APP2_GEN3I½
db_domain = WOR D
service_names = APP2
instance_name = APP2
compatible = 10.2.0.4
db_block_size = 8192
db_file_multiblock_read_count = 32
db_files = 512
control_files = /u01/oracle/db/APP2/con/APP2_con01.con,
/opt/oracle/db/APP2/con/APP2_con02.con
sga_target = 500M
sga_max_size = 600M
log_archive_format = APP2_%s_%t_%r.arc
log_archive_max_processes =2
log_archive_dest = /u01/oracle/db/APP2/arc
undo_management = auto
undo_retention = 10800
undo_tablespace = undo
audit_file_dest = /u01/oracle/db/APP2/adm/admp
user_dump_dest = /u01/oracle/db/APP2/adm/udmp
background_dump_dest = /u01/oracle/db/APP2/adm/bdmp
core_dump_dest = /u01/oracle/db/APP2/adm/cdmp
utl_file_dir = /u01/oracle/db/APP2/adm/utld
remote_login_passwordfile = exclusive
run {
allocate channel ch1 type Disk maxpiecesize = 1900M;
backup full database noexclude
include current controlfile
format '/u01/backup/datafile_%s_%p.bak'
tag 'datafile_daily';
}
run {
allocate channel ch1 type Disk maxpiecesize = 1900M;
backup archivelog all
delete all input
format '/u01/backup/archivelog_%s_%p.bak'
tag 'archivelog_daily';
}
run {
allocate channel ch1 type Disk maxpiecesize = 1900M;
backup format '/u01/backup/controlfile_%s.bak' current controlfile;
}
crosscheck backup;
list backup of database;
report unrecoverable;
report schema;
report need backup;
report obsolete;
delete noprompt expired backup of database;
delete noprompt expired backup of controlfile;
delete noprompt expired backup of archivelog all;
delete noprompt obsolete recovery window of 3 days;
quit
EOF
a
a
Before beginning RMAN duplication, use SQ Plus to connect to the auxiliary instance and
start it in NOMOUN3 mode. If you do not have a server-side initialization parameter file for the
auxiliary instance in the default location, then you must specify the client-side initialization
parameter file with the PFI E parameter on the DUP I½A3E command.
3o rename the database files you can use the SE3 NEWNAME command. 3herefore, get the
original filenames from the target and modify these names in the DUP I½A3E command.
c
a
c
a
Datafile File-ID
---------------------------------------- -------
/u01/oracle/db/APP1/sys/APP1_sys1.dbf 1
/u01/oracle/db/APP1/sys/APP1_undo1.dbf 2
/u01/oracle/db/APP1/sys/APP1_sysaux1.dbf 3
/u01/oracle/db/APP1/usr/APP1_users1.dbf 4
ogfile Group-Nr
---------------------------------------- --------
/u01/oracle/db/APP1/rdo/APP1_log1A.rdo 1
/opt/oracle/db/APP1/rdo/APP1_log1B.rdo 1
/u01/oracle/db/APP1/rdo/APP1_log2A.rdo 2
/opt/oracle/db/APP1/rdo/APP1_log2B.rdo 2
/u01/oracle/db/APP1/rdo/APP1_log3A.rdo 3
/opt/oracle/db/APP1/rdo/APP1_log3B.rdo 3
/u01/oracle/db/APP1/rdo/APP1_log4A.rdo 4
/opt/oracle/db/APP1/rdo/APP1_log4B.rdo 4
/u01/oracle/db/APP1/rdo/APP1_log5A.rdo 5
/opt/oracle/db/APP1/rdo/APP1_log5B.rdo 5
/u01/oracle/db/APP1/rdo/APP1_log6A.rdo 6
/opt/oracle/db/APP1/rdo/APP1_log6B.rdo 6
/u01/oracle/db/APP1/rdo/APP1_log7A.rdo 7
/opt/oracle/db/APP1/rdo/APP1_log7B.rdo 7
/u01/oracle/db/APP1/rdo/APP1_log8A.rdo 8
/opt/oracle/db/APP1/rdo/APP1_log8B.rdo 8
/u01/oracle/db/APP1/rdo/APP1_log9A.rdo 9
/opt/oracle/db/APP1/rdo/APP1_log9B.rdo 9
/u01/oracle/db/APP1/rdo/APP1_log10A.rdo 10
/opt/oracle/db/APP1/rdo/APP1_log10B.rdo 10
c
a
a
c
a
c
a
cac
ca
c
ca!c
ca"c
a ac
c
cc
c
c !
!
!
c "
"
"
c
c #
#
#
c $
$
$
c %
%
%
c &
&
&
c
'
3he whole, long output is not shown here, but check, that RMAN was able to open the duplicate
database with the RESE3 OGS option.
.....
.....
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 28-O½3-08
initAPP2.ora
(
)
3he other steps are the same as described under «½reating a Duplicate Database on the ocal
Host».