首页 > Linux操作系统 > Linux操作系统 > Oracle 表空间的操作
|
1.创建表空间 SQL> create tablespace testspace datafile 'd:/OracleTest/test001.dbf' size 10m a 2.给表空间添加文件 SQL> alter tablespace testspace add datafile 'd:/OracleTest/test002.dbf' size 5m 3.删除表空间中的文件 SQL> alter tablespace testspace drop datafile 'd:/OracleTest/test002.dbf'; 4.修改表空间文件的大小 SQL> alter database datafile 'd:/OracleTest/test001.dbf' resize 10m; 5.修改表空间文件的自动增长属性 6.修改表空间的读写属性 SQL> alter tablespace testspace read only;(只读) SQL> alter tablespace testspace read write;(读写) 7.设置表空间上下线 SQL> alter tablespace testspace offline; SQL> alter tablespace testspace online; 8.转移物理文件路径的操作 (1)设置表空间下线 alter tablespac testspace offline; (2)物理转移表空间文件;即把你的表空间物理文件转移到你想移动的路径 (3)逻辑转移:alter tablespace testspace rename 'd:/OracleTest/test001.dbf' to 'e:/test001.dbf'; (4)设置表空间上线 alter tablespace testspace online; 9.删除表空间 (1)不删文件 drop tablespace testspace; (2)删除文件 drop tablespace testspace including contents and datafiles; 10.物理文件被非法删除时,怎样启动数据库 (1)关闭数据库服务 shutdown (2)alter database datafile 'd:/test001.dbf' offline drop; (3)alter database open; (4)开启数据库服务 startup; |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14855094/viewspace-414866/ ,如需转载,请注明出处,否则将追究法律责任。