南宁烟寒网络服务南宁网站建设、南宁网站制作、南宁网站设计、南宁广告设计,联系电话:18978941786

  • 网站首页
  • 关于我们
  • 网站建设
  • 网站推广
  • 成功案例
  • 广告设计
  • 技术文章
  • 联系方式
南宁网站建设成功案例 | 对南宁网页设计我们具有什么优势? | 南宁页站制作常见的一些疑问? 南宁网站制作报价 网站建设咨询电话:18978941786 0771-5840665
「烟寒网络」提供南宁网站建设、南宁网页制作、南宁网站设计、网站改版、南宁SEO优化、网站维护、南宁网站优化、南宁网站推广、南宁广告设计等服务。
CSS布局DIV 服务器配置学习 NET学习 ASP学习 PHP学习 网站综合 平面设计
首页 -> 技术交流 -> 服务器配置学习 -> 正文

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

收藏 分享 发布日期:2011-5-17 9:19:36    编辑:admin  文章来源:  点击率:
恢复测试,模拟数据库硬盘损坏数据丢失。 1、数据库全备份, 2、备份数据文件、控制文件、spfile、口令文件 3、删除数据库(用dbca删除),只留oracle程序。

恢复测试,模拟数据库硬盘损坏数据丢失。
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
piece handle=/oradata/rmanbackup/df_HB130000_568897695_174_1.bak tag=TAG20050913
T110814 params=NULL
channel ORA_DISK_4: restore complete
Finished restore at 13-SEP-05

RMAN>


RMAN> recover database;

Starting recover at 13-SEP-05
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=32
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rmanbackup/df_HB130000_568897755_179_1.bak tag=TAG20050913
T110915 params=NULL
channel ORA_DISK_1: restore complete
archive log filename=/oradata/rmanbackup/archive/hb130000_1_32.dbf thread=1 sequ
ence=32
unable to find archive log
archive log thread=1 sequence=33
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2005 14:20:50
RMAN-06054: media recovery requesting unknown log: thread 1 scn 26146497

RMAN> recover database;

Starting recover at 13-SEP-05
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

starting media recovery

unable to find archive log
archive log thread=1 sequence=33
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2005 14:26:33
RMAN-06054: media recovery requesting unknown log: thread 1 scn 26146497


10、数据库resetlogs打开
RMAN> alter database open resetlogs;

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN>


11、完全备份数据库。



本文由南宁网站建设网络收集整理,转载请注明出去;更多网站技术交流请登录八九设计联盟!

南宁网站建设

    ·解决网站瓶颈是关键
    ·网建之路:谈“内容为王”还是“网民...
    ·网页设计新手应该遵循的建站步骤
    ·外贸网站如何不被谷歌降权~
    ·企业网站的品牌主要提现在哪些方面呢...
    ·何时把用户奉为第一,搜索引擎第二
    ·如何做专业的网站建设公司
    ·CSS对浏览器的兼容性技巧
    ·一个网站五个目标?
    ·中小型企业为什么要建网站?

南宁网站推广

    ·何时把搜索引擎奉为第一,用户其次
    ·网站收录正常 却苦于没排名的困惑
    ·什么是网络推广?
    ·推广网站时该不该使用推广软件
    ·推广海外游客到中国旅游服务
    ·二级域名权重影响一级域名吗?
    ·百度在提升用户体验方面的大变动
    ·寒冰小子分析:网站流量不高原因
    ·寒冰小子洽谈:收录不稳定与收录少的...
    ·问答网站如何利用,获取外链
首 页 | 新闻中心 | 人才招聘 | 合作伙伴 | 网站地图 | 联系我们
南宁烟寒网络竭诚为您免费提供南宁网站建设、南宁网站设计、南宁网站制作、南宁网站优化!
南宁网络公司咨询热线电话:0771-5840665 18967841786(24小时全天电话)
烟寒网络 - 让你进一步走向成功!
桂ICP备11000409号