script to add datafile to tablespace

Solutions on MaxInterview for script to add datafile to tablespace by the best coders in the world

showing results for - "script to add datafile to tablespace"
Domenico
25 Aug 2017
1SELECT * FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = 'my_tbs' ORDER BY FILE_NAME;
2
3ALTER TABLESPACE my_tbs ADD DATAFILE '/path/to/my_file.dbf' 
4	SIZE 100M AUTOEXTEND OFF;
5-- Autoextend with max size:
6ALTER TABLESPACE my_tbs ADD DATAFILE '/path/to/my_file.dbf' 
7	SIZE 10G AUTOEXTEND ON NEXT 1G MAXSIZE 32000M;    
8-- For TEMP tablespace:
9ALTER TABLESPACE my_tbs ADD TEMPFILE '/path/to/my_file.dbf' 
10	SIZE 100M AUTOEXTEND OFF;