Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1114676
  • 博文数量: 227
  • 博客积分: 6860
  • 博客等级: 准将
  • 技术积分: 2688
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-02 16:06
文章分类

全部博文(227)

文章存档

2015年(7)

2014年(8)

2012年(5)

2011年(62)

2010年(145)

分类: Oracle

2011-01-14 15:24:21

RMAN> shutdown immediate

database dismounted
Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     285212672 bytes

Fixed Size                     1218968 bytes
Variable Size                 83887720 bytes
Database Buffers             192937984 bytes
Redo Buffers                   7168000 bytes

RMAN> restore database;

Starting restore at 06-JAN-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISK

datafile 9 not processed because file is offline
skipping datafile 1; already restored to file /oracle/product/10.2.0/oradata/orcl/system01.dbf
skipping datafile 2; already restored to file /oracle/product/10.2.0/oradata/orcl/undotbs01.dbf
skipping datafile 4; already restored to file /oracle/product/10.2.0/oradata/orcl/users01.dbf
skipping datafile 5; already restored to file /oracle/product/10.2.0/oradata/orcl/example01.dbf
skipping datafile 8; already restored to file /oracle/product/10.2.0/oradata/orcl/user01.dbf
skipping datafile 3; already restored to file /oracle/product/10.2.0/oradata/orcl/sysaux01.dbf
skipping datafile 6; already restored to file /oracle/product/10.2.0/oradata/orcl/tzjh01.dbf
skipping datafile 7; already restored to file /oracle/product/10.2.0/oradata/orcl/bid01.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 06-JAN-11

RMAN> recover database;

Starting recover at 06-JAN-11
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/06/2011 15:12:17
RMAN-06094: datafile 9 must be restored

同时我用sqlplus是这状态
[oracle@server bdump]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 6 15:12:47 2011

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS
------------
MOUNTED

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;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oracle/product/10.2.0/oradata/orcl/system01.dbf'

RMAN> restore datafile 9;

Starting restore at 06-JAN-11
using channel ORA_DISK_1

creating datafile fno=9 name=/oracle/product/10.2.0/oradata/orcl/user02.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/06/2011 15:14:59
ORA-01178: file 9 created before last CREATE CONTROLFILE, cannot recreate
ORA-01110: data file 9: '/oracle/product/10.2.0/oradata/orcl/user02.dbf'

解决办法:
控制文件重建
SQL>startup nomount;
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG
  2  MAXLOGFILES 16
  3  MAXLOGMEMBERS 3
  4  MAXDATAFILES 100
  5  MAXINSTANCES 8
  6  MAXLOGHISTORY 292
  7  LOGFILE
  8  GROUP 1 '/oracle/product/10.2.0/oradata/orcl/redo01.log'  SIZE 50M,
  9  GROUP 2 '/oracle/product/10.2.0/oradata/orcl/redo02.log'  SIZE 50M,
10  GROUP 3 '/oracle/product/10.2.0/oradata/orcl/redo03.log'  SIZE 50M
11  DATAFILE
12  '/oracle/product/10.2.0/oradata/orcl/system01.dbf',
13  '/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf',
14  '/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf',
15  '/oracle/product/10.2.0/oradata/orcl/users01.dbf',
16  '/oracle/product/10.2.0/oradata/orcl/example01.dbf',
17  '/oracle/product/10.2.0/oradata/orcl/tzjh01.dbf',
18  '/oracle/product/10.2.0/oradata/orcl/bid01.dbf',
19  '/oracle/product/10.2.0/oradata/orcl/user01.dbf',
20  '/oracle/product/10.2.0/oradata/orcl/user02.dbf',
21  CHARACTER SET ZHS16GBK
22  ;

重建控制文件后
SQL>recover database using backup controlfile;
  pecify log: {=suggested | filename | AUTO | CANCEL}
  auto
执行完毕后
SQL>shutdown immediate;
SQL>startup;
SQL>alter database open resetlogs;
成功!!
具体也可参照我的帖子:
http://www.itpub.net/thread-1388122-1-1.html
阅读(907) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~