How to add a datafile or extend tablespace?


Add a new datafile to existing tablespace:

<br />
ALTER TABLESPACE TESTING<br />
  ADD DATAFILE ‘/u01/oradata/userdata05.dbf’ SIZE 500M;<br />

Find info about data files:

<br />
SELECT FILE_NAME, BYTES<br />
  FROM DBA_DATA_FILES<br />
  WHERE TABLESPACE_NAME = ‘TESTING’;<br />

You could also turn on autoextend for the whole database.
Just change the filepath to point to your system.dbf file.

<br />
ALTER DATABASE DATAFILE ‘C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF’<br />
  AUTOEXTEND ON NEXT 1M MAXSIZE 1024M;<br />

Leave a Reply

Your email address will not be published. Required fields are marked *