Add/Drop/Alter datafile - Oracle Database Script. -- Add a datafile to a tablespace Alter tablespace USERS add datafile '/u01/data/users02.dbf' size 5G; -- Enable autoextend on for a datafile; Alter database datafile '/u01/data/users02.dbf' autoextend on; -- Resize a datafile alter database datafile '/u01/data/users02.dbf' resize 10G; -- Make a datafile offline/online Alter database datafile '/u01/data/users02.dbf' offline; Alter database datafile '/u01/data/users02.dbf' online; -- Drop a datafile: Alter tablespace USERS drop datafile '/u01/data/users02.dbf';
-- Add a datafile to a tablespace Alter tablespace USERS add datafile '/u01/data/users02.dbf' size 5G; -- Enable autoextend on for a datafile; Alter database datafile '/u01/data/users02.dbf' autoextend on; -- Resize a datafile alter database datafile '/u01/data/users02.dbf' resize 10G; -- Make a datafile offline/online Alter database datafile '/u01/data/users02.dbf' offline; Alter database datafile '/u01/data/users02.dbf' online; -- Drop a datafile: Alter tablespace USERS drop datafile '/u01/data/users02.dbf';