怎么恢复损坏后的undo表空间(一)(二)

2014-11-24 16:03:59 · 作者: · 浏览: 1
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter database datafile '/opt/app/oracle/RHYS/undotbs01.dbf' offline drop; Database altered. SQL> alter database open; Database altered. SQL> show parameter undo NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _optimizer_undo_cost_change string 11.2.0.1 undo_management string AUTO undo_retention integer 900 undo_tablespace string UNDOTBS1 SQL> create undo tablespace undotbs2 datafile '/opt/app/oracle/RHYS/undotbs2.dbf' size 50M autoextend on next 5M maxsize 200M; Tablespace created. SQL> alter system set undo_tablespace=undotbs2; System altered. SQL> select usn,status from v$rollstat; USN STATUS ---------- --------------- 0 ONLINE 11 ONLINE 12 ONLINE 13 ONLINE 14 ONLINE 15 ONLINE 16 ONLINE 17 ONLINE 18 ONLINE 19 ONLINE 20 ONLINE 11 rows selected. SQL> col name for a60 SQL> set linesize 200 SQL> select file#,status from v$datafile; FILE# STATUS ---------- ------- 1 SYSTEM 2 ONLINE 3 OFFLINE 4 ONLINE 5 ONLINE 6 ONLINE 6 rows selected. SQL>
select file#,status,name from v$datafile; FILE# STATUS NAME ---------- ------- ------------------------------------------------------------ 1 SYSTEM /opt/app/oracle/RHYS/system01.dbf 2 ONLINE /opt/app/oracle/RHYS/sysaux01.dbf 3 OFFLINE /opt/app/oracle/RHYS/undotbs01.dbf 4 ONLINE /opt/app/oracle/RHYS/users01.dbf 5 ONLINE /opt/app/oracle/RHYS/test.dbf 6 ONLINE /opt/app/oracle/RHYS/undotbs2.dbf 6 rows selected. SQL> drop tablespace undotbs1 including contengs and datafiles; drop tablespace undotbs1 including contengs and datafiles * ERROR at line 1: ORA-01911: CONTENTS keyword expected SQL> drop tablespace undotbs1 including contents and datafiles; Tablespace dropped. SQL> select file#,status,name from v$datafile; FILE# STATUS NAME ---------- ------- ------------------------------------------------------------ 1 SYSTEM /opt/app/oracle/RHYS/system01.dbf 2 ONLINE /opt/app/oracle/RHYS/sysaux01.dbf 4 ONLINE /opt/app/oracle/RHYS/users01.dbf 5 ONLINE /opt/app/oracle/RHYS/test.dbf 6 ONLINE /opt/app/oracle/RHYS/undotbs2.dbf SQL>