在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别
生活随笔
收集整理的這篇文章主要介紹了
在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
?
在Oracle 11g中,recyclebin參數(shù)發(fā)生了微小的變化.
This supported parameter was introduced in Oracle 10.2.0
從文檔上我們可以看到這個(gè)變化說明,到了11g中,這個(gè)參數(shù)在session依然可以理解修改并影響當(dāng)前的session,但如果是在系統(tǒng)一級(jí)修改的話,那么就要加deferred參數(shù),對(duì)當(dāng)前已經(jīng)連接的sesion沒有影響,但新連接的session將受到影響
SQL> select name,isses_modifiable,issys_modifiable from v$parameter where name='recyclebin';
NAME? ?? ???ISSES_MODIFIABLE ISSYS_MODIFIABLE
----------- ---------------- ----------------
recyclebin??TRUE? ?? ?? ?? ? DEFERRED
SQL>?
下面做一個(gè)測(cè)試看看:
一開始,我用study用戶分別發(fā)起2個(gè)session連接到到我的ora11g數(shù)據(jù)庫上
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: 此選項(xiàng)的指定初始化參數(shù)不可修改
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: 對(duì)象不在回收站中
可以看到,在system一級(jí),不加DEFERRED參數(shù)是不允許修改的,但在session一級(jí)可以修改.
SQL> alter system set recyclebin=off DEFERRED;
System altered
SQL>?
SESSION? 2
說明:在session 1中發(fā)出alter system set recyclebin=off DEFERRED;命令的時(shí)候,我的session 2已經(jīng)連接到了ora11g上.在這個(gè)session中,我們用來體會(huì)
alter system set recyclebin=off DEFERRED;
命令對(duì)當(dāng)前已經(jīng)連接的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);
表已創(chuàng)建。
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;命令以后,我們?cè)侔l(fā)起一個(gè)新的連接,看看是不是對(duì)新的連接生效:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 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 |
從文檔上我們可以看到這個(gè)變化說明,到了11g中,這個(gè)參數(shù)在session依然可以理解修改并影響當(dāng)前的session,但如果是在系統(tǒng)一級(jí)修改的話,那么就要加deferred參數(shù),對(duì)當(dāng)前已經(jīng)連接的sesion沒有影響,但新連接的session將受到影響
SQL> select name,isses_modifiable,issys_modifiable from v$parameter where name='recyclebin';
NAME? ?? ???ISSES_MODIFIABLE ISSYS_MODIFIABLE
----------- ---------------- ----------------
recyclebin??TRUE? ?? ?? ?? ? DEFERRED
SQL>?
下面做一個(gè)測(cè)試看看:
一開始,我用study用戶分別發(fā)起2個(gè)session連接到到我的ora11g數(shù)據(jù)庫上
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: 此選項(xiàng)的指定初始化參數(shù)不可修改
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: 對(duì)象不在回收站中
可以看到,在system一級(jí),不加DEFERRED參數(shù)是不允許修改的,但在session一級(jí)可以修改.
SQL> alter system set recyclebin=off DEFERRED;
System altered
SQL>?
SESSION? 2
說明:在session 1中發(fā)出alter system set recyclebin=off DEFERRED;命令的時(shí)候,我的session 2已經(jīng)連接到了ora11g上.在這個(gè)session中,我們用來體會(huì)
alter system set recyclebin=off DEFERRED;
命令對(duì)當(dāng)前已經(jīng)連接的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);
表已創(chuàng)建。
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;命令以后,我們?cè)侔l(fā)起一個(gè)新的連接,看看是不是對(duì)新的連接生效:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 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
總結(jié)
以上是生活随笔為你收集整理的在11g中alter system set recyclebin = off 报错 recyclebin 参数在11g和10g中的区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ORACLE TEXT LEXER PR
- 下一篇: dbms_xplan.display_c