分享
 
 
 

数据库数据完全丢失,恢复数据库过程

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

恢复测试,模拟数据库硬盘损坏数据丢失。

1、数据库全备份,

2、备份数据文件、控制文件、spfile、口令文件

3、删除数据库(用dbca删除),只留oracle程序。

4、启动数据库实例

HB130000 oracle$rman target / catalog rman/rman@omsora9

Recovery Manager: Release 9.2.0.1.0 - 64bit Production

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

connected to target database (not started)

connected to recovery catalog database

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/oracle/oracle/app/oracle/product/9.2.

0.1/dbs/inithb130000.ora'

trying to start the Oracle instance without parameter files ...

Oracle instance started

Total System Global Area 156729832 bytes

Fixed Size 741864 bytes

Variable Size 104857600 bytes

Database Buffers 50331648 bytes

Redo Buffers 798720 bytes

5、查询原数据库dbid,恢复spfile

RMAN> list incarnation;查询原数据库的dbid。

List of Database Incarnations

DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time

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

15936 131731 HB130000 2380174037 YES 23440815 25-AUG-05

RMAN> set dbid=2380174037; 设置dbid。

executing command: SET DBID

RMAN> restore spfile;

Starting restore at 13-SEP-05

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: restoring SPFILE

output filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/spfilehb130000.ora

channel ORA_DISK_1: restored backup piece 1

piece handle=/oradata/rmanbackup/hb130000_ctl_c-2380174037-20050913-00.bak tag=n

ull params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 13-SEP-05

6、关闭数据库,使用使用spfile文件启动

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)

Oracle instance started

Total System Global Area 303530016 bytes

Fixed Size 741408 bytes

Variable Size 268435456 bytes

Database Buffers 33554432 bytes

Redo Buffers 798720 bytes

7、恢复控制文件

RMAN> restore controlfile;

Starting restore at 13-SEP-05

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=13 devtype=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: sid=14 devtype=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: sid=15 devtype=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: sid=16 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: restoring controlfile

output filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/hb130000/control01

.ctl

channel ORA_DISK_1: restored backup piece 1

piece handle=/oradata/rmanbackup/hb130000_ctl_c-2380174037-20050913-00.bak tag=n

ull params=NULL

channel ORA_DISK_1: restore complete

replicating controlfile

input filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/hb130000/control01.

ctl

output filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/hb130000/control02

.ctl

output filename=/oradata/hb130000/control03.ctl

Finished restore at 13-SEP-05

8、数据库mount

RMAN> alter database mount;

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 09/13/2005 14:13:42

ORA-01990: error opening password file '/oracle/oracle/app/oracle/product/9.2.0.

1/dbs/orapw'

ORA-27037: unable to obtain file status

IBM AIX RISC System/6000 Error: 2: No such file or directory

Additional information: 3

RMAN> alter database mount;

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 09/13/2005 14:17:18

ORA-01100: database already mounted

9、数据库恢复。

RMAN> restore database;

Starting restore at 13-SEP-05

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

channel ORA_DISK_1: starting datafile backupset restore

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

restoring datafile 00006 to /oradata/hb130000/indx01.dbf

restoring datafile 00008 to /oradata/hb130000/tools01.dbf

restoring datafile 00013 to /oradata/hb130000/CA.dbf

restoring datafile 00015 to /oradata/hb130000/FOGLIGHT.dbf

restoring datafile 00017 to /oradata/hb130000/GDSS.dbf

channel ORA_DISK_2: starting datafile backupset restore

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

restoring datafile 00002 to /oradata/hb130000/undotbs01.dbf

restoring datafile 00004 to /oradata/hb130000/drsys01.dbf

restoring datafile 00007 to /oradata/hb130000/odm01.dbf

restoring datafile 00014 to /oradata/hb130000/QUEST.dbf

restoring datafile 00021 to /oradata/hb130000/oem_repository.dbf

channel ORA_DISK_3: starting datafile backupset restore

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

restoring datafile 00003 to /oradata/hb130000/cwmlite01.dbf

restoring datafile 00005 to /oradata/hb130000/example01.dbf

restoring datafile 00010 to /oradata/hb130000/xdb01.dbf

restoring datafile 00016 to /oradata/hb130000/gwd.dbf

restoring datafile 00020 to /oradata/hb130000/catalog_rman.dbf

channel ORA_DISK_4: starting datafile backupset restore

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

restoring datafile 00001 to /oradata/hb130000/system01.dbf

restoring datafile 00009 to /oradata/hb130000/users01.dbf

restoring datafile 00012 to /oradata/hb130000/GFB.DBF

restoring datafile 00019 to /oradata/hb130000/tgggg.dbf

channel ORA_DISK_1: restored backup piece 1

piece handle=/oradata/rmanbackup/df_HB130000_568897697_175_1.bak tag=TAG20050913

T110814 params=NULL

channel ORA_DISK_1: restore complete

channel ORA_DISK_2: restored backup piece 1

piece handle=/oradata/rmanbackup/df_HB130000_568897694_173_1.bak tag=TAG20050913

T110814 params=NULL

channel ORA_DISK_2: restore complete

channel ORA_DISK_3: restored backup piece 1

piece handle=/oradata/rmanbackup/df_HB130000_568897694_172_1.bak tag=TAG20050913

T110814 params=NULL

channel ORA_DISK_3: restore complete

channel ORA_DISK_4: restored backup piece 1

pie

[1] [2] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有