|
(52-18)上完1Z0-053第20章
ACTIVE:本机ASM到ASM:
- run {
- duplicate target database to dbtest
- from active database
- nofilenamecheck
- spfile
- set
- control_files='+DATA','+FRA'
- set
- db_file_name_convert='+DATA/orcl/','+DATA/dbtest'
- set
- log_file_name_convert='+DATA/orcl','+DATA/dbtest','+FRA/orcl','+FRA/dbtest'
- set
- audit_file_dest='/u01/app/oracle/admin/dbtest/adump';
- }
复制代码
ACTIVE:两机ASM到文件系统:
- run{
- duplicate target database to db11g
- from active database
- nofilenamecheck
- spfile
- set
- control_files='/u01/app/oracle/oradata/db11g/control01.ctl','/u01/app/oracle/oradata/db11g/control02.ctl','/u01/app/oracle/oradata/db11g/control03.ctl'
- set
- db_file_name_convert='+DATA/orcl/datafile/example.265.832197353','/u01/app/oracle/oradata/db11g/example01.dbf','+DATA/orcl/datafile/users.259.832197065','/u01/app/oracle/oradata/db11g/users01.dbf','+DATA/orcl/datafile/undotbs1.258.832197065','/u01/app/oracle/oradata/db11g/undotbs01.dbf','+DATA/orcl/datafile/sysaux.257.832197065','/u01/app/oracle/oradata/db11g/sysaux01.dbf','+DATA/orcl/datafile/system.256.832197063','/u01/app/oracle/oradata/db11g/system01.dbf'
- set
- log_file_name_convert='+DATA/orcl/onlinelog/group_1.261.832197287','/u01/app/oracle/oradata/db11g/redo01a.log','+FRA/orcl/onlinelog/group_1.257.832197291','/u01/app/oracle/oradata/db11g/redo01b.log','+DATA/orcl/onlinelog/group_3.263.832197301','/u01/app/oracle/oradata/db11g/redo03a.log','+FRA/orcl/onlinelog/group_3.259.832197305','/u01/app/oracle/oradata/db11g/redo03b.log','+DATA/orcl/onlinelog/group_2.262.832197293','/u01/app/oracle/oradata/db11g/redo02a.log','+FRA/orcl/onlinelog/group_2.258.832197299','/u01/app/oracle/oradata/db11g/redo02b.log';
- set
- audit_file_dest='/u01/app/oracle/admin/db11g/adump'
- set
- db_create_file_dest=''
- set
- db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
- }
复制代码
BACKUPLOCATION:两机ASM到文件系统:
1_spfile?set语法指定三个参数:
- run{
- duplicate target database to mydb
- backup location '/home/oracle/backup'
- nofilenamecheck
- spfile
- set
- control_files='/u01/app/oracle/oradata/mydb/control01.ctl','/u01/app/oracle/oradata/db11g/control02.ctl','/u01/app/oracle/oradata/db11g/control03.ctl'
- set
- db_file_name_convert='+DATA/orcl/datafile/example.258.880451611','/u01/app/oracle/oradata/db11g/example01.dbf','+DATA/orcl/datafile/users.259.880451615','/u01/app/oracle/oradata/db11g/users01.dbf','+DATA/orcl/datafile/undotbs1.256.880451607','/u01/app/oracle/oradata/db11g/undotbs01.dbf','+DATA/orcl/datafile/sysaux.257.880451605','/u01/app/oracle/oradata/db11g/sysaux01.dbf','+DATA/orcl/datafile/system.265.880451605','/u01/app/oracle/oradata/db11g/system01.dbf'
- set
- log_file_name_convert='+DATA/orcl/onlinelog/group_1.270.880453135','/u01/app/oracle/oradata/db11g/redo01a.log','+FRA/orcl/onlinelog/group_1.276.880453137','/u01/app/oracle/oradata/db11g/redo01b.log','+DATA/orcl/onlinelog/group_3.272.880453141','/u01/app/oracle/oradata/db11g/redo03a.log','+FRA/orcl/onlinelog/group_3.274.880453141','/u01/app/oracle/oradata/db11g/redo03b.log','+DATA/orcl/onlinelog/group_2.271.880453137','/u01/app/oracle/oradata/db11g/redo02a.log','+FRA/orcl/onlinelog/group_2.275.880453139','/u01/app/oracle/oradata/db11g/redo02b.log'
- set
- audit_file_dest='/u01/app/oracle/admin/mydb/adump'
- set
- db_create_file_dest=''
- set
- db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
- }
复制代码
2_parameter_value_convert语法指定三个参数:
- run {
- allocate auxiliary channel c1 device type disk;
- allocate auxiliary channel c2 device type disk;
- allocate auxiliary channel c3 device type disk;
- allocate auxiliary channel c4 device type disk;
- allocate auxiliary channel c5 device type disk;
- allocate auxiliary channel c6 device type disk;
- allocate auxiliary channel c7 device type disk;
- allocate auxiliary channel c8 device type disk;
- duplicate database to mydb2
- backup location '/home/oracle/backup'
- nofilenamecheck
- db_file_name_convert '+DATA/orcl/datafile','/u01/app/oracle/oradata/mydb2'
- logfile
- group 1 ('/u01/app/oracle/oradata/mydb2/redo01.log') size 50M,
- group 2 ('/u01/app/oracle/oradata/mydb2/redo02.log') size 50M,
- group 3 ('/u01/app/oracle/oradata/mydb2/redo03.log') size 50M;
- spfile
- parameter_value_convert '+DATA','/u01/app/oracle/oradata/mydb2','+FRA','/u01/app/oracle/flash_recovery_area','/u01/app/oracle/admin/orcl/adump','/u01/app/oracle/admin/mydb2/adump'
- set
- control_files='/u01/app/oracle/oradata/mydb2/control01.ctl','/u01/app/oracle/oradata/mydb2/control02.ctl','/u01/app/oracle/oradata/mydb2/control03.ctl';
- }
复制代码
备份的rman命令:
- --源头把备份优化关掉,或用force语法
- run {
- allocate channel c1 device type disk format '/home/oracle/backup/%U';
- allocate channel c2 device type disk format '/home/oracle/backup/%U';
- allocate channel c3 device type disk format '/home/oracle/backup/%U';
- allocate channel c4 device type disk format '/home/oracle/backup/%U';
- allocate channel c5 device type disk format '/home/oracle/backup/%U';
- allocate channel c6 device type disk format '/home/oracle/backup/%U';
- allocate channel c7 device type disk format '/home/oracle/backup/%U';
- allocate channel c8 device type disk format '/home/oracle/backup/%U';
- backup database plus archivelog force;
- backup spfile;
- backup current controlfile;
- }
复制代码
|
|