Chinaunix首页 | 论坛 | 博客
  • 博客访问: 65209
  • 博文数量: 22
  • 博客积分: 935
  • 博客等级: 准尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-30 11:05
文章分类

全部博文(22)

文章存档

2008年(22)

我的朋友

分类: Oracle

2008-05-16 16:28:58

(21) 将表空间设置为备份状态, 然后向其中的表内插入数据


SQL> alter tablespace users begin backup;

Tablespace altered.

SQL> insert into test2 values(100,'100');

1 row created.

SQL> select * from test2;

        ID NAME

---------- ----------

         1 sss

         3 333

         1 222

       100 100

         4 1111




(22) 使用abort方式关闭数据库, 100这条记录又没有了啊

SQL> shutdown abort;

ORACLE instance shut down.


(23) 备份redo日志后, 删掉所有的redo日志


[oracle@oracle-svr 10.2.0]$ cd oradata/

[oracle@oracle-svr oradata]$ cd demo1

[oracle@oracle-svr demo1]$ ls

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

[oracle@oracle-svr demo1]$ cp redo0*.log ../arclog/

[oracle@oracle-svr demo1]$ ls

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

[oracle@oracle-svr demo1]$ rm redo*.log

[oracle@oracle-svr oradata]$ cd demo1/

[oracle@oracle-svr demo1]$ ls

control01.ctl  example01.dbf  temp01.dbf   testtb2.dbf    users01.dbf

control02.ctl  sysaux01.dbf   testdb2.dbf  testtb.dbf

control03.ctl  system01.dbf   testtb1.dbf  undotbs01.dbf


(24) 启动数据库, 提示需要介质恢复


[oracle@oracle-svr bin]$ ./sqlplus /nolog;

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 22 13:50:43 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn sys/a as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             113247824 bytes

Database Buffers          167772160 bytes

Redo Buffers                2973696 bytes

Database mounted.

ORA-01113: file 4 needs media recovery

ORA-01110: data file 4:

'/u01/app/oracle/product/10.2.0/oradata/demo1/users01.dbf'


(25) 将备份的redo文件恢复, 启动数据库, 通过redo文件恢复. 100这条记录果真没有了.


[oracle@oracle-svr oradata]$ cd demo1/

[oracle@oracle-svr demo1]$ ls

control01.ctl  example01.dbf  temp01.dbf   testtb2.dbf    users01.dbf

control02.ctl  sysaux01.dbf   testdb2.dbf  testtb.dbf

control03.ctl  system01.dbf   testtb1.dbf  undotbs01.dbf

[oracle@oracle-svr demo1]$ cd ..

[oracle@oracle-svr oradata]$ cd arclog/

[oracle@oracle-svr arclog]$ ls

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

[oracle@oracle-svr arclog]$ cp redo*.log ../demo1/

[oracle@oracle-svr arclog]$ ls

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

SQL> recover database

Media recovery complete.

SQL> alter database open;

Database altered.

SQL> select * from test2

  2  ;

        ID NAME

---------- ----------

         1 sss

         3 333

         1 222

         4 1111


(26) 先end backup表空间. 正常关闭数据库


SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.


(27) 将redo文件移动到备份目录


[oracle@oracle-svr demo1]$ mv redo*.log ../arclog/

[oracle@oracle-svr demo1]$ ls

control01.ctl  example01.dbf  temp01.dbf   testtb2.dbf    users01.dbf

control02.ctl  sysaux01.dbf   testdb2.dbf  testtb.dbf

control03.ctl  system01.dbf   testtb1.dbf  undotbs01.dbf

[oracle@oracle-svr demo1]$ ls ../arclog/

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

[oracle@oracle-svr demo1]$ ls

control01.ctl  example01.dbf  temp01.dbf   testtb2.dbf    users01.dbf

control02.ctl  sysaux01.dbf   testdb2.dbf  testtb.dbf

control03.ctl  system01.dbf   testtb1.dbf  undotbs01.dbf


(28) 启动数据库, 提示redo日志打开错误


SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             113247824 bytes

