Oracle 11g 新特性 -- 只读表(read-only table)说明
一.Read only table说明
在Oracle 11g之前,如果我们想要对一个表设置为只读的,可以通过授予某些用户select 权限。 但是对于表的所有者来说,还是读写的。
在Oracle 11g中,我们可以直接对表的读写权限进行设置:
ALTER TABLE table_name READ ONLY;
ALTER TABLE table_name READ WRITE;
二.示例
--创建表
SQL> create table dave as select * fromdba_objects;
Table created.
--设置为只读:
SQL> alter table dave read only;
Table altered.
--查看表状态:
SQL> select table_name,status,read_onlyfrom dba_tables where table_name='DAVE';
TABLE_NAME STATUS REA
------------------------------ -------- ---
DAVE VALID YES
--这里显示是只读的。
--对Dave表进行DML操作:
SQL> insert into dave select * fromdave;
insert into dave select * from dave
*
ERROR at line 1:
ORA-12081: update operation not allowed ontable "SYS"."DAVE"
SQL> update dave set object_id=88;
update dave set object_id=88
*
ERROR at line 1:
ORA-12081: update operation not allowed ontable "SYS"."DAVE"
SQL> delete from dave;
delete from dave
*
ERROR at line 1:
ORA-12081: update operation not allowed ontable "SYS"."DAVE"
SQL> truncate table dave;
truncate table dave
*
ERROR at line 1:
ORA-12081: update operation not allowed ontable "SYS"."DAVE"
SQL> alter table dave add(namevarchar(20));
alter table dave add(name varchar(20))
*
ERROR at line 1:
ORA-12081: update operation not allowed ontable "SYS"."DAVE"
--虽然表示只读的,但是我们对表进行与索引相关的操作,因为索引修改的是数据字典,和表不相关。
SQL> create index idx_id on dave(object_id);
Index created.
SQL> drop index idx_id;
Index dropped.
--将表改成读写:
SQL> altertable dave read write;
Table altered.
SQL> droptable dave;
Table dropped.
---------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
Email: tianlesoftware@gmail.com
Blog: http://blog.csdn.net/tianlesoftware
Weibo: http://weibo.com/tianlesoftware
Twitter: http://twitter.com/tianlesoftware
转载于:https://www.cnblogs.com/tianlesoftware/archive/2012/11/25/3609143.html
Oracle 11g 新特性 -- 只读表(read-only table)说明相关推荐
- Oracle 11g新特性之--只读表(read only table)
Oracle 11g新特性之--只读表(read only table) Oracle11g推出了一个新的特性,可以将table置于read only状态,处于该状态的table的不能执行 ...
- Oracle 11g 新特性:只读表(Read-only)
Oracle 11g 新特性:只读表(Read-only) Oracle11g推出了一个新的特性,可以将table置于read only状态,处于该状态的table的不能执行DML操作和某些DDL操作 ...
- ORACLE 11g新特性中文版
Oracle 11g 新特性 摘自ITPUB的love_zz的帖子 http://www.itpub.net/712880.html Oracle 11g 现在已经开始进行beta测试,预计在2007 ...
- 11g awr oracle 系列_Oracle 11g AWR 系列七:Active Sessi...-Oracle 11G新特性(共36个)-父子节点问题_169IT.COM...
Oracle 11G新特性(共36个) 一.数据库管理部分 · 1. 数据库重演(Database Replay) 这一特性可以捕捉整个数据的负载,并且传递到一个从备份或者standby数据 ...
- Oracle 11g 新特性 -- Transparent Data Encryption (透明数据加密TDE) 增强 说明
一.TransparentData Encryption (TDE:透明数据加密) 说明 Orace TDE 是Orcle 10R2中的一个新特性,其可以用来加密数据文件里的数据,保护从操作系统层面上 ...
- Oracle 11g新特性之--虚拟列(Virtual Column)
Oracle 11g新特性之--虚拟列(Virtual Column) Oracle 11G虚拟列Virtual Column介绍 在老的 Oracle 版本,当我们需要使用表达式或者一些计算公式时, ...
- oracle+字段+virtual,Oracle 11g新特性之--虚拟列(Virtual Column)
Oracle 11g新特性之--虚拟列(Virtual Column) Oracle 11G虚拟列Virtual Column介绍 在老的 Oracle 版本,当我们需要使用表达式或者一些计算公式时, ...
- Oracle 11g新特性之缓存与连接池
Oracle 11g新特性之缓存与连接池 上一篇 /下一篇 2008-03-26 16:03:19 / 个人分类:Oracle 数据库 11g面向 DBA 和开发人员的重要新特性 查看( 414 ) ...
- Oracle 11g新特性direct path read引发的系统停运故障诊断处理
Oracle 11g新特性direct path read引发的系统停运故障诊断处理 黎俊杰 | 2016-07-28 14:37 声明:部分表名为了脱敏而用XX代替 1.故障现象 (1)一个业务系统 ...
最新文章
- React Native初始化项目0.47.1报错
- 利用函数wavread对语音信号进行采样_语音识别第4讲:语音特征参数MFCC
- 【Nutch2.2.1源代码分析之4】Nutch加载配置文件的方法
- Angular.js 页面里的按钮点击事件处理
- 获取php.ini配置信息,获得php所对应的配置文件(php.ini)信息
- 外包公司到底值不值去?
- 锐捷ap怎么设置_新房装修网络布线方案一:AC+AP模式,弱电箱只放光猫和集成AC...
- Selenium 显示等待和隐式等待
- Eye Tracking Methodology Theory and Practice, Third Edition
- Tableau 2021安装教程
- android重复点击屏幕,手机不ROOT.推荐一款android能用的屏幕连点器,类似按键精灵!...
- 用于AB测试的减少方差方法总结和对比
- 资管过程日报指标异常分析
- 聚名师之力,扬信息之帆,逐教育现代化浪潮——韶关市教育信息化蓝凌名教师工作室挂牌仪式
- 网络管理与维护(5.1)RMON 远程网络监视
- 还不懂PID控制?精华都在这了!
- 计算机专业硕士北欧,北欧哪个国家计算机专业比较好
- 回文是指正读反读均相同的字符序列,如“abba”和“abdba”均是回文,但“good”不是回文。编写一个程序,使用栈判定给定的字符序列是否为回文。
- 【算法•日更•第十二期】信息奥赛一本通1585:【例 1】Amount of Degrees题解
- 从爬取豆瓣影评到基于朴素贝叶斯的电影评论情感分析(上)