在oracle11g中altersystem set recyclebin = off报错recyclebin参数在11g和10g中的有哪些区别

51次阅读
没有评论

共计 2906 个字符,预计需要花费 8 分钟才能阅读完成。

行业资讯    
数据库    
关系型数据库    
在 oracle11g 中 altersystem set recyclebin = off 报错 recyclebin 参数在 11g 和 10g 中的有哪些区别

在 oracle11g 中 altersystem set recyclebin = off 报错 recyclebin 参数在 11g 和 10g 中的有哪些区别
发布时间:2021-11-25 09:55:08
来源:丸趣 TV
阅读:121
作者:小新
栏目:关系型数据库

丸趣 TV 小编给大家分享一下在 oracle11g 中 altersystem set recyclebin = off 报错 recyclebin 参数在 11g 和 10g 中的有哪些区别,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

在 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

以上是“在 oracle11g 中 altersystem set recyclebin = off 报错 recyclebin 参数在 11g 和 10g 中的有哪些区别”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-19发表,共计2906字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)