在归档模式中,tablespace处于offline状态下,同样可以进行RMAN备份
SQL> select ts#,status,name from v$datafile; TS# STATUS NAME ---------- ------- ---------------------------------------------------------------------------------------------------- 0 SYSTEM /u01/app/oracle/oradata/testdb/system01.dbf 1 ONLINE /u01/app/oracle/oradata/testdb/sysaux01.dbf 2 ONLINE /u01/app/oracle/oradata/testdb/undotbs01.dbf 4 ONLINE /u01/app/oracle/oradata/testdb/users01.dbf 6 ONLINE /u01/app/oracle/oradata/testdb/example01.dbf 7 ONLINE /u01/app/oracle/oradata/testdb/DATACENTER01.dbf 8 ONLINE /u01/app/oracle/oradata/testdb/rman_ts01.dbf 9 ONLINE /u01/app/oracle/oradata/testdb/myundotbs01.dbf 11 ONLINE /u01/app/oracle/oradata/testdb/testtbs01.dbf 12 ONLINE /u01/app/oracle/oradata/testdb/testtbs02.dbf 13 ONLINE /u01/app/oracle/oradata/testdb/ts_perf_01.dbf 11 rows selected. SQL> alter tablespace testtbs01 offline; Tablespace altered. SQL> select ts#,status,name from v$datafile; TS# STATUS NAME ---------- ------- ---------------------------------------------------------------------------------------------------- 0 SYSTEM /u01/app/oracle/oradata/testdb/system01.dbf 1 ONLINE /u01/app/oracle/oradata/testdb/sysaux01.dbf 2 ONLINE /u01/app/oracle/oradata/testdb/undotbs01.dbf 4 ONLINE /u01/app/oracle/oradata/testdb/users01.dbf 6 ONLINE /u01/app/oracle/oradata/testdb/example01.dbf 7 ONLINE /u01/app/oracle/oradata/testdb/DATACENTER01.dbf 8 ONLINE /u01/app/oracle/oradata/testdb/rman_ts01.dbf 9 ONLINE /u01/app/oracle/oradata/testdb/myundotbs01.dbf 11 OFFLINE /u01/app/oracle/oradata/testdb/testtbs01.dbf 12 ONLINE /u01/app/oracle/oradata/testdb/testtbs02.dbf 13 ONLINE /u01/app/oracle/oradata/testdb/ts_perf_01.dbf 11 rows selected. SQL>
11203ora-> id uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1300(dba),1301(oper) 11203ora-> rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jul 29 18:01:20 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: TESTDB (DBID=2603690985) RMAN> report schema; using target database control file instead of recovery catalog Report of database schema for database with db_unique_name TESTDB List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 740 SYSTEM *** /u01/app/oracle/oradata/testdb/system01.dbf 2 790 SYSAUX *** /u01/app/oracle/oradata/testdb/sysaux01.dbf 3 115 UNDOTBS1 *** /u01/app/oracle/oradata/testdb/undotbs01.dbf 4 23 USERS *** /u01/app/oracle/oradata/testdb/users01.dbf 5 345 EXAMPLE *** /u01/app/oracle/oradata/testdb/example01.dbf 6 200 APP_FGPS *** /u01/app/oracle/oradata/testdb/DATACENTER01.dbf 7 200 RMAN_TS *** /u01/app/oracle/oradata/testdb/rman_ts01.dbf 8 115 MYUNDOTBS *** /u01/app/oracle/oradata/testdb/myundotbs01.dbf 9 10 TESTTBS01 *** /u01/app/oracle/oradata/testdb/testtbs01.dbf 10 10 TESTTBS02 *** /u01/app/oracle/oradata/testdb/testtbs02.dbf 11 200 TS_PERF *** /u01/app/oracle/oradata/testdb/ts_perf_01.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 54 TEMP 32767 /u01/app/oracle/oradata/testdb/temp01.dbf RMAN> backup tablespace testtbs01; Starting backup at 2013/07/29 18:04:05 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=9 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00009 name=/u01/app/oracle/oradata/testdb/testtbs01.dbf channel ORA_DISK_1: starting piece 1 at 2013/07/29 18:04:06 channel ORA_DISK_1: finished piece 1 at 2013/07/29 18:04:07 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_07_29/o1_mf_nnndf_TAG20130729T180405_8zdhjpwz_.bkp tag=TAG20130729T180405 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2013/07/29 18:04:07 Starting Control File and SPFILE Autobackup at 2013/07/29 18:04:07 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/autobackup/2013_07_29/o1_mf_s_822074647_8zdhjrmx_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 2013/07/29 18:04:10 RMAN>
SQL> alter tablespace testtbs01 online; Tablespace altered. SQL> select ts#,status,name from v$datafile; TS# STATUS NAME ---------- ------- ---------------------------------------------------------------------------------------------------- 0 SYSTEM /u01/app/oracle/oradata/testdb/system01.dbf 1 ONLINE /u01/app/oracle/oradata/testdb/sysaux01.dbf 2 ONLINE /u01/app/oracle/oradata/testdb/undotbs01.dbf 4 ONLINE /u01/app/oracle/oradata/testdb/users01.dbf 6 ONLINE /u01/app/oracle/oradata/testdb/example01.dbf 7 ONLINE /u01/app/oracle/oradata/testdb/DATACENTER01.dbf 8 ONLINE /u01/app/oracle/oradata/testdb/rman_ts01.dbf 9 ONLINE /u01/app/oracle/oradata/testdb/myundotbs01.dbf 11 ONLINE /u01/app/oracle/oradata/testdb/testtbs01.dbf 12 ONLINE /u01/app/oracle/oradata/testdb/testtbs02.dbf 13 ONLINE /u01/app/oracle/oradata/testdb/ts_perf_01.dbf 11 rows selected. SQL>
/*
数据库处于nomount状态时,是无法进行对tablespace进行backup 操作的
*/
SQL> show user USER is "SYS" SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup nomount ORACLE instance started. Total System Global Area 430075904 bytes Fixed Size 2229064 bytes Variable Size 335547576 bytes Database Buffers 83886080 bytes Redo Buffers 8413184 bytes SQL>
11203ora-> rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jul 29 18:12:14 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: TESTDB (not mounted) RMAN> backup tablespace testtbs01; Starting backup at 2013/07/29 18:12:19 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=10 device type=DISK RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of backup command at 07/29/2013 18:12:20 ORA-01507: database not mounted RMAN>