共計 2906 個字符,預(yù)計需要花費(fèi) 8 分鐘才能閱讀完成。
行業(yè)資訊
數(shù)據(jù)庫
關(guān)系型數(shù)據(jù)庫
在 oracle11g 中 altersystem set recyclebin = off 報錯 recyclebin 參數(shù)在 11g 和 10g 中的有哪些區(qū)別
在 oracle11g 中 altersystem set recyclebin = off 報錯 recyclebin 參數(shù)在 11g 和 10g 中的有哪些區(qū)別
發(fā)布時間:2021-11-25 09:55:08
來源:丸趣 TV
閱讀:121
作者:小新
欄目:關(guān)系型數(shù)據(jù)庫
丸趣 TV 小編給大家分享一下在 oracle11g 中 altersystem set recyclebin = off 報錯 recyclebin 參數(shù)在 11g 和 10g 中的有哪些區(qū)別,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
在 Oracle 11g 中,recyclebin 參數(shù)發(fā)生了微小的變化.
This supported parameter was introduced inOracle 10.2.0
Version ParameterName Data Type Session Modifiable System Modifiable
10.2.0 recyclebin String TRUE IMMEDIATE
11.1.0 recyclebin String TRUE DEFERRED
從文檔上我們可以看到這個變化說明,到了 11g 中,這個參數(shù)在 session 依然可以理解修改并影響當(dāng)前的 session, 但如果是在系統(tǒng)一級修改的話,那么就要加 deferred 參數(shù),對當(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
下面做一個測試看看:
一開始, 我用 study 用戶分別發(fā)起 2 個 session 連接到到我的 ora11g 數(shù)據(jù)庫上
SESSION 1
Connected to Oracle Database 11g EnterpriseEdition 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: 對象不在回收站中
可以看到, 在 system 一級, 不加 DEFERRED 參數(shù)是不允許修改的, 但在 session 一級可以修改.
SQL alter system set recyclebin=off DEFERRED;
System altered
SQL
SESSION 2
說明: 在 session 1 中發(fā)出 alter system set recyclebin=off DEFERRED; 命令的時候, 我的 session 2 已經(jīng)連接到了 ora11g 上. 在這個 session 中,我們用來體會
alter system set recyclebin=off DEFERRED;
命令對當(dāng)前已經(jīng)連接的 session 不影響
C:\Documents andSettings\zhangrp sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 – Productionon 星期五 2 月 20 16:20:50 2009
Copyright (c) 1982, 2007, Oracle. Allrights reserved.
連接到:
Oracle Database 11g Enterprise EditionRelease 11.1.0.6.0 – Production
With the Partitioning, OLAP, Data Miningand 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 beforedrop;
閃回完成。
SQL desc test_2
名稱 是否為空? 類型
———— ——— ———–
NO NUMBER(38)
SESSION 3
在 session 1 中完成 alter system set recyclebin=off DEFERRED; 命令以后, 我們再發(fā)起一個新的連接, 看看是不是對新的連接生效:
Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 1985-2001Microsoft Corp.
C:\Documents andSettings\zhangrp sqlplus study/study
SQL*Plus: Release 11.1.0.6.0 – Productionon 星期五 2 月 20 16:23:46 2009
Copyright (c) 1982, 2007, Oracle. Allrights reserved.
連接到:
Oracle Database 11g Enterprise EditionRelease 11.1.0.6.0 – Production
With the Partitioning, OLAP, Data Miningand Real Application Testing options
SQL show parameter recyclebin
NAME TYPE VALUE
————– ———– ————–
recyclebin string OFF
以上是“在 oracle11g 中 altersystem set recyclebin = off 報錯 recyclebin 參數(shù)在 11g 和 10g 中的有哪些區(qū)別”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!