oracle10g_rman_语法测试_4

RMAN> configure backup optimization clear;--打回原形,就是恢复默认

old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
RMAN configuration parameters are successfully reset to default value

RMAN> configure backup optimization off;---关闭此功能

new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION OFF;
new RMAN configuration parameters are successfully stored

RMAN> configure backup optimization on;--开启此功能

old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION OFF;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored


RMAN> configure exclude for tablespace users clear;---重新在备份数据库中包括表空间users

tablespace USERS will be included in future whole database backups
old RMAN configuration parameters are successfully deleted


RMAN> configure exclude for tablespace users;

tablespace USERS will be excluded from future whole database backups
new RMAN configuration parameters are successfully stored

RMAN> backup database;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
file 4 is excluded from whole database backup
skipping datafile 5; already backed up 2 time(s)
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/ora10g/system01.dbf
input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
input datafile fno=00002 name=/oracle/oradata/ora10g/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
channel ORA_DISK_1: finished piece 1 at 18-SEP-09
piece handle=/oracle/auto/backup_31kpi5ps_1_1 tag=TAG20090918T124651 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
Finished backup at 18-SEP-09

Starting Control File and SPFILE Autobackup at 18-SEP-09
piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_18/o1_mf_s_697898887_5c6488qz_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-SEP-09

RMAN> configure exclude for tablespace users clear;

tablespace USERS will be included in future whole database backups
old RMAN configuration parameters are successfully deleted

RMAN> backup database;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
skipping datafile 5; already backed up 2 time(s)
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/ora10g/system01.dbf
input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
input datafile fno=00002 name=/oracle/oradata/ora10g/undotbs01.dbf
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
channel ORA_DISK_1: finished piece 1 at 18-SEP-09
piece handle=/oracle/auto/backup_33kpi5t9_1_1 tag=TAG20090918T124840 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
Finished backup at 18-SEP-09

Starting Control File and SPFILE Autobackup at 18-SEP-09
piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_18/o1_mf_s_697898996_5c64co86_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-SEP-09

RMAN> configure archivelog deletion policy clear;---配置归档日志删除策略(打回原形)

RMAN configuration parameters are successfully reset to default value

RMAN> configure archivelog deletion policy to none;

new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
new RMAN configuration parameters are successfully stored

RMAN> configure archivelog deletion policy to applied on standby;---用于备库

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters are successfully stored
RMAN-08591: WARNING: invalid archivelog deletion policy

RMAN> configure auxname for datafile 1 clear;---配置数据文件1的辅助文件名

old RMAN configuration parameters are successfully deleted

RMAN> configure encryption algorithm clear;

RMAN configuration parameters are successfully reset to default value

RMAN> configure encryption for tablespace users on;

tablespace USERS will be encrypted in future backup sets
new RMAN configuration parameters are successfully stored

RMAN> backup tablespace users;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/18/2009 12:52:28
ORA-19914: unable to encrypt backup
ORA-28365: wallet is not open

RMAN> configure encryption for tablespace users clear;---配置表空间的加密

tablespace USERS will default to database encryption configuration
old RMAN configuration parameters are successfully deleted

RMAN> backup tablespace users;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
channel ORA_DISK_1: finished piece 1 at 18-SEP-09
piece handle=/oracle/auto/backup_36kpi659_1_1 tag=TAG20090918T125257 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-09

Starting Control File and SPFILE Autobackup at 18-SEP-09
piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_18/o1_mf_s_697899178_5c64kc1h_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-SEP-09
RMAN-08591: WARNING: invalid archivelog deletion policy

RMAN> configure archivelog deletion policy clear;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
RMAN configuration parameters are successfully reset to default value

RMAN> backup tablespace users;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
channel ORA_DISK_1: finished piece 1 at 18-SEP-09
piece handle=/oracle/auto/backup_38kpi66k_1_1 tag=TAG20090918T125340 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-09

Starting Control File and SPFILE Autobackup at 18-SEP-09
piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_18/o1_mf_s_697899221_5c64loz1_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-SEP-09

RMAN> backup encryption for database on;---配置数据库的加密

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "encryption": expecting one of: "archivelog, as, backup, backupset, blocks, channel, check, copy, copies, controlfilecopy, cumulative, current, database, datafile, datafilecopy, device, diskratio, db_recovery_file_dest, db_file_name_convert, duration, filesperset, for, format, full, force, incremental, keep, (, maxsetsize, nochecksum, noexclude, nokeep, not, proxy, pool, reuse, recovery, skip, spfile, setsize, tablespace, tag, to, validate"
RMAN-01007: at line 1 column 8 file: standard input

RMAN> configure snapshot controlfile name clear;---配置快照控件文件

RMAN configuration parameters are successfully reset to default value

RMAN> configure maxsetsize clear;---配置备份集的大小

RMAN configuration parameters are successfully reset to default value

RMAN> configure maxsetsize to 3m;

new RMAN configuration parameters:
CONFIGURE MAXSETSIZE TO 3 M;
new RMAN configuration parameters are successfully stored

RMAN> backup database;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
skipping datafile 5; already backed up 2 time(s)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/18/2009 12:55:18
RMAN-06183: datafile or datafile copy larger than MAXSETSIZE: file# 1 /oracle/oradata/ora10g/system01.dbf

RMAN> configure maxsetsize to unlimited;--无限制的备份集大小

