Alter datafile online or offline in Oracle

Check the status of online or offline for datafile in Oracle

Check the status of datafile

Select file#, status from v$datafile;
OR
SELECT FILE_NAME,ONLINE_STATUS FROM DBA_DATA_FILES;

Take the data file to offline state

alter database datafile 'C:\oradata\orcl\sales001.dbf' offline;
OR
Alter database datafile 12 OFFLINE;

Take the datafile to online state

alter database datafile 'C:\oradata\orcl\sales001.dbf' oNLINE;
OR
Alter database datafile 12 online;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.