2019.6.27 oracle复习 表空间

2.8 创建表空间

1.create (temporary临时) tablespace  表空间名  datafile(tempfile临时) 'xx.dbf'(文件名)size  xx(如10M)

  例子: create tablespace news_tablespace datafile 'F:oraclefiledbm ews_data.dbf' size 500M

2.desc dba_data_files 查看数据字典的字段

3.select file_name from dba_data_files where tablespace_name = '表空间名'; 创建后的表空间的文件名,查看其路径

2.9修改表空间

1.alter tablespace 表空间名 online/offline;  设置联机或脱机

2.desc dba_tablespaces 查看此数据字典的字段中的 status(状态)

3.select status from dba_tablespaces where tablespace_name='表空间名'; 查看此表空间的状态

4.alter tablespace 表空间名 read only/read write;

2.10修改表空间的数据文件

1.alter tablespace 表空间名 add datafile 'xx.dbf' size xx; 增加数据文件

2.alter tablespace 表空间名 drop datafile 'xx.dbf' size xx; 删除数据文件。 无法删除第一个数据文件

2.12删除表空间

1.drop tablespace 表空间名 [including contents];     只删除表空间,不删除数据文件。[连数据一起删除]

原文地址:https://www.cnblogs.com/kentee/p/11095528.html