在oracle11g中altersystem set recyclebin = off报错recyclebin参数在11g和10g中的有哪些区别
admin
2023-05-08 05:01:21
0

在Oracle 11g中,recyclebin参数发生了微小的变化.

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中,这个参数在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 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: 此选项的指定初始化参数不可修改

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 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);

表已创建。

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;命令以后,我们再发起一个新的连接,看看是不是对新的连接生效:

Microsoft Windows XP [版本 5.1.2600]

(C) 版权所有 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

相关内容

热门资讯

Google在港推出AI代理G... 观点网讯:7月29日,Google在香港推出AI代理Gemini Spark,该代理可全天候在后台运...
5G+165Hz!联想新品官宣... 近两年来,小屏平板一直是比较有趣的一个品类。 不同于大平板注重效率、手机追求万能的特点,拯救者Y70...
原创 马... 马斯克又出来了。这次说2036年钱就没用了。 理由是人工智能加机器人,东西多到你用不完,还拿钱干嘛...
美的集团:我国智能家居互联互通... IT之家 7 月 30 日消息,美的集团今日发布公告,7 月 21 日至 23 日,智能家居互联互通...
华为新款MatePad Pro... 【CNMO科技消息】7月30日,@华为终端 官宣全新旗舰平板华为MatePad Pro。 新款华为...
从实验室到实景验证:6G光子太... 全息通信是第六代移动通信(6G)的典型应用场景之一,旨在通过融合无线传输与全息三维成像技术,实现超大...
从“能对话”到“能干活”——人... 【经济界面】 光明日报记者 刘坤 李晓东 周洪双 人工智能(AI)眼镜化身为个人“助理”,实时进行...
【全新发布】UminiP Pr... (来源:洲明科技)
日本通过“H3火箭8号”发射失... △H3火箭(资料图) 日本文部科学省30日召开关于去年“H3火箭8号”发射失败的会议。会议通过的最终...
互联网巨头抢滩健康硬件,上游芯... 封面新闻记者 付文超 当下,互联网巨头对健康硬件的押注,正在成为产业现实,加速拉动整个产业链步入新一...