Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

difference between offline and offile immediate.

poornaMay 12 2010 — edited May 12 2010
Hi,

Operating System:10.2.0.3
Operating system:Linunx

Can any one please tell me what will happen if we do tablespace offline immediate .Here it is asking for media recovery while bringing it online.Why?

But in tablespace offline.Here it is not asking any recovery while bringing it online.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u03/kk_clon/oradata/system01.dbf
/u03/kk_clon/oradata/undotbs01.dbf
/u03/kk_clon/oradata/sysaux01.dbf
/u03/kk_clon/users01.dbf
/u03/kk_clon/oradata/tt.dbf

SQL> alter tablespace tt offline immediate;

Tablespace altered.

SQL> !cp /u03/kk_clon/oradata/tt.dbf /u03/kk_clon/

SQL> alter tablespace tt rename datafile '/u03/kk_clon/oradata/tt.dbf' to '/u03/kk_clon/tt.dbf';

Tablespace altered.

SQL> alter tablespace tt online;
alter tablespace tt online
*
ERROR at line 1:
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/u03/kk_clon/tt.dbf'


SQL> recover tablesapce tt;
ORA-00905: missing keyword


SQL> recover datafile 5;
Media recovery complete.
SQL> alter tablespace tt offline;
alter tablespace tt offline
*
ERROR at line 1:
ORA-01539: tablespace 'TT' is not online


SQL> alter tablespace tt online;

Tablespace altered.

SQL> alter tablespace users online;

Tablespace altered.

SQL> alter tablespace tt offline;

Tablespace altered.

SQL> !cp /u03/kk_clon/tt.dbf /u03/kk_clon/oradata/

SQL> alter tablespace tt rename datafile '/u03/kk_clon/tt.dbf' to '/u03/kk_clon/oradata/tt.dbf';

Tablespace altered.

SQL> alter tablespace tt online;

Tablespace altered.
Please explain me.

Thanks & Regards,
Poorna Prasad.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2010
Added on May 12 2010
8 comments
2,513 views