old RMAN configuration parameters:
CONFIGURE MAXSETSIZE TO 3 M;
new RMAN configuration parameters:
CONFIGURE MAXSETSIZE TO UNLIMITED;
new RMAN configuration parameters are successfully stored

RMAN> backup database;

Starting backup at 18-SEP-09
using channel ORA_DISK_1
skipping datafile 5; already backed up 2 time(s)
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/ora10g/system01.dbf
input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
input datafile fno=00002 name=/oracle/oradata/ora10g/undotbs01.dbf
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-09
channel ORA_DISK_1: finished piece 1 at 18-SEP-09
piece handle=/oracle/auto/backup_3akpi6ao_1_1 tag=TAG20090918T125552 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
Finished backup at 18-SEP-09

Starting Control File and SPFILE Autobackup at 18-SEP-09
piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_18/o1_mf_s_697899428_5c64s4y5_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 18-SEP-09




Configuring Backup Optimization: Example
This example configures RMAN so that the BACKUP command does not back up files to a device type if the identical file has already been backed up to the device type:

CONFIGURE BACKUP OPTIMIZATION ON;
Configuring a Retention Policy: Example
This example configures a retention policy with a recovery window of 2 weeks, and then resets the retention policy to its default value of REDUNDANCY = 1:

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
CONFIGURE RETENTION POLICY CLEAR;
Configuring Automatic Disk and Tape Channels: Example
This example configures generic DISK and sbt channels, sets the default device type to sbt, and sets PARALLELISM to 3:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/?/%U';
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_SERVER=bksrv1)';
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE DEVICE TYPE sbt PARALLELISM 3;
Overriding the Default Device Type: Example
This example configures the default device type to sbt, backs up the archived logs on the default sbt channel, and then backs up the database to disk on the default disk channel:

CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_SERVER=bksrv1)';
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
BACKUP ARCHIVELOG ALL;
BACKUP DEVICE TYPE DISK DATABASE;
Configuring Automatic Channels Across File Systems: Example
This example configures automatic disk channels across three file systems:

CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/disk1/backup/%U';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/backup/%U';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT '/disk3/backup/%U';
BACKUP DEVICE TYPE DISK DATABASE PLUS ARCHIVELOG;
Configuring Automatic Channels in an Oracle Real Application Clusters Configuration: Example
This example allocates automatic sbt channels for two nodes of an Oracle Real Application Clusters database:

CONFIGURE DEVICE TYPE sbt PARALLELISM 2;
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE CHANNEL 1 DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node1'
  PARMS 'ENV=(NSR_SERVER=bkserv1)';
CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT 'SYS/change_on_install@node2'
  PARMS ENV=(NSR_SERVER=bkserv2)';
Clearing Automatic Channels: Example
This example clears manually numbered DISK channels 2 and 3 and the generic sbt channel:

CONFIGURE CHANNEL 2 DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
Configuring and Clearing Parallelism: Example
This example sets DISK parallelism to 2, then changes it to 3, then returns it to the default parallelism of 1:

CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE DEVICE TYPE DISK CLEAR;
Configuring Backup Copies: Example
This example configures duplexing to 3 for DISK backups of datafiles and control files (control file autobackups on disk are a special case and are never duplexed) and then runs a database backup, specifying three different file systems for the copies:

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
BACKUP DEVICE TYPE DISK DATABASE
  FORMAT '/disk1/backup/%U', '/disk2/backup/%U', '/disk3/backup/%U';
Configuring the Snapshot Control File Location: Example
This example configures a new location for the snapshot control file and then resynchronizes the recovery catalog.

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '?/oradata/snap.cf';
Excluding a Tablespace from a Whole Database Backup: Example
This example excludes the example tablespace from whole database backups, then returns the tablespace to its default value of "not excluded":

CONFIGURE EXCLUDE FOR TABLESPACE example;
CONFIGURE EXCLUDE CLEAR;
Specifying Auxiliary Filenames: Example
This example duplicates a database to a remote host with a different directory structure, by using CONFIGURE AUXNAME to specify new filenames for the datafiles:

# set auxiliary names for the datafiles
CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f';
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f';
CONFIGURE AUXNAME FOR DATAFILE 3 TO '/oracle/auxfiles/aux_3.f';
CONFIGURE AUXNAME FOR DATAFILE 4 TO '/oracle/auxfiles/aux_4.f';

RUN

  ALLOCATE AUXILIARY CHANNEL dupdb1 TYPE DISK;
  DUPLICATE TARGET DATABASE TO dupdb
  LOGFILE
    GROUP 1 ('?/dbs/dupdb_log_1_1.f',
             '?/dbs/dupdb_log_1_2.f') SIZE 200K,
    GROUP 2 ('?/dbs/dupdb_log_2_1.f',
             '?/dbs/dupdb_log_2_2.f') SIZE 200K REUSE;
}
# Un-specify the auxiliary names for the datafiles so that they are not overwritten
# by mistake:
CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR;
CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR;
CONFIGURE AUXNAME FOR DATAFILE 3 CLEAR;
CONFIGURE AUXNAME FOR DATAFILE 4 CLEAR;
Specifying the Default Format for the Control File Autobackup: Example
This example turns on the autobackup feature, then changes the default format for the DISK and sbt devices, then clears the autobackup setting:

CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '?/oradata/%F';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE sbt TO 'cf_auto_%F';
CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;   # returns to default setting of OFF

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-614940/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9240380/viewspace-614940/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值