您好,登錄后才能下訂單哦!
小編給大家分享一下在oracle11g中altersystem set recyclebin = off報(bào)錯(cuò)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
從文檔上我們可以看到這個(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 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: 對(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 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;命令以后,我們?cè)侔l(fā)起一個(gè)新的連接,看看是不是對(duì)新的連接生效:
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報(bào)錯(cuò)recyclebin參數(shù)在11g和10g中的有哪些區(qū)別”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。