Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

3

积分

0

好友

2

主题
1#
发表于 2012-7-17 17:29:58 | 查看: 6157| 回复: 4
1:数据库全备,包括控制文件后,新建了一个表空间。2:控制文件丢失,用旧的控制文件来启动,操作如下:
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production



SQL> startup mount;
ORACLE instance started.

Total System Global Area  524288000 bytes
Fixed Size                  2022048 bytes
Variable Size             176162144 bytes
Database Buffers          343932928 bytes
Redo Buffers                2170880 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@dg1 backup]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 1 10:30:09 2012

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

connected to target database: ORCL (DBID=1308579523, not open)

RMAN> recover database;

Starting recover at 01-MAY-12
Starting implicit crosscheck backup at 01-MAY-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISK
Crosschecked 6 objects
Finished implicit crosscheck backup at 01-MAY-12

Starting implicit crosscheck copy at 01-MAY-12
using channel ORA_DISK_1
Crosschecked 1 objects
Finished implicit crosscheck copy at 01-MAY-12

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +arc/PRI/AUTOBACKUP/2012_05_01/s_782114046.316.782114047
File Name: +arc/PRI/AUTOBACKUP/2012_05_01/s_782114190.287.782114191
File Name: +arc/PRI/AUTOBACKUP/2012_05_01/s_782114308.285.782114309
File Name: +arc/PRI/AUTOBACKUP/2012_05_01/s_782114472.284.782114475
File Name: +arc/PRI/AUTOBACKUP/2012_05_01/s_782114523.283.782114525

using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 6 is already on disk as file +ARC/pri/onlinelog/group_2.258.781163411
archive log thread 1 sequence 7 is already on disk as file +ARC/pri/onlinelog/group_3.259.781163421
archive log filename=+ARC/pri/onlinelog/group_2.258.781163411 thread=1 sequence=6
archive log filename=+ARC/pri/onlinelog/group_3.259.781163421 thread=1 sequence=7
creating datafile fno=7 name=+DATA/orcl/datafile/test.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/01/2012 10:30:26
ORA-01119: error in creating database file '+DATA/orcl/datafile/test.dbf'
ORA-17502: ksfdcre:4 Failed to create file +DATA/orcl/datafile/test.dbf
ORA-15005: name "orcl/datafile/test.dbf" is already used by an existing alias


[oracle@dg1 dbs]$ asmcmd
ASMCMD> rm test.dbf


RMAN> restore database;

Starting restore at 01-MAY-12
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/01/2012 10:35:47
RMAN-06085: must use SET NEWNAME command to restore datafile /u01/oracle/product/10.2.0/dbs/UNNAMED00007



RMAN> restore datafile 7;

Starting restore at 01-MAY-12
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/01/2012 10:57:22
RMAN-06085: must use SET NEWNAME command to restore datafile /u01/oracle/product/10.2.0/dbs/UNNAMED00007



SQL> alter database create datafile '/u01/oracle/product/10.2.0/dbs/UNNAMED00007';
alter database create datafile '/u01/oracle/product/10.2.0/dbs/UNNAMED00007'
*
ERROR at line 1:
ORA-01111: name for data file /u01/oracle/product/10.2.0/dbs/UNNAMED00007 is
unknown - rename to correct file
2#
发表于 2012-7-18 00:23:38
新建 个控制 文件。嘿。。

回复 只看该作者 道具 举报

3#
发表于 2012-7-18 09:33:28
如果只丢失控制文件的话可以使用控制文件重建来解决问题。
文档位置:http://docs.oracle.com/cd/B19306 ... s_5003.htm#i2061000

回复 只看该作者 道具 举报

4#
发表于 2012-7-18 11:49:24
脚本重建控制文件吧!

回复 只看该作者 道具 举报

5#
发表于 2012-7-19 15:14:31
你这个恢复过程真是一团糟,错漏百出。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-24 11:38 , Processed in 0.048247 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569