Oracle表空间操作

  wxyz

0x00 查看表空间

SELECT TABLESPACE_NAME,
FILE_ID,
FILE_NAME,
ROUND(BYTES / (1024 * 1024), 0)||'M' TOTAL_SPACE
FROM DBA_DATA_FILES
ORDER BY TABLESPACE_NAME;

0x01 创建表空间

CREATE TABLESPACE TEST
LOGGING
DATAFILE '/data2/js/test_01.dbf'
SIZE 50M
AUTOEXTEND ON
NEXT 50M MAXSIZE 20480M
EXTENT MANAGEMENT LOCAL;

0x02 新增数据文件

ALTER TABLESPACE test
ADD
DATAFILE '/data2/js/test_02.dbf' SIZE 1024M
AUTOEXTEND ON NEXT 256M MAXSIZE 32767M;

0x03 删除表空间

DROP TABLESPACE WISDATA INCLUDING CONTENTS AND DATAFILES;

===============
@wxyz 转载请注明出处,谢谢~
===============