Offlining a datafile

When one offline a datafile before you online the datafile one has to recover the datafile

1) Offline a datafile
SQL> alter database datafile 5 offline;

Database altered.

— Shows datafile is in recover state
SQL> select status from v$datafile where file# = 5;

STATUS
——-
RECOVER

— datafile can’t be made online
SQL> alter database datafile 5 online;
alter database datafile 5 online
*
ERROR at line 1:
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: ‘/u01/oradata/TEST/testtbs_01.dbf’

— recover datafile
SQL> recover datafile ‘/u01/oradata/TEST/testtbs_01.dbf’;
Media recovery complete.
SQL> alter database datafile 5 online;

Database altered.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s