ITPub博客

首页 > Linux操作系统 > Linux操作系统 > UNIX下RMAN复制数据库

UNIX下RMAN复制数据库

原创 Linux操作系统 作者:dear2170 时间:2009-07-09 10:37:58 0 删除 编辑

UNIX下RMAN复制数据库

数据库 9.2.0.6
操作系统 AIX 5304

原数据库:QHSIT[归档模式]  (找了个最小的数据库做测试,也80G:-( ,机器性能一般,所以比较慢,数据文件实在太多了,多余的地方就用…省略了)
目标数据库:QHTEST
色字体为输入命令
步骤

1:创建用户
原数据库操作系统用户为oraqhsit,在同一台主机上建立新用户,如qhtest,dba组。

2:配置新数据库软件
将原数据库的数据库软件拷贝到新路径下,之后修改env文件和init文件,将路径改为目标数据库路径,并保证新路径存在且有权限。将SID改为QHTEST,将TNS里的SID以及端口号都改为目标SID。
原数据库:
oraqhsit:/home/oraqhsit >echo $ORACLE_HOME
/datavg15/qhsit/qhsitdb/9.2.0
目标数据库:
qhtest:/home/qhtest >echo $ORACLE_HOME
/datavg45/qhbak/qhtestdb/9.2.0

3:配置原数据库TNS
原数据库的TNS里加入目标数据库的TNS,如:
oraqhsit:/datavg15/qhsit/qhsitdb/9.2.0/network/admin/QHSIT_misdev6 >cat tnsnames.ora
#
# $Header: ad8itns.ora 115.4 2004/04/01 12:57:26 rsanders ship $
#
# ###############################################################
#
# This file is automatically generated by AutoConfig.  It will be read and
# overwritten.  If you were instructed to edit this file, or if you are not
# able to use the settings created by AutoConfig, refer to Metalink document
# 165195.1 for assistance.
#
# ###############################################################

#

#
# Net8 definition for the database
#

QHSIT = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=MISDEV6)(PORT=11701))
                (CONNECT_DATA=(SID=QHSIT))
            )

QHTEST = (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=MISDEV6)(PORT=11501))
                (CONNECT_DATA=(SID=QHTEST))
            )
...

4:密码文件获取
在目标数据库执行
orapwd file=$ORACLE_HOME/dbs/orapw password=manager entries=30
执行后将目标数据库起到nomount状态
qhtest:/home/qhtest >sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Jul 8 19:36:11 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  766478528 bytes
Fixed Size                   743616 bytes
Variable Size             218103808 bytes
Database Buffers          536870912 bytes
Redo Buffers               10760192 bytes
SQL>

5:在原数据库尝试连接目标数据库
oraqhsit:/home/oraqhsit >rman target / auxiliary sys/manager@qhtest

Recovery Manager: Release 9.2.0.6.0 - 64bit Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: QHSIT (DBID=2864491865)
connected to auxiliary database: QHTEST (not mounted)

RMAN>
连接成功

6:配置RMAN
将原环境的RMAN备份路径配置为本地磁盘(至于带库、磁带等未测试)
RMAN> configure controlfile autobackup format for device type disk to '/datavg45/qhbak/rmanqhbak/%F';

using target database controlfile instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/datavg45/qhbak/rmanqhbak/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/datavg45/qhbak/rmanqhbak/%F';
new RMAN configuration parameters are successfully stored

RMAN> configure channel device type disk format '/datavg45/qhbak/rmanqhbak/db_%u';

old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/datavg45/qhbak/rmanqhbak/db_%u';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/datavg45/qhbak/rmanqhbak/db_%u';
new RMAN configuration parameters are successfully stored

7:备份原数据库
oraqhsit:/home/oraqhsit >rman target /

Recovery Manager: Release 9.2.0.6.0 - 64bit Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: QHSIT (DBID=2864491865)

RMAN> list backup;

using target database controlfile instead of recovery catalog

RMAN> run {
2> sql 'alter system switch logfile';
backup current controlfile;
backup3>  full database;
backup a4> rchivelog all;
}5> 6>

sql statement: alter system switch logfile

