Oracle 11g新特性之--只读表(read only table)
Oracle 11g新特性之--只读表(read only table)
Oracle11g推出了一个新的特性,可以将table置于read only状态,处于该状态的table的不能执行DML操作和某些DDL操作。在Oracle11g之前的版本,只能将整个tablespace或者database置于read only状态。对于table的控制则只能通过权限来设定。
案例分析:
11:44:46 SCOTT@ test1 >select * from tab; TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- BONUS TABLE CREDIT_CLUSTER CLUSTER CREDIT_ORDERS TABLE 1 DEPT TABLE EMP TABLE EMP1 TABLE11:44:56 SCOTT@ test1 >select count(*) from emp1;COUNT(*) ----------18 Elapsed: 00:00:00.04 11:45:12 SCOTT@ test1 >alter table emp1 read only; Table altered.11:51:46 SCOTT@ test1 >select read_only from user_tables where table_name='EMP1'; REA --- YES对只读表做DML: 11:45:20 SCOTT@ test1 >insert into emp1 select * from emp where rownum=1; insert into emp1 select * from emp where rownum=1* ERROR at line 1:ORA-12081: update operation not allowed on table "SCOTT"."EMP1" Elapsed: 00:00:00.04 11:45:38 SCOTT@ test1 >delete from emp1; delete from emp1* ERROR at line 1: ORA-12081: update operation not allowed on table "SCOTT"."EMP1" Elapsed: 00:00:00.00 11:45:47 SCOTT@ test1 >update emp1 set sal=6000 where empno=7788; update emp1 set sal=6000 where empno=7788* ERROR at line 1: ORA-12081: update operation not allowed on table "SCOTT"."EMP1"TRUNCATE TABLE: 11:46:03 SCOTT@ test1 >truncate table emp1; truncate table emp1* ERROR at line 1: ORA-12081: update operation not allowed on table "SCOTT"."EMP1" Elapsed: 00:00:00.09DROP TABLE: 11:46:45 SCOTT@ test1 >drop table emp1; Table dropped. Elapsed: 00:00:00.70 11:47:05 SCOTT@ test1 >show recycle; ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME ---------------- ------------------------------ ------------ ------------------- EMP1 BIN$ComP5WftmQ7gUKjA+QgIyQ==$0 TABLE 2014-12-19:11:47:04 11:47:52 SCOTT@ test1 >flashback table emp1 to before drop; Flashback complete. 11:49:56 SCOTT@ test1 >select count(*) from emp1;COUNT(*) ----------18MOVE TABLE: 11:50:06 SCOTT@ test1 >alter table emp1 move; Table altered. Elapsed: 00:00:00.54压缩表: 11:51:27 SCOTT@ test1 >alter table emp1 compress; Table altered. Elapsed: 00:00:00.09 11:51:39 SCOTT@ test1 >alter table emp1 nocompress; Table altered. Elapsed: 00:00:00.16约束管理: 11:52:53 SCOTT@ test1 >alter table emp1 add constraint fk_emp1 foreign key(deptno) references dept(deptno); Table altered.11:54:29 SCOTT@ test1 >alter table emp1 drop constraint fk_emp1; Table altered.11:54:47 SCOTT@ test1 >create index emp1_empno_ind on emp1(empno) tablespace indx; Index created.索引管理: 11:55:17 SCOTT@ test1 >drop index emp1_empno_ind; Index dropped.配置read write: 11:55:27 SCOTT@ test1 >alter table emp1 read write; Table altered.11:55:37 SCOTT@ test1 >select read_only from user_tables where table_name='EMP1'; REA --- NO
转载于:https://blog.51cto.com/tiany/1591685
Oracle 11g新特性之--只读表(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)一个业务系统 ...
- Oracle 11g新特性之 - 使用RMAN复制数据库
Oracle 11g新特性之 - 使用RMAN复制数据库 Oracle 11g新特性之 - 使用RMAN复制数据库 - 1 Oracle 11g新特性之 - 使用RMAN复制数据库 - 2 Oracl ...
最新文章
- Windows消息备忘录
- 手rm-linux联网后自动dhcp,Linux操作系统下DHCP基础配置
- linux版本信息i686,Linux下如何查看版本信息
- recyclerview放不同的布局_RecyclerView系列之(2):为RecyclerView添加分隔线
- SqlServer中使用游标进行双重遍历
- python整数作为条件_Python基本概念介绍
- AAC AMR WAV MP3 采样率
- FPGA学习笔记_图像处理3_FPGA实现中值滤波算法
- ubuntu linux qq闪退
- linux内存测试工具memtest,Linux基础教程:内存测试工具(Memtest86+)
- 时间序列分析 23 DTW (时序相似度度量算法) 上
- QEMU中TCG翻译流程
- 实现手机app控制威联通QNAP的NAS设备中Aria2启动运行
- 用python爬取考研词汇及其近反义词与例句
- 深度学习中常见的损失函数(L1Loss、L2loss)
- 关于我想写个脚本,最后却搞了个桌面宠物这件事(一)
- opencv 入门笔记五 padding(图像加边框)
- 看得见的数据结构Android版之表的数组实现(视图篇)
- Mobiola web camera Mobiola web camera
- 西门子PLC与Profinet工业以太网RFID读写器|读卡器的编程与配置说明