Database Buffers          167772160 bytes

Redo Buffers                2973696 bytes

Database mounted.

ORA-00313: open failed for members of log group 1 of thread 1

ORA-00312: online log 1 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo01.log'




(29) 通过归档日志恢复后, 错误的使用了noresetlogs打开数据库, 没有成功.


SQL> recover database until cancel

Media recovery complete.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open NORESETLOGS;

alter database open NORESETLOGS

*

ERROR at line 1:

ORA-00313: open failed for members of log group 1 of thread 1

ORA-00312: online log 1 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo01.log'




(30) 恢复redo日志


[oracle@oracle-svr arclog]$ ls

control01.ctl  redo01.log    system01.dbf  testtb2.dbf

control02.ctl  redo02.log    temp01.dbf    testtb.dbf

control03.ctl  redo03.log    testdb2.dbf   undotbs01.dbf

example01.dbf  sysaux01.dbf  testtb1.dbf   users01.dbf

[oracle@oracle-svr arclog]$ cp * ../demo1/

[oracle@oracle-svr arclog]$




(31) 重新启动数据库后, 使用归档日志恢复


SQL> conn sys/1 as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             113247824 bytes

Database Buffers          167772160 bytes

Redo Buffers                2973696 bytes

Database mounted.

ORA-00314: log 1 of thread 1, expected sequence#  doesn't match

ORA-00312: online log 1 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo01.log'

SQL> recover database until cancel;

Media recovery complete.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


(32) 通过resetlogs参数打开了数据库, 不过丢了部分的数据.


SQL> alter database open RESETLOGS;

Database altered.

SQL> select * from test2;

        ID NAME

---------- ----------

         1 sss

         3 333

SQL> insert into test2 values (99,'9999');

1 row created.

SQL> select * from test2;

        ID NAME

---------- ----------

         1 sss

         3 333

        99 9999

SQL>alter system switch logfile

SQL>alter system switch logfile

SQL>alter system switch logfile

SQL>alter system switch logfile


(33) 再次正常关闭数据库, 并将redo文件移动到备份目录, 再次启动数据库.


SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

[oracle@oracle-svr demo1]$ mv redo*.log ../arclog/

[oracle@oracle-svr demo1]$ ls

control01.ctl  example01.dbf  temp01.dbf   testtb2.dbf    users01.dbf

control02.ctl  sysaux01.dbf   testdb2.dbf  testtb.dbf

control03.ctl  system01.dbf   testtb1.dbf  undotbs01.dbf

SQL> startup;

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             117442128 bytes

Database Buffers          163577856 bytes

Redo Buffers                2973696 bytes

Database mounted.

ORA-00313: open failed for members of log group 1 of thread 1

ORA-00312: online log 1 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo01.log'


(34) 在前面作了4次switch log file, 因此数据已经完全写入到数据文件中, 所以此时无论通过归档日志还是redo日志, 都没有实际的恢复动作

因为resetlog, 所以redo文件被重置了. 但是数据并没有丢失.


SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-00264: no recovery required

SQL> recover database until cancel;

Media recovery complete.

SQL>  alter database open resetlogs;

Database altered.

SQL> select * from test2;

        ID NAME

---------- ----------

         1 sss

         3 333

        99 9999


 


(35)  RMAN备份数据库, 将所有的数据文件放在piece1备份文件中.

将SPFIL和control file放在piece2备份文件中.


[oracle@oracle-svr demo1]$./rman target sys/password

RMAN> run {

2>  allocate channel c1 type disk;

3>  backup database;

4>  release  channel c1;

5> }

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: sid=142 devtype=DISK

Starting backup at 22-AUG-07

channel c1: starting full datafile backupset

channel c1: specifying datafile(s) in backupset

input datafile fno=00001 name=/u01/app/oracle/product/10.2.0/oradata/demo1/system01.dbf

input datafile fno=00003 name=/u01/app/oracle/product/10.2.0/oradata/demo1/sysaux01.dbf

input datafile fno=00005 name=/u01/app/oracle/product/10.2.0/oradata/demo1/example01.dbf