Starting backup at 08-JUL-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=46 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current controlfile in backupset
channel ORA_DISK_1: starting piece 1 at 08-JUL-09
channel ORA_DISK_1: finished piece 1 at 08-JUL-09
piece handle=/datavg45/qhbak/rmanqhbak/db_17kjlfgs comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-JUL-09

Starting backup at 08-JUL-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00289 name=/datavg15/qhsit/qhsitdata/applsysd02.dbf
input datafile fno=00352 name=/datavg15/qhsit/qhsitdata/system08.dbf
input datafile fno=00099 name=/datavg15/qhsit/qhsitdata/fad01.dbf



input datafile fno=00364 name=/datavg15/qhsit/qhsitdata/domx01.dbf
input datafile fno=00377 name=/datavg15/qhsit/qhsitdata/qrmd01.dbf
input datafile fno=00390 name=/datavg15/qhsit/qhsitdata/edrx01.dbf
input datafile fno=00409 name=/datavg15/qhsit/qhsitdata/xnbd01.dbf
channel ORA_DISK_1: starting piece 1 at 08-JUL-09
channel ORA_DISK_1: finished piece 1 at 08-JUL-09
piece handle=/datavg45/qhbak/rmanqhbak/db_1ekjlfu8 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
Finished backup at 08-JUL-09

Starting backup at 08-JUL-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=642 recid=17 stamp=691715425
input archive log thread=1 sequence=650 recid=18 stamp=691715431
input archive log thread=1 sequence=651 recid=19 stamp=691715611
input archive log thread=1 sequence=652 recid=20 stamp=691716107
channel ORA_DISK_1: starting piece 1 at 08-JUL-09
channel ORA_DISK_1: finished piece 1 at 08-JUL-09
piece handle=/datavg45/qhbak/rmanqhbak/db_1fkjlg0b comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 08-JUL-09

RMAN>

8:起目标数据库
将目标数据库起到nomount状态
qhtest:/home/qhtest >sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Jul 8 23:24:29 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  766478528 bytes
Fixed Size                   743616 bytes
Variable Size             218103808 bytes
Database Buffers          536870912 bytes
Redo Buffers               10760192 bytes

将目标数据库监听起来
qhtest:/home/qhtest >lsnrctl start qhtest

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 08-JUL-2009 23:24:19

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Starting /datavg45/qhbak/qhtestdb/9.2.0/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
Log messages written to /datavg45/qhbak/qhtestdb/9.2.0/network/admin/qhtest.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROCQHTEST)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=misdev6)(PORT=11501)))

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROCQHTEST))
STATUS of the LISTENER
------------------------
Alias                     qhtest
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
Start Date                08-JUL-2009 23:24:19
Uptime                    0 days 0 hr. 0 min. 2 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Log File         /datavg45/qhbak/qhtestdb/9.2.0/network/admin/qhtest.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROCQHTEST)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=misdev6)(PORT=11501)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "QHTEST" has 1 instance(s).
  Instance "QHTEST", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

9:查找原数据库数据文件信息
select file#,name from v$datafile;查出原数据库数据文件的文件号和对应名称
如:
FILE# NAME
1    /datavg15/qhsit/qhsitdata/system01.dbf
2    /datavg15/qhsit/qhsitdata/system02.dbf
3    /datavg15/qhsit/qhsitdata/system03.dbf
4    /datavg15/qhsit/qhsitdata/system04.dbf
5    /datavg15/qhsit/qhsitdata/system05.dbf
6    /datavg15/qhsit/qhsitdata/rbs01.dbf


之后将路径全部替换为目标数据库数据文件路径

FILE# NAME
1    /datavg45/qhbak/qhtestdata/system01.dbf
2    /datavg45/qhbak/qhtestdata/system02.dbf
3    /datavg45/qhbak/qhtestdata/system03.dbf
4    /datavg45/qhbak/qhtestdata/system04.dbf
5    /datavg45/qhbak/qhtestdata/system05.dbf
6    /datavg45/qhbak/qhtestdata/rbs01.dbf


