分类: Oracle
2008-04-24 09:26:03
来源:赛迪网 作者:Edgar |
将表空间置为只读模式和读写模式:
SQL> alter tablespace users read only;
Tablespace altered.
SQL> alter tablespace users read write;
Tablespace altered.
删除表空间:
SQL> drop tablespace userdat including contents and datafiles;
Tablespace dropped.
手工改变数据文件的大小:
SQL> alter database datafile '/home/oracle/oradata/gldb/users01.dbf' resize 20m;
Database altered.
添加数据文件到表空间:
SQL> alter tablespace users add datafile '/home/oracle/oradata/gldb/users02.dbf' size 1m;
Tablespace altered.
设置表空间数据文件的缺省位置:
SQL> alter system set db_create_file_dest = '/home/oracle/oradata/gldb';
System altered.
SQL> create tablespace userdat2 datafile size 2m;
Tablespace created.
[oracle@redhatoracle gldb]$ pwd
/home/oracle/oradata/gldb
[oracle@redhatoracle gldb]$ ls -l | grep userdat2
-rw-r----- 1 oracle oinstall 2105344 Dec 16 06:53 o1_mf_userdat2_2r69vob3_.dbf
获得表空间和数据文件信息:
SQL> select * from v$tablespace;
SQL> select * from v$datafile; |