Home > Database > Mysql Tutorial > Oracle中将表设置为read only的问题

Oracle中将表设置为read only的问题

WBOY
Release: 2016-06-07 17:29:19
Original
1599 people have browsed it

关于Oracle中将表设置为read only的问题 alter table test3 read only; 这个特性应该是从11g新增的,因为在10g中执行会报错: OR

关于Oracle中将表设置为read only的问题

alter table test3 read only;

这个特性应该是从11g新增的,因为在10g中执行会报错:

ORA-01735: 无效的 ALTER TABLE 选项

当设置为read only以后,就不可以再插入数据,修改数据或者删除数据,,也就是说insert,update,delete,truncate等DML操作对该表都无法执行了:

ORA-12081: 不允许对表 "APPS_SBD"."TEST1" 进行更新操作

但是drop命令还是可以用的,原因是drop是DDL命令,它操作的应该是数据字典,不受read only的限制。

补充一下,想要将表恢复成可写状态很简单:

alter table test3 read write;

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template