ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 还原表空间系列命令之二

还原表空间系列命令之二

原创 Linux操作系统 作者:mengzhaoliang 时间:2008-04-28 11:42:12 0 删除 编辑

1 查看当前的还原表空间信息
SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1


2 目前所有还原表空间
SQL> select tablespace_name,status,contents
  2  from dba_tablespaces
  3  where contents='UNDO';

TABLESPACE_NAME                STATUS    CONTENTS
------------------------------ --------- ---------
UNDOTBS1                       ONLINE    UNDO
JINLIAN_UNDO                   ONLINE    UNDO


3 切换还原表空间
SQL> alter system set undo_tablespace=jinlian_undo;

系统已更改。

SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      JINLIAN_UNDO


4 更改还原表空间的时间,改成1800秒
SQL> alter system set undo_retention=1800;

系统已更改。

SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------
undo_management                      string      AUTO
undo_retention                       integer     1800
undo_tablespace                      string      JINLIAN_UNDO


5 删除还原表空间
 SQL> drop tablespace jinlian_undo;

表空间已删除。
SQL> l
  1  select tablespace_name,status,contents
  2  from dba_tablespaces
  3* where contents='UNDO'
SQL> /

TABLESPACE_NAME                STATUS    CONTENTS
------------------------------ --------- ---------
UNDOTBS1                       ONLINE    UNDO

在数据库中,当删除数据库中的还原表空间,该还原表空间所对应的数据文件也删除了,但在操作系统

上还存在该数据文件,需要手工删除。


6 视图v$undostat可以获取还原段数据信息,监控当前实例中undo空间以及事务如何运行。

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12778571/viewspace-255289/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2008-01-30

  • 博文量
    336
  • 访问量
    3085322