input datafile fno=00002 name=/u01/app/oracle/product/10.2.0/oradata/demo1/undotbs01.dbf

input datafile fno=00006 name=/u01/app/oracle/product/10.2.0/oradata/demo1/testtb.dbf

input datafile fno=00004 name=/u01/app/oracle/product/10.2.0/oradata/demo1/users01.dbf

channel c1: starting piece 1 at 22-AUG-07

channel c1: finished piece 1 at 22-AUG-07

piece handle=/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/backupset/2007_08_22/o1_mf_nnndf_TAG20070822T150429_3dqqzxof_.bkp tag=TAG20070822T150429 comment=NONE

channel c1: backup set complete, elapsed time: 00:01:15

channel c1: starting full datafile backupset

channel c1: specifying datafile(s) in backupset

including current control file in backupset

including current SPFILE in backupset

channel c1: starting piece 1 at 22-AUG-07

channel c1: finished piece 1 at 22-AUG-07

piece handle=/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/backupset/2007_08_22/o1_mf_ncsnf_TAG20070822T150429_3dqr2br7_.bkp tag=TAG20070822T150429 comment=NONE

channel c1: backup set complete, elapsed time: 00:00:03

Finished backup at 22-AUG-07

released channel: c1


(36) 删除所有的数据库文件, 但是保留控制文件, 然后将数据库mount上, 此时无法open


SQL> startup mount

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             125830736 bytes

Database Buffers          155189248 bytes

Redo Buffers                2973696 bytes

Database mounted.


(37) 恢复数据库. 注意这次恢复的不是利用上面的那次备份. 中间我又备份了一次(两个channel同时,分别写到硬盘的不同位置), 但是没有记录.

注意1,4,6在一个backupset中, 2, 3, 5在另外一个backupset中


RMAN> run {

2>  allocate channel c1 type disk;

3>  restore b database;

4>  release  channel c1;

5> }

using target database control file instead of recovery catalog

allocated channel: c2

channel c2: sid=155 devtype=DISK

Starting restore at 22-AUG-07

channel c2: starting datafile backupset restore

channel c2: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /u01/app/oracle/product/10.2.0/oradata/demo1/system01.dbf

restoring datafile 00004 to /u01/app/oracle/product/10.2.0/oradata/demo1/users01.dbf

restoring datafile 00006 to /u01/app/oracle/product/10.2.0/oradata/demo1/testtb.dbf

channel c2: reading from backup piece /home/oracle/u01/10iq1ic3_1_1.log

channel c2: restored backup piece 1

piece handle=/home/oracle/u01/10iq1ic3_1_1.log tag=TAG20070822T153219

channel c2: restore complete, elapsed time: 00:00:37

channel c2: starting datafile backupset restore

channel c2: specifying datafile(s) to restore from backup set

restoring datafile 00002 to /u01/app/oracle/product/10.2.0/oradata/demo1/undotbs01.dbf

restoring datafile 00003 to /u01/app/oracle/product/10.2.0/oradata/demo1/sysaux01.dbf

restoring datafile 00005 to /u01/app/oracle/product/10.2.0/oradata/demo1/example01.dbf

channel c2: reading from backup piece /home/oracle/u02/11iq1ic3_1_1.log

channel c2: restored backup piece 1

piece handle=/home/oracle/u02/11iq1ic3_1_1.log tag=TAG20070822T153219

channel c2: restore complete, elapsed time: 00:00:25

Finished restore at 22-AUG-07

released channel: c2

RMAN> exit


(38) 恢复完成后, 检查scn的4个参数. 发现v$datafile_header和v$datafile中的不同, 这是因为控制文件是最新的, 但是恢复的数据库文件稍微旧一些.


SQL> select  FILE#, CHECKPOINT_CHANGE#,LAST_CHANGE# from v$datafile;

     FILE# CHECKPOINT_CHANGE# LAST_CHANGE#

---------- ------------------ ------------

         1             657172       657172

         2             657172       657172

         3             657172       657172

         4             657172       657172

         5             657172       657172

         6             657172       657172

