Locations of visitors to this page

Friday, December 12, 2008

control file autobackup - 控制文件自动备份

---------- Forwarded message ----------
From: XIE WEN-MFK346 <wenxie at motorola.com>
Date: Fri, Dec 12, 2008 at 19:03
Subject: control file autobackup
To: wen xie <xiewenxiewen at googlemail.com>



1z0-043的一道考题

7.
89. In Recovery Manager (RMAN), you have set control file autobackup to ON by using the following command:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
Which two events would cause the control file to be backed up automatically? (Choose two)
A. A tablespace is taken offline.
B. The database instance is restarted.
C. A new data file is added to an existing tablespace.
D. A successful backup is recorded in the RMAN repository.
E. The RMAN connection is disconnected from the target database.
给的答案是CD

其实A也对,应该选ACD,验证过程如下:


1.配置控制文件自动备份
[oracle@MGT ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Fri Dec 12 04:27:20 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: TEST (DBID=1955690436)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/10.2/dbs/snapcf_test.f'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_';

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 12/12/2008 04:30:23
RMAN-06492: controlfile autobackup format "/home/oracle/backup/test/rman/cf_test_auto_" must specify a "%F" format specifier

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_%d_%F';

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_%F';
new RMAN configuration parameters are successfully stored

RMAN>

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_auto_%d_%F';
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_auto_%d_%F';
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_test_auto_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/test/rman/cf_auto_%d_%F';
new RMAN configuration parameters are successfully stored

RMAN>

CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN>

2.当backup命令成功后会自动备份
backup format '/home/oracle/backup/test/rman/spfile_%d_%T' spfile;
RMAN> backup format '/home/oracle/backup/test/rman/spfile_%d_%T' spfile;
Starting backup at 12-DEC-08
allocated channel: ORA_DISK_1 channel
ORA_DISK_1: sid=1643 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 12-DEC-08
channel ORA_DISK_1: finished piece 1 at 12-DEC-08 piece handle=/home/oracle/backup/test/rman/spfile_TEST_20081212 tag=TAG20081212T104938 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 12-DEC-08

Starting Control File and SPFILE Autobackup at 12-DEC-08 piece handle=/home/oracle/backup/test/rman/cf_auto_TEST_c-1955690436-20081212-00 comment=NONE
Finished Control File and SPFILE Autobackup at 12-DEC-08

RMAN>

[oracle@MGT ~/backup/test/rman]$ ls -lrt
total 8080
-rw-r----- 1 oracle oinstall 98304 Dec 12 10:49 spfile_TEST_20081212
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:49 cf_auto_TEST_c-1955690436-20081212-00
[oracle@MGT ~/backup/test/rman]$


3.离线表空间也会触发自动备份
SQL> conn / as sysdba
Connected.
SQL> select name from v$tablespace;
NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
MAS_DATA
MAS_INDEX
RPT_KAMET_DATA
RPT_KAMET_INDEX
TS_TEST

10 rows selected.

SQL> alter tablespace users offline;
Tablespace altered.

SQL>

[oracle@MGT ~/backup/test/rman]$ ls -lrt
total 16060
-rw-r----- 1 oracle oinstall 98304 Dec 12 10:49 spfile_TEST_20081212
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:49 cf_auto_TEST_c-1955690436-20081212-00
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:51 cf_auto_TEST_c-1955690436-20081212-01
[oracle@MGT ~/backup/test/rman]$


4.增加数据文件也会

SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/test/system01.dbf
/home/oracle/app/oracle/oradata/test/undotbs01.dbf
/home/oracle/app/oracle/oradata/test/sysaux01.dbf
/home/oracle/app/oracle/oradata/test/users01.dbf
/home/oracle/app/oracle/oradata/test/mas_data.dbf
/home/oracle/app/oracle/oradata/test/mas_index.dbf
/home/oracle/app/oracle/oradata/test/RPT_KAMET_DATA.dbf
/home/oracle/app/oracle/oradata/test/RPT_KAMET_INDEX.dbf
/home/oracle/app/oracle/oradata/test/ts_test01.dbf

9 rows selected.

SQL> alter tablespace ts_test add datafile '/home/oracle/app/oracle/oradata/test/ts_test02.dbf' size 2m;
Tablespace altered.

SQL>
SQL> !ls -lrt ~/backup/test/rman/
total 24040
-rw-r----- 1 oracle oinstall 98304 Dec 12 10:49 spfile_TEST_20081212
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:49 cf_auto_TEST_c-1955690436-20081212-00
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:51 cf_auto_TEST_c-1955690436-20081212-01
-rw-r----- 1 oracle oinstall 8159232 Dec 12 10:56 cf_auto_TEST_c-1955690436-20081212-02

SQL>



外部链接:

When RMAN Performs Control File Autobackups


Xie Wen (谢文)
Network & Operations,
Multimedia Applications & Services (MDB) MOTOROLA Inc.
NO.104 mail box, 8th floor, Motorola Tower,
No. 1 Wang Jing East Road, Chao Yang District,
Beijing 100102 P. R. China
e-mail wenxie at motorola.com


-fin-

No comments:

Website Analytics

Followers