如果对表存储的规划较好,将业务相关的表都放在几个表空间里,可以通过设置表空间只读的方式,让这些表只读:
alter tablespace <tablespace name> read only;
解除只读:
alter tablespace <tablespace name> read write;
当然也可以只设置表的只读:
alter table t1 read only;
alter table t1 read write;
此时如果查询,可以查到:
col name for a50
set linesize 300
set pagesize 100
select file#, enabled, last_time, name from v$datafile;
还可以查询dba_tablespaces
select TABLESPACE_NAME, STATUS from dba_tablespaces;
本文介绍了如何通过设置表空间或单独的表为只读状态来控制数据库中的数据修改操作。文中提供了具体的SQL命令示例,包括设置只读和取消只读的方法,并展示了如何查询当前的表空间状态。
1302

被折叠的 条评论
为什么被折叠?



