Here are the commands to Create Tablespace, Resize datafile, tablespace offline/online/read only, drop tablespace
Create tablespace:
CREATE TABLESPACE TEST DATAFILE '/u01/oradata/test01.dbf' SIZE 500m;
Create Undo tablespace:
CREATE UNDO TABLESPACE undo1 DATAFILE '/u01/oradata/undo01.dbf' SIZE 500m;
Create Temporary tablespace:
CREATE TEMPORARY TABLESPACE temp TEMPFILE '/u01/oradata/temp01.dbf' SIZE 500m;
Set Temp tablespace as default tablespace:
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;
Take a tablespace offline:
ALTER TABLESPACE TEST OFFLINE;
Take a tablespace online:
ALTER TABLESPACE TEST ONLINE;
Put Tablespace in Read-Only mode:
ALTER TABLESPACE TEST READ ONLY;
Drop tablespace:
DROP TABLESPACE TEST INCLUDING CONTENTS AND DATAFILES;
Enabling Automatic Extension of Data Files
ALTER DATABASE DATAFILE '/u01/oradata/test01.dbf' SIZE 500M AUTOEXTEND ON;
Adding Data Files to a Tablespace:
ALTER TABLESPACE test ADD DATAFILE '/u01/oradata/test02.dbf' SIZE 500M;
Resize Datafile:
alter database datafile '/u01/oradata/test01.dbf' RESIZE 1G;
Create tablespace:
CREATE TABLESPACE TEST DATAFILE '/u01/oradata/test01.dbf' SIZE 500m;
Create Undo tablespace:
CREATE UNDO TABLESPACE undo1 DATAFILE '/u01/oradata/undo01.dbf' SIZE 500m;
Create Temporary tablespace:
CREATE TEMPORARY TABLESPACE temp TEMPFILE '/u01/oradata/temp01.dbf' SIZE 500m;
Set Temp tablespace as default tablespace:
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;
Take a tablespace offline:
ALTER TABLESPACE TEST OFFLINE;
Take a tablespace online:
ALTER TABLESPACE TEST ONLINE;
Put Tablespace in Read-Only mode:
ALTER TABLESPACE TEST READ ONLY;
Drop tablespace:
DROP TABLESPACE TEST INCLUDING CONTENTS AND DATAFILES;
Enabling Automatic Extension of Data Files
ALTER DATABASE DATAFILE '/u01/oradata/test01.dbf' SIZE 500M AUTOEXTEND ON;
Adding Data Files to a Tablespace:
ALTER TABLESPACE test ADD DATAFILE '/u01/oradata/test02.dbf' SIZE 500M;
Resize Datafile:
alter database datafile '/u01/oradata/test01.dbf' RESIZE 1G;
No comments:
Post a Comment