①、修改启动参数
undo_management=manual
②、进入SQLPLUS
SQL> connect / as sysdba
Connected to an idle instance.
SQL> shutdown immediate;
SQL> startup pfile=E:\demo\FTCRM_DB\pfile\initFTCRM.ora mount;
SQL> alter database open;
③、查看undo_management参数
SQL> show parameter undo_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string RBSG_SPC
④、关闭数据库
SQL> shutdown immediate;
D
⑤、到Dos下删除回滚段
SQL> host
C:\Documents and Settings\Qianhb>del E:\demo\FTCRM_DB\DbFile\RBSGFTCRM.ODB
C:\Documents and Settings\Qianhb>exit
⑥、重新启动到mount状态
SQL> startup pfile=E:\demo\FTCRM_DB\pfile\initFTCRM.ora mount;
⑦、打开数据库,报回滚段文件错误
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: 'E:\DEMO\FTCRM_DB\DBFILE\RBSGFTCRM.ODB'
⑧、删除回滚段文件
SQL> alter database datafile 'E:\DEMO\FTCRM_DB\DBFILE\RBSGFTCRM.ODB' offline drop;
Database altered.
SQL> alter database open;
Database altered.
⑨、重新建立新的回滚段RBSG_SP1
SQL> CREATE UNDO TABLESPACE RBSG_SP1
2 DATAFILE 'e:\demo\FTCRM_DB\DbFile\rbsgFTCRM1.ODB' SIZE 200M
3 REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;
Tablespace created.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
⑩、关闭数据库,将启动参数undo_management设置为自动管理(如果不改的话,数据库无法使用回滚段空间,只要修改就会报错);undo_tablespace设置为新的回滚段,并启动数据库
SQL> startup pfile=E:\demo\FTCRM_DB\pfile\initFTCRM.ora mount;
SQL> show parameter undo_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string RBSG_SP1
SQL> alter database open;
Database altered.
⑾、删除老的回滚段【完成】
SQL> drop tablespace rbsg_spc;
Tablespace dropped.
阅读(1429) | 评论(0) | 转发(0) |