• 博客访问: 6437253
  • 博文数量: 902
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-11 14:32
  • 认证徽章:
个人简介

oracle 10g ocm oracle 10g/11g/12c ocp aix 6.1 administrator,ogg expert,ITSS 技术交流群 201703254 微信公众号 paulyibin 探讨技术,开心工作 电话 13719354869 ,深入研究数据库和开始研究big data

文章分类

全部博文(902)

文章存档

2016年(23)

2015年(32)

2014年(41)

2013年(29)

2012年(25)

2011年(83)

2010年(220)

2009年(136)

2008年(248)

2007年(65)

分类: Linux操作系统

2008-04-21 10:36:54

sql>shutdown immediate;

冷备数据库所有数据文件

SQL> startup
ORACLE instance started.

Total System Global Area  101785252 bytes
Fixed Size                   454308 bytes
Variable Size              75497472 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> select * from test;

         A
----------
         1
         2
         3
         4

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\oracle\ora92\RDBMS
Oldest online log sequence     0
Next log sequence to archive   1
Current log sequence           1
SQL> alter system switch logfile;

System altered.

SQL> insert into test values(5);

1 row created.

SQL> commit;

Commit complete.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\oracle\ora92\RDBMS
Oldest online log sequence     1
Next log sequence to archive   3
Current log sequence           3
SQL> insert into test values(6);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test;

         A
----------
         1
         2
         3
         4
         5
         6

6 rows selected.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\oracle\ora92\RDBMS
Oldest online log sequence     2
Next log sequence to archive   4
Current log sequence           4
SQL> select * from test;

         A
----------
         1
         2
         3
         4
         5
         6

6 rows selected.

SQL> insert into test values(7);      --7这个值用到的日志序列为4

1 row created.

SQL> commit;

Commit complete.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\oracle\ora92\RDBMS
Oldest online log sequence     3
Next log sequence to archive   5
Current log sequence           5
SQL> insert into test values(8);   --8这个值用到的日志序列为5

1 row created.

SQL> commit;

Commit complete.

SQL> alter system switch logfile;     

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

恢复所有冷备的数据文件
SQL> startup mount;
ORACLE instance started.

Total System Global Area  101785252 bytes
Fixed Size                   454308 bytes
Variable Size              75497472 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.

做不完全恢复到日志序列为4
SQL> recover database until cancel;
ORA-00279: change 270609 generated at 04/21/2008 10:22:02 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORA92\RDBMS\ARC00001.001
ORA-00280: change 270609 for thread 1 is in sequence #1


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\oracle\ora92\rdbms\ARC00001.001
ORA-00279: change 270822 generated at 04/21/2008 10:28:29 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORA92\RDBMS\ARC00002.001
ORA-00280: change 270822 for thread 1 is in sequence #2
ORA-00278: log file 'D:\oracle\ora92\rdbms\ARC00001.001' no longer needed for
this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\oracle\ora92\rdbms\ARC00002.001
ORA-00279: change 270856 generated at 04/21/2008 10:30:06 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORA92\RDBMS\ARC00003.001
ORA-00280: change 270856 for thread 1 is in sequence #3
ORA-00278: log file 'D:\oracle\ora92\rdbms\ARC00002.001' no longer needed for
this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\oracle\ora92\rdbms\ARC00003.001
ORA-00279: change 270869 generated at 04/21/2008 10:30:37 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORA92\RDBMS\ARC00004.001
ORA-00280: change 270869 for thread 1 is in sequence #4
ORA-00278: log file 'D:\oracle\ora92\rdbms\ARC00003.001' no longer needed for
this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\oracle\ora92\rdbms\ARC00004.001
ORA-00279: change 270918 generated at 04/21/2008 10:33:01 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORA92\RDBMS\ARC00005.001
ORA-00280: change 270918 for thread 1 is in sequence #5
ORA-00278: log file 'D:\oracle\ora92\rdbms\ARC00004.001' no longer needed for
this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel                                  --ARC00005.001 这个撤消不恢复了
Media recovery cancelled.
SQL> alter database open resetlogs;

Database altered.

SQL> select * from test;

         A
----------
         1
         2
         3
         4
         5
         6
         7

7 rows selected. 

SQL>

看结果只恢复到日志序列4对应的test表数据为7

阅读(2515) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~

xxwang19842008-09-10 18:10:01

谢谢

paulyibinyi2008-09-10 14:00:22

原帖由xxwang1984于2008-09-10 09:43:06发表 你好,我最近在学习有关oracle备份和还原,上面"做不完全恢复到日志序列为4"这一步是怎么做的,可
这是自己手工控制的 输入recover database until cancel 命令后 可以自己输入归档日志序列号

xxwang19842008-09-10 09:43:06

你好,我最近在学习有关oracle备份和还原,上面"做不完全恢复到日志序列为4"这一步是怎么做的,可否说详细的?!谢谢.

评论热议
请登录后评论。

登录 注册