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

简介:

11galtersystem set recyclebin = off 报错recyclebin 参数在11g10g中的区别


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用户分别发起2session连接到到我的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



本文转自pizibaidu 51CTO博客,原文链接:http://blog.51cto.com/pizibaidu/1691940,如需转载请自行联系原作者

相关文章
|
6天前
|
存储 JavaScript 索引
js开发:请解释什么是ES6的Map和Set,以及它们与普通对象和数组的区别。
ES6引入了Map和Set数据结构。Map的键可以是任意类型且有序,与对象的字符串或符号键不同;Set存储唯一值,无重复。两者皆可迭代,支持for...of循环。Map有get、set、has、delete等方法,Set有add、delete、has方法。示例展示了Map和Set的基本操作。
18 3
|
27天前
|
存储 JavaScript 前端开发
set和map的区别
set和map的区别
38 4
|
4月前
|
存储 JavaScript 前端开发
JavaScript 中 Set 和 Map 的区别
JavaScript 中 Set 和 Map 的区别
24 0
|
10月前
|
存储 开发者 索引
List 和 Set 集合的区别
List 和 Set 集合的区别
74 0
|
10月前
|
存储 容器
set和map的区别
set和map的区别
82 0
|
5月前
|
存储 索引 Python
python数据结构,集合(set)和字典(dict)之间的主要区别是什么?
python数据结构,集合(set)和字典(dict)之间的主要区别是什么?
|
5月前
|
存储 前端开发 索引
前端知识笔记(三)———Map和Set有什么区别?
前端知识笔记(三)———Map和Set有什么区别?
37 0
|
7月前
|
存储 Java 索引
每日一道面试题之list和set有什么区别?
每日一道面试题之list和set有什么区别?
|
8月前
|
JavaScript
js 中 Map 和 Set 区别
js 中 Map 和 Set 区别
|
11月前
|
索引 Python
pandas中set_index、reset_index区别
pandas中set_index、reset_index区别