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;

Related posts

How to deal with ORA-00020: maximum number of processes (%s) exceeded

How to resolve ORA-01111 ORA-01110 ORA-01157 in a physical standby database 

Công cụ tự động khai báo datafile – Oracle