ITPub博客

首页 > 数据库 > Oracle > 备份与恢复--nologging表无法恢复

备份与恢复--nologging表无法恢复

原创 Oracle 作者:jolly10 时间:2009-01-21 12:15:47 0 删除 编辑
对于采用NOLOGGING方式创建的表,由于系统不产生重做日志,因此即使Oracle处于归档模式下也无法恢复表中的数据。[@more@]

SQL> create table jglu.test_recover
2 tablespace test
3 as
4 select * from dba_tables;

Table created.

SQL> alter tablespace test offline;

Tablespace altered.

SQL> host cp /u01/backup/test02.dbf /u01/app/oracle/oradata/orcl

SQL> recover tablespace test;
Media recovery complete.
SQL> alter tablespace test online;

Tablespace altered.

SQL> select count(*) from jglu.test_recover;

COUNT(*)
----------
1582


对于普通的CTAS操作建立的表,数据是可以进行恢复的。


下面看看nologging的表


SQL> create table test_unrecover nologging
2 tablespace test
3 as
4 select * from dba_tables;

Table created.

SQL> alter tablespace test offline;

Tablespace altered.

SQL> host cp /u01/backup/test02.dbf /u01/app/oracle/oradata/orcl

SQL> recover tablespace test;
Media recovery complete.

SQL> alter tablespace test online;

Tablespace altered.

SQL> select count(*) from jglu.test_unrecover;
select count(*) from jglu.test_unrecover
*
ERROR at line 1:
ORA-00942: table or view does not exist


通过CREATE AS SELECT NOLOGGING方式建立的数据表不会产生日志,因此恢复操作不会恢复表中的数据,而且恢复操作也不会报错。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271283/viewspace-1016357/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-20

  • 博文量
    263
  • 访问量
    826724