2>只读 ---备份只读 可写 故障 还原备份数据文件,重做recover
3>只读 ---备份可写 只读 故障 还原备份数据文件,recover
1>
进入rman,确保是否有备份的文件:
[oracle@oracle ~]$ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 09:44:08 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: JADL10G (DBID=2011508104) RMAN> list backup of tablespace users; using target database control file instead of recovery catalog List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 609.23M DISK 00:00:38 06-NOV-14 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20141106T063059 Piece Name: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T063059_b5o994hx_.bkp List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 4 Full 422818 06-NOV-14 /u01/oracle/oradata/jadl10g/users01.dbf
修改表空间为只读表空间:
[oracle@oracle ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 09:45:35 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options SQL> alter tablespace users read only; Tablespace altered.
进入rman,重新备份 数据库,删除以前备份的可以节省空间使用delete backup命令可以删除;
[oracle@oracle ~]$ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 09:50:29 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: JADL10G (DBID=2011508104) RMAN> backup database; --备份数据库 Starting backup at 06-NOV-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=159 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/u01/oracle/oradata/jadl10g/system01.dbf input datafile fno=00003 name=/u01/oracle/oradata/jadl10g/sysaux01.dbf input datafile fno=00005 name=/u01/oracle/oradata/jadl10g/example01.dbf input datafile fno=00002 name=/u01/oracle/oradata/jadl10g/undotbs01.dbf input datafile fno=00004 name=/u01/oracle/oradata/jadl10g/users01.dbf channel ORA_DISK_1: starting piece 1 at 06-NOV-14 channel ORA_DISK_1: finished piece 1 at 06-NOV-14 piece handle=/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T095036_b5onzdz1_.bkp tag=TAG20141106T095036 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current control file in backupset including current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 06-NOV-14 channel ORA_DISK_1: finished piece 1 at 06-NOV-14 piece handle=/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T095036_b5oo15kf_.bkp tag=TAG20141106T095036 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Fini