在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别
生活随笔
收集整理的這篇文章主要介紹了
在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
在Oracle 11g中,recyclebin參數發生了微小的變化.
This supported parameter was introduced in Oracle 10.2.0
從文檔上我們可以看到這個變化說明,到了11g中,這個參數在session依然可以理解修改并影響當前的session,但如果是在系統一級修改的話,那么就要加deferred參數,對當前已經連接的sesion沒有影響,但新連接的session將受到影響
SQL> select name,isses_modifiable,issys_modifiable from v$parameter where name='recyclebin';
NAME? ?? ???ISSES_MODIFIABLE ISSYS_MODIFIABLE
----------- ---------------- ----------------
recyclebin??TRUE? ?? ?? ?? ? DEFERRED
SQL>?
下面做一個測試看看:
一開始,我用study用戶分別發起2個session連接到到我的ora11g數據庫上
SESSION 1
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0?
Connected as study
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?ON
SQL> alter system set recyclebin=off;
alter system set recyclebin=off
ORA-02096: 此選項的指定初始化參數不可修改
SQL> alter session set recyclebin=off;
Session altered
SQL> create table zrp(no int);
Table created
SQL> drop table zrp;
Table dropped
SQL> flashback table zrp to before drop;
flashback table zrp to before drop
ORA-38305: 對象不在回收站中
可以看到,在system一級,不加DEFERRED參數是不允許修改的,但在session一級可以修改.
SQL> alter system set recyclebin=off DEFERRED;
System altered
SQL>?
SESSION? 2
說明:在session 1中發出alter system set recyclebin=off DEFERRED;命令的時候,我的session 2已經連接到了ora11g上.在這個session中,我們用來體會
alter system set recyclebin=off DEFERRED;
命令對當前已經連接的session不影響
C:\Documents and Settings\zhangrp>sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 2月 20 16:20:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?ON
SQL> create table test_2(no int);
表已創建。
SQL> drop table test_2;
表已刪除。
SQL> flashback table test_2 to before drop;
閃回完成。
SQL> desc test_2
名稱? ?? ?? ?是否為空? 類型
------------ --------- -----------
NO? ?? ?? ?? ?? ?? ?? ?NUMBER(38)
SESSION 3
在session 1中完成alter system set recyclebin=off DEFERRED;命令以后,我們再發起一個新的連接,看看是不是對新的連接生效:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\zhangrp>sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 2月 20 16:23:46 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?OFF
This supported parameter was introduced in Oracle 10.2.0
| Version | Parameter Name | Data Type | Session Modifiable | System Modifiable |
| 10.2.0 | recyclebin | String | TRUE | IMMEDIATE |
| 11.1.0 | recyclebin | String | TRUE | DEFERRED |
從文檔上我們可以看到這個變化說明,到了11g中,這個參數在session依然可以理解修改并影響當前的session,但如果是在系統一級修改的話,那么就要加deferred參數,對當前已經連接的sesion沒有影響,但新連接的session將受到影響
SQL> select name,isses_modifiable,issys_modifiable from v$parameter where name='recyclebin';
NAME? ?? ???ISSES_MODIFIABLE ISSYS_MODIFIABLE
----------- ---------------- ----------------
recyclebin??TRUE? ?? ?? ?? ? DEFERRED
SQL>?
下面做一個測試看看:
一開始,我用study用戶分別發起2個session連接到到我的ora11g數據庫上
SESSION 1
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0?
Connected as study
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?ON
SQL> alter system set recyclebin=off;
alter system set recyclebin=off
ORA-02096: 此選項的指定初始化參數不可修改
SQL> alter session set recyclebin=off;
Session altered
SQL> create table zrp(no int);
Table created
SQL> drop table zrp;
Table dropped
SQL> flashback table zrp to before drop;
flashback table zrp to before drop
ORA-38305: 對象不在回收站中
可以看到,在system一級,不加DEFERRED參數是不允許修改的,但在session一級可以修改.
SQL> alter system set recyclebin=off DEFERRED;
System altered
SQL>?
SESSION? 2
說明:在session 1中發出alter system set recyclebin=off DEFERRED;命令的時候,我的session 2已經連接到了ora11g上.在這個session中,我們用來體會
alter system set recyclebin=off DEFERRED;
命令對當前已經連接的session不影響
C:\Documents and Settings\zhangrp>sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 2月 20 16:20:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?ON
SQL> create table test_2(no int);
表已創建。
SQL> drop table test_2;
表已刪除。
SQL> flashback table test_2 to before drop;
閃回完成。
SQL> desc test_2
名稱? ?? ?? ?是否為空? 類型
------------ --------- -----------
NO? ?? ?? ?? ?? ?? ?? ?NUMBER(38)
SESSION 3
在session 1中完成alter system set recyclebin=off DEFERRED;命令以后,我們再發起一個新的連接,看看是不是對新的連接生效:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\zhangrp>sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 2月 20 16:23:46 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter recyclebin
NAME? ?? ?? ???TYPE? ?? ???VALUE
-------------- ----------- --------------
recyclebin? ???string? ?? ?OFF
總結
以上是生活随笔為你收集整理的在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ORACLE TEXT LEXER PR
- 下一篇: dbms_xplan.display_c