再将每行都改成
set newname for datafile    1   to  '/datavg45/qhbak/qhtestdata/system01.dbf';
set newname for datafile    2   to  '/datavg45/qhbak/qhtestdata/system02.dbf';
set newname for datafile    3   to  '/datavg45/qhbak/qhtestdata/system03.dbf';
set newname for datafile    4   to  '/datavg45/qhbak/qhtestdata/system04.dbf';
set newname for datafile    5   to  '/datavg45/qhbak/qhtestdata/system05.dbf';
set newname for datafile    6   to  '/datavg45/qhbak/qhtestdata/rbs01.dbf';


改后保存,后面备用。

10Restore数据文件
从原数据库连接到目标数据库
oraqhsit:/home/oraqhsit >rman target / auxiliary sys/manager@qhtest

Recovery Manager: Release 9.2.0.6.0 - 64bit Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: QHSIT (DBID=2864491865)
connected to auxiliary database: QHTEST (not mounted)
RMAN>

之后恢复数据文件:
RMAN>run{
set newname for datafile    1   to  '/datavg45/qhbak/qhtestdata/system01.dbf';
set newname for datafile    2   to  '/datavg45/qhbak/qhtestdata/system02.dbf';
set newname for datafile    3   to  '/datavg45/qhbak/qhtestdata/system03.dbf';
set newname for datafile    4   to  '/datavg45/qhbak/qhtestdata/system04.dbf';



set newname for datafile    419 to  '/datavg45/qhbak/qhtestdata/interim.dbf';
set newname for datafile    420 to  '/datavg45/qhbak/qhtestdata/applsysd03.dbf';
set newname for datafile    421 to  '/datavg45/qhbak/qhtestdata/pstat01.dbf';
restore
check readonly
clone database
;
}
executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME




executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 08-JUL-09

using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to /datavg45/qhbak/qhtestdata/abmx01.dbf
restoring datafile 00029 to /datavg45/qhbak/qhtestdata/asod01.dbf
restoring datafile 00034 to /datavg45/qhbak/qhtestdata/axx01.dbf



restoring datafile 00391 to /datavg45/qhbak/qhtestdata/fpad01.dbf
restoring datafile 00401 to /datavg45/qhbak/qhtestdata/mstd01.dbf
restoring datafile 00409 to /datavg45/qhbak/qhtestdata/xnbd01.dbf
restoring datafile 00420 to /datavg45/qhbak/qhtestdata/applsysd03.dbf
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/datavg45/qhbak/rmanqhbak/db_1ekjlfu8 tag=TAG20090708T231333 params=NULL
channel ORA_AUX_DISK_1: restore complete
Finished restore at 08-JUL-09

11:创建controlfile
在原数据库里执行
SQL>alter database backup controlfile to trace;
将创建后的trc文件修改成目标数据库的控制文件,命名为trc.sql
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE SET DATABASE "QHTEST" RESETLOGS  NOARCHIVELOG
--  SET STANDBY TO MAXIMIZE PERFORMANCE
    MAXLOGFILES 16
    MAXLOGMEMBERS 5
    MAXDATAFILES 500
    MAXINSTANCES 1
    MAXLOGHISTORY 4537
LOGFILE
  GROUP 1 (
    '/datavg45/qhbak/qhtestdata/log01a.log',
    '/datavg45/qhbak/qhtestdata/log01b.log'
  ) SIZE 200M,
  GROUP 2 (
    '/datavg45/qhbak/qhtestdata/log02a.log',
    '/datavg45/qhbak/qhtestdata/log02b.log'
  ) SIZE 200M,
  GROUP 3 (
    '/datavg45/qhbak/qhtestdata/log03a.log',
    '/datavg45/qhbak/qhtestdata/log03b.log'
  ) SIZE 200M
-- STANDBY LOGFILE
DATAFILE
  '/datavg45/qhbak/qhtestdata/system01.dbf',
  '/datavg45/qhbak/qhtestdata/system02.dbf',
  '/datavg45/qhbak/qhtestdata/system03.dbf',
  '/datavg45/qhbak/qhtestdata/system04.dbf',
  '/datavg45/qhbak/qhtestdata/system05.dbf',
  '/datavg45/qhbak/qhtestdata/rbs01.dbf',
  
    …
    …
  '/datavg45/qhbak/qhtestdata/zxd01.dbf',
  '/datavg45/qhbak/qhtestdata/zxx01.dbf',
  '/datavg45/qhbak/qhtestdata/interim.dbf',
  '/datavg45/qhbak/qhtestdata/applsysd03.dbf',
  '/datavg45/qhbak/qhtestdata/pstat01.dbf'