6 rows selected.

SQL> select NAME ,CHECKPOINT_CHANGE# from v$database;

NAME               CHECKPOINT_CHANGE#

------------------ ------------------

DEMO1                          657172

SQL> select FILE#,CHECKPOINT_CHANGE#  from v$datafile_header;

     FILE# CHECKPOINT_CHANGE#

---------- ------------------

         1             656843

         2                  0

         3                  0

         4             656843

         5                  0

         6             656843

6 rows selected.


(39) 通过归档日志恢复(其实不用做这一步, 看下面什么也没有做成)


SQL> recover database until cancel

ORA-00279: change 656843 generated at 08/22/2007 15:32:19 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_0

_22/o1_mf_1_2_%u_.arc

ORA-00280: change 656843 for thread 1 is in sequence #2

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

ORA-00308: cannot open archived log

'/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_

8_22/o1_mf_1_2_%u_.arc'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

ORA-00308: cannot open archived log

'/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_

8_22/o1_mf_1_2_%u_.arc'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3


(40) 直接打开数据库出错, 因为redo文件被删掉了. resetlogs方式可以打开数据库, 数据没有丢失.

不能确认使用rman的数据库备份, 在恢复时是否一定不需要redo文件


SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;

Database altered.

SQL> select * from test2;

        ID NAME

---------- ----------

         1 sss

         3 333

        99 9999

SQL> select * from test1;

        ID NAME

---------- --------------------

         1 aaa

        10 100

        20 2020

         1 111

         1 ..


(41) 再次删除所有的数据库文件和redo文件, 但是保留控制文件. 然后通过备份恢复(此次是使用同一个piece文件恢复所有的数据库)


RMAN>   run {

2>  allocate channel c2 type disk;

3>  restore database;

4>  release channel c2;

5> }

using target database control file instead of recovery catalog

allocated channel: c2

channel c2: sid=155 devtype=DISK

Starting restore at 22-AUG-07

channel c2: starting datafile backupset restore

channel c2: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /u01/app/oracle/product/10.2.0/oradata/demo1/system01.dbf

restoring datafile 00004 to /u01/app/oracle/product/10.2.0/oradata/demo1/users01.dbf

restoring datafile 00006 to /u01/app/oracle/product/10.2.0/oradata/demo1/testtb.dbf

channel c2: reading from backup piece /home/oracle/u01/10iq1ic3_1_1.log

ORA-19870: error reading backup piece /home/oracle/u01/10iq1ic3_1_1.log

ORA-19505: failed to identify file "/home/oracle/u01/10iq1ic3_1_1.log"

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

channel c2: starting datafile backupset restore

channel c2: specifying datafile(s) to restore from backup set

restoring datafile 00002 to /u01/app/oracle/product/10.2.0/oradata/demo1/undotbs01.dbf

restoring datafile 00003 to /u01/app/oracle/product/10.2.0/oradata/demo1/sysaux01.dbf

restoring datafile 00005 to /u01/app/oracle/product/10.2.0/oradata/demo1/example01.dbf

channel c2: reading from backup piece /home/oracle/u02/11iq1ic3_1_1.log

ORA-19870: error reading backup piece /home/oracle/u02/11iq1ic3_1_1.log

ORA-19505: failed to identify file "/home/oracle/u02/11iq1ic3_1_1.log"

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

failover to previous backup

channel c2: starting datafile backupset restore

channel c2: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /u01/app/oracle/product/10.2.0/oradata/demo1/system01.dbf

restoring datafile 00002 to /u01/app/oracle/product/10.2.0/oradata/demo1/undotbs01.dbf

restoring datafile 00003 to /u01/app/oracle/product/10.2.0/oradata/demo1/sysaux01.dbf

restoring datafile 00004 to /u01/app/oracle/product/10.2.0/oradata/demo1/users01.dbf

restoring datafile 00005 to /u01/app/oracle/product/10.2.0/oradata/demo1/example01.dbf

