ITPub博客

首页 > 数据库 > 数据库开发技术 > 只读表空间的几点记录

只读表空间的几点记录

原创 数据库开发技术 作者:msdnchina 时间:2011-10-08 22:44:11 0 删除 编辑

C:Documents and SettingsAdministrator>sqlplus system/aaaaaa

SQL*Plus: Release 11.1.0.6.0 - Production on 星期六 10月 8 22:37:22 2011

Copyright (c) 1982, 2007, Oracle. All rights reserved.


连接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
MYTBS

已选择6行。



SQL> alter tablespace mytbs read only;

表空间已更改。


SQL> select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
MYTBS READ ONLY

已选择6行。

SQL> create table testa tablespace mytbs as select * from dba_users where 1=2;
create table testa tablespace mytbs as select * from dba_users where 1=2
*
第 1 行出现错误:
ORA-01647: 表空间 'MYTBS' 是只读, 无法在其中分配空间


SQL> alter tablespace mytbs add datafile 'F:appAdministratororadataora11gmytbs2.dbf';
alter tablespace mytbs add datafile 'F:appAdministratororadataora11gmytbs2.dbf'
*
第 1 行出现错误:
ORA-01641: 表空间 'MYTBS' 未联机 - 无法添加数据文件


值得注意的是:设置表空间read only 时,db可以处于非归档模式。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/161195/viewspace-1055516/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-07-30

  • 博文量
    498
  • 访问量
    1542056