ITPub博客

首页 > 数据库 > Oracle > [20180424]打开表空flashback on.txt

[20180424]打开表空flashback on.txt

原创 Oracle 作者:lfree 时间:2018-04-24 15:57:45 0 删除 编辑

[20180424]打开表空flashback on.txt

--//昨天测试完成,链接http://blog.itpub.net/267265/viewspace-2153207/,忘记设置flashback on;.
--//今天设置回来,顺便做一个笔记.

1.环境:
SYS@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE

SYS@book> alter tablespace tea flashback on;
alter tablespace tea flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance

--//竟然不能在open状态设置flashback on;.
$ oerr ora 01126
01126, 00000, "database must be mounted in this instance and not open in any instance"
// *Cause:  Obvious
// *Action:

2.测试在表空间offline下是否可行.

SYS@book> alter tablespace tea offline;
Tablespace altered.

SYS@book> alter tablespace tea flashback on;
alter tablespace tea flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance

SYS@book> alter tablespace tea online;
Tablespace altered.

--//看来必须在mount状态下调整.

SYS@book> startup mount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
Database mounted.
SYS@book> alter tablespace tea flashback off;

Tablespace altered.

SYS@book> alter tablespace tea flashback on;

Tablespace altered.

SYS@book> select * from v$tablespace;
       TS# NAME     INC BIG FLA ENC
---------- -------- --- --- --- ---
         0 SYSTEM   YES NO  YES
         1 SYSAUX   YES NO  YES
         2 UNDOTBS1 YES NO  YES
         4 USERS    YES NO  YES
         3 TEMP     NO  NO  YES
         6 EXAMPLE  YES NO  YES
         7 TEA      YES NO  YES
7 rows selected.

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

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7971388