restoring datafile 00006 to /u01/app/oracle/product/10.2.0/oradata/demo1/testtb.dbf

channel c2: reading from backup piece /u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/backupset/2007_08_22/o1_mf_nnndf_TAG20070822T152827_3dqsdvxo_.bkp

channel c2: restored backup piece 1

piece handle=/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/backupset/2007_08_22/o1_mf_nnndf_TAG20070822T152827_3dqsdvxo_.bkp tag=TAG20070822T152827

channel c2: restore complete, elapsed time: 00:00:56

Finished restore at 22-AUG-07

released channel: c2

RMAN> exit

[oracle@oracle-svr bin]$ ls ../../oradata/demo1/

control01.ctl  control03.ctl  sysaux01.dbf  testtb.dbf     users01.dbf

control02.ctl  example01.dbf  system01.dbf  undotbs01.dbf


(42) 启动数据库到mount状态


[oracle@oracle-svr bin]$ ./sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 22 16:02:05 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn sys/1 as sysdba

Connected.

SQL> startup mount

ORA-01081: cannot start already-running ORACLE - shut it down first

SQL> shutdown abort

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size             130025040 bytes

Database Buffers          150994944 bytes

Redo Buffers                2973696 bytes

Database mounted.

SQL> select  FILE#, CHECKPOINT_CHANGE#,LAST_CHANGE# from v$datafile;

     FILE# CHECKPOINT_CHANGE# LAST_CHANGE#

---------- ------------------ ------------

         1             657172       657172

         2             657172       657172

         3             657172       657172

         4             657172       657172

         5             657172       657172

         6             657172       657172

6 rows selected.

SQL> select NAME ,CHECKPOINT_CHANGE# from v$database;

NAME               CHECKPOINT_CHANGE#

------------------ ------------------

DEMO1                          657172

SQL> select FILE#,CHECKPOINT_CHANGE#  from v$datafile_header;

     FILE# CHECKPOINT_CHANGE#

---------- ------------------

         1             656716

         2             656716

         3             656716

         4             656716

         5             656716

         6             656716

6 rows selected.


(43) 再次进行不必要的通过归档日志的恢复.


SQL> recover database until cancel

ORA-00279: change 656716 generated at 08/22/2007 15:28:27 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_08

_22/o1_mf_1_2_%u_.arc

ORA-00280: change 656716 for thread 1 is in sequence #2

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log

'/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_0

8_22/o1_mf_1_2_%u_.arc'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3


(44) 不用resetlogs参数无法打开数据库. 使用resetlogs可以打开数据库


SQL> alter database open

  2  ;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> recover database

ORA-00283: recovery session canceled due to errors

ORA-00313: open failed for members of log group 2 of thread 1

ORA-00312: online log 2 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo02.log'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

SQL> recover

ORA-00283: recovery session canceled due to errors

ORA-00313: open failed for members of log group 2 of thread 1

ORA-00312: online log 2 thread 1:

'/u01/app/oracle/product/10.2.0/oradata/demo1/redo02.log'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

[oracle@oracle-svr bin]$ ls ../../oradata/demo1/

control01.ctl  control03.ctl  sysaux01.dbf  testtb.dbf     users01.dbf

control02.ctl  example01.dbf  system01.dbf  undotbs01.dbf

[oracle@oracle-svr bin]$ ./sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 22 16:04:36 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn sys/1 as sysdba

Connected.

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01139: RESETLOGS option only valid after an incomplete database recovery

SQL> recover database until cancel

ORA-00279: change 656716 generated at 08/22/2007 15:28:27 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_08

_22/o1_mf_1_2_%u_.arc

ORA-00280: change 656716 for thread 1 is in sequence #2

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log

'/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/DEMO1/archivelog/2007_0

8_22/o1_mf_1_2_%u_.arc'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

SQL> alter database open resetlogs;

Database altered.


我想下面测试rman的数据库全备份是不是完全部依赖于redo日志和归档日志

我觉得需要归档,但是redo日志可能不用。

确认的方法:备份的数据库文件是否是一致的

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