system表空间在线损坏修复(RMAN修复) ----------------------------模拟system表空间在线损坏------------------------------ SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 8 14:50:54 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> create table sys.strom (a number) tablespace system; Table created. SQL> alter system switch logfile; System altered. SQL> insert into sys.strom values(1); 1 row created. SQL> alter system switch logfile; System altered. SQL> commit; Commit complete. SQL> insert into sys.strom values(2); 1 row created. SQL> alter system switch logfile; System altered. SQL> commit; Commit complete. SQL> ! [oracle@station datafile]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jun 8 14:54:06 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORCL (DBID=1312694260) RMAN> list backup of tablespace system; using target database control file instead of recovery catalog RMAN> backup tablespace system; Starting backup at 08-JUN-12 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=140 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/app/oracle/oradata/ORCL/datafile/o1_mf_system_7wnthzog_.dbf channel ORA_DISK_1: starting piece 1 at 08-JUN-12 channel ORA_DISK_1: finished piece 1 at 08-JUN-12 piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_06_08/o1_mf_nnndf_TAG20120608T145514_7x4lnl80_.bkp tag=TAG20120608T145514 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 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 08-JUN-12 channel ORA_DISK_1: finished piece 1 at 08-JUN-12 piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_06_08/o1_mf_ncsnf_TAG20120608T145514_7x4lp12y_.bkp tag=TAG20120608T145514 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 Finished backup at 08-JUN-12 RMAN> quit; Recovery Manager complete. [oracle@station datafile]$ rm -rf *system* [oracle@station datafile]$ ls o1_mf_example_7wntlh6m_.dbf o1_mf_temp_7wntl6ng_.tmp o1_mf_users_7x4j6bxl_.dbf o1_mf_sysaux_7wnthzp2_.dbf o1_mf_undotbs1_7wnthzt6_.dbf [oracle@station datafile]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 8 14:59:38 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> shutdown abort; ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 281018368 bytes Fixed Size 2020192 bytes Variable Size 150998176 bytes Database Buffers 125829120 bytes Redo Buffers 2170880 bytes Database mounted. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7wnthzog_.dbf' SQL> ! ----------------------------模拟system表空间在线损坏------------------------------ -------------------------------system表空间在线损坏修复------------------------------ [oracle@station datafile]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jun 8 15:00:08 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORCL (DBID=1312694260, not open) RMAN> run {restore tablespace system; 2> recover tablespace system; 3> } Starting restore at 08-JUN-12 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=155 devtype=DISK channel ORA_DISK_1: starting datafile backupset restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7wnthzog_.dbf channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_06_08/o1_mf_nnndf_TAG20120608T145514_7x4lnl80_.bkp channel ORA_DISK_1: restored backup piece 1 piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_06_08/o1_mf_nnndf_TAG20120608T145514_7x4lnl80_.bkp tag=TAG20120608T145514 channel ORA_DISK_1: restore complete, elapsed time: 00:00:56 Finished restore at 08-JUN-12 Starting recover at 08-JUN-12 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:03 Finished recover at 08-JUN-12 RMAN> alter database open; database opened RMAN> quit; Recovery Manager complete. [oracle@station datafile]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 8 15:01:57 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> select * from strom; A ---------- 1 2 -------------------------------system表空间在线损坏修复------------------------------ SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13453302/viewspace-735343/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13453302/viewspace-735343/