只读表空间的几点记录

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@]

请使用浏览器的分享功能分享到微信等