CHARACTER SET ZHS16GBK
;
ALTER DATABASE OPEN RESETLOGS;

ALTER TABLESPACE TEMP ADD TEMPFILE '/datavg45/qhbak/qhtestdata/temp03.dbf'
     SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE '/datavg45/qhbak/qhtestdata/temp02.dbf'
     SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE '/datavg45/qhbak/qhtestdata/temp01.dbf'
     SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE '/datavg45/qhbak/qhtestdata/temp04.dbf'
     SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE '/datavg45/qhbak/qhtestdata/temp05.dbf'
     SIZE 2000M REUSE AUTOEXTEND OFF;

12:重建目标数据库
root:/ >su - qhtest
[YOU HAVE NEW MAIL]
qhtest:/home/qhtest >ls
sqlnet.log  trc.sql
qhtest:/home/qhtest >sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Jul 8 23:52:57 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> @trc.sql
ORACLE instance started.

Total System Global Area  766478528 bytes
Fixed Size                   743616 bytes
Variable Size             218103808 bytes
Database Buffers          536870912 bytes
Redo Buffers               10760192 bytes

Control file created.

ORA-00279: change 9165762873357 generated at 07/08/2009 23:13:34 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_652.dbf
ORA-00280: change 9165762873357 for thread 1 is in sequence #652


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00279: change 9165762886276 generated at 07/08/2009 23:21:46 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_653.dbf
ORA-00280: change 9165762886276 for thread 1 is in sequence #653
ORA-00278: log file '/arch/qhprd/arch/1_652.dbf' no longer needed for this
recovery


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log '/arch/qhprd/arch/1_653.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3

需要recover
SQL> shutdown abort
ORACLE instance shut down.
SQL> @trc.sql
ORACLE instance started.

Total System Global Area  766478528 bytes
Fixed Size                   743616 bytes
Variable Size             218103808 bytes
Database Buffers          536870912 bytes
Redo Buffers               10760192 bytes

Control file created.

ORA-00279: change 9165762886276 generated at 07/08/2009 23:21:46 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_653.dbf
ORA-00280: change 9165762886276 for thread 1 is in sequence #653


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00279: change 9165762964600 generated at 07/08/2009 23:56:21 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_654.dbf
ORA-00280: change 9165762964600 for thread 1 is in sequence #654
ORA-00278: log file '/arch/qhprd/arch/1_653.dbf' no longer needed for this
recovery


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'ALTER'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log 'SIZE'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00279: change 9165762967781 generated at 07/08/2009 23:56:31 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_655.dbf
ORA-00280: change 9165762967781 for thread 1 is in sequence #655
ORA-00278: log file '/arch/qhprd/arch/1_654.dbf' no longer needed for this
recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/arch/qhprd/arch/1_654.dbf
ORA-00310: archived log contains sequence 654; sequence 655 required
ORA-00334: archived log: '/arch/qhprd/arch/1_654.dbf'

对数据库进行recover
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

提示需要用control filerecover,再次recover
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 9165762967781 generated at 07/08/2009 23:56:31 needed for
thread 1
ORA-00289: suggestion : /arch/qhprd/arch/1_655.dbf
ORA-00280: change 9165762967781 for thread 1 is in sequence #655


Specify log: {=suggested | filename | AUTO | CANCEL}
/arch/qhprd/arch/1_654.dbf
ORA-00310: archived log contains sequence 654; sequence 655 required
ORA-00334: archived log: '/arch/qhprd/arch/1_654.dbf'

SQL> alter database open resetlogs;

Database altered.

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

Total System Global Area  766478528 bytes
Fixed Size                   743616 bytes
Variable Size             218103808 bytes
Database Buffers          536870912 bytes
Redo Buffers               10760192 bytes
Database mounted.
Database opened.


至此,数据库恢复完成,登陆检查数据

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

上一篇: RMAN恢复一例
请登录后发表评论 登录
全部评论

注册时间:2008-11-29

  • 博文量
    20
  • 访问量
    41579