Chinaunix首页 | 论坛 | 博客
  • 博客访问: 670592
  • 博文数量: 168
  • 博客积分: 2928
  • 博客等级: 中校
  • 技术积分: 1904
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-04 09:56
文章分类

全部博文(168)

文章存档

2010年(168)

我的朋友

分类: Oracle

2010-04-27 09:25:07

很久没做过备份恢复,今天做后将过程记录下来方便以后查看......
RMAN恢复步骤:
1 启动到nomount
[oracle:/oracle/app/oracle/admin/feedb/bdump]sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Mon Dec 7 10:09:33 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 1.4689E+10 bytes
Fixed Size                   745392 bytes
Variable Size            4194304000 bytes
Database Buffers         1.0486E+10 bytes
Redo Buffers                8663040 bytes
SQL>

2 恢复控制文件
[oracle:/oracle/app/oracle/admin/feedb/bdump]rman target /

Recovery Manager: Release 9.2.0.8.0 - 64bit Production

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

connected to target database: feedb (not mounted)

RMAN> set dbid=2819388925;

executing command: SET DBID

RMAN> restore controlfile from '/bakup/database/c-2819388925-20091207-00';

Starting restore at 07-DEC-09

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=41 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/dev/vx/rdsk/vgfeedb02/fee_ctl01
output filename=/dev/vx/rdsk/vgfeedb02/fee_ctl02
output filename=/dev/vx/rdsk/vgfeedb02/fee_ctl03
Finished restore at 07-DEC-09

RMAN> sql 'alter database mount';

sql statement: alter database mount

RMAN>
3 还原数据文件
[oracle:/bakup/database]cat /oracle/rs/recover.sh
. $HOME/.profile
curdate=`date '+%Y%m%d'`
pbase=/bakup/database
dbname=`echo $ORACLE_SID`
echo $dbname
$ORACLE_HOME/bin/rman target / log=$pbase/$dbname$curdate.rec <run {
     allocate channel d1 type disk;
     allocate channel d2 type disk;
     allocate channel d3 type disk;
set newname for datafile '/dev/vgfeedb02/rfee_data01'      to   '/dev/vx/rdsk/vgfeedb02/fee_data01';
set newname for datafile '/dev/vgfeedb02/rfee_data02'      to   '/dev/vx/rdsk/vgfeedb02/fee_data02';
set newname for datafile '/dev/vgfeedb02/rfee_data03'      to   '/dev/vx/rdsk/vgfeedb02/fee_data03';
set newname for datafile '/dev/vgfeedb02/rfee_data04'      to   '/dev/vx/rdsk/vgfeedb02/fee_data04';
set newname for datafile '/dev/vgfeedb02/rfee_data05'      to   '/dev/vx/rdsk/vgfeedb02/fee_data05';
set newname for datafile '/dev/vgfeedb02/rfee_data06'      to   '/dev/vx/rdsk/vgfeedb02/fee_data06';
set newname for datafile '/dev/vgfeedb02/rfee_data07'      to   '/dev/vx/rdsk/vgfeedb02/fee_data07';
set newname for datafile '/dev/vgfeedb02/rfee_data08'      to   '/dev/vx/rdsk/vgfeedb02/fee_data08';
set newname for datafile '/dev/vgfeedb02/rfee_data09'      to   '/dev/vx/rdsk/vgfeedb02/fee_data09';
set newname for datafile '/dev/vgfeedb02/rfee_data10'      to   '/dev/vx/rdsk/vgfeedb02/fee_data10';
set newname for datafile '/dev/vgfeedb02/rfee_data11'      to   '/dev/vx/rdsk/vgfeedb02/fee_data11';
set newname for datafile '/dev/vgfeedb02/rfee_data12'      to   '/dev/vx/rdsk/vgfeedb02/fee_data12';
set newname for datafile '/dev/vgfeedb02/rfee_data126'     to   '/dev/vx/rdsk/vgfeedb02/fee_data126';
set newname for datafile '/dev/vgfeedb02/rfee_data127'     to   '/dev/vx/rdsk/vgfeedb02/fee_data127';
set newname for datafile '/dev/vgfeedb02/rfee_data128'     to   '/dev/vx/rdsk/vgfeedb02/fee_data128';
set newname for datafile '/dev/vgfeedb02/rfee_data129'     to   '/dev/vx/rdsk/vgfeedb02/fee_data129';
set newname for datafile '/dev/vgfeedb02/rfee_data13'      to   '/dev/vx/rdsk/vgfeedb02/fee_data13';
set newname for datafile '/dev/vgfeedb02/rfee_data130'     to   '/dev/vx/rdsk/vgfeedb02/fee_data130';
set newname for datafile '/dev/vgfeedb02/rfee_data131'     to   '/dev/vx/rdsk/vgfeedb02/fee_data131';
set newname for datafile '/dev/vgfeedb02/rfee_data132'     to   '/dev/vx/rdsk/vgfeedb02/fee_data132';
set newname for datafile '/dev/vgfeedb02/rfee_data133'     to   '/dev/vx/rdsk/vgfeedb02/fee_data133';
set newname for datafile '/dev/vgfeedb02/rfee_data134'     to   '/dev/vx/rdsk/vgfeedb02/fee_data134';
set newname for datafile '/dev/vgfeedb02/rfee_data135'     to   '/dev/vx/rdsk/vgfeedb02/fee_data135';
set newname for datafile '/dev/vgfeedb02/rfee_data136'     to   '/dev/vx/rdsk/vgfeedb02/fee_data136';
set newname for datafile '/dev/vgfeedb02/rfee_data137'     to   '/dev/vx/rdsk/vgfeedb02/fee_data137';
set newname for datafile '/dev/vgfeedb02/rfee_data138'     to   '/dev/vx/rdsk/vgfeedb02/fee_data138';
set newname for datafile '/dev/vgfeedb02/rfee_data139'     to   '/dev/vx/rdsk/vgfeedb02/fee_data139';
set newname for datafile '/dev/vgfeedb02/rfee_data14'      to   '/dev/vx/rdsk/vgfeedb02/fee_data14';
set newname for datafile '/dev/vgfeedb02/rfee_data140'     to   '/dev/vx/rdsk/vgfeedb02/fee_data140';
set newname for datafile '/dev/vgfeedb02/rfee_data141'     to   '/dev/vx/rdsk/vgfeedb02/fee_data141';
set newname for datafile '/dev/vgfeedb02/rfee_data142'     to   '/dev/vx/rdsk/vgfeedb02/fee_data142';
set newname for datafile '/dev/vgfeedb02/rfee_data143'     to   '/dev/vx/rdsk/vgfeedb02/fee_data143';
set newname for datafile '/dev/vgfeedb02/rfee_data144'     to   '/dev/vx/rdsk/vgfeedb02/fee_data144';
set newname for datafile '/dev/vgfeedb02/rfee_data145'     to   '/dev/vx/rdsk/vgfeedb02/fee_data145';
set newname for datafile '/dev/vgfeedb02/rfee_data146'     to   '/dev/vx/rdsk/vgfeedb02/fee_data146';
set newname for datafile '/dev/vgfeedb02/rfee_data147'     to   '/dev/vx/rdsk/vgfeedb02/fee_data147';
set newname for datafile '/dev/vgfeedb02/rfee_data148'     to   '/dev/vx/rdsk/vgfeedb02/fee_data148';
set newname for datafile '/dev/vgfeedb02/rfee_data149'     to   '/dev/vx/rdsk/vgfeedb02/fee_data149';
set newname for datafile '/dev/vgfeedb02/rfee_data15'      to   '/dev/vx/rdsk/vgfeedb02/fee_data15';
set newname for datafile '/dev/vgfeedb02/rfee_data150'     to   '/dev/vx/rdsk/vgfeedb02/fee_data150';
set newname for datafile '/dev/vgfeedb02/rfee_data151'     to   '/dev/vx/rdsk/vgfeedb02/fee_data151';
set newname for datafile '/dev/vgfeedb02/rfee_data152'     to   '/dev/vx/rdsk/vgfeedb02/fee_data152';
set newname for datafile '/dev/vgfeedb02/rfee_data153'     to   '/dev/vx/rdsk/vgfeedb02/fee_data153';
set newname for datafile '/dev/vgfeedb02/rfee_data154'     to   '/dev/vx/rdsk/vgfeedb02/fee_data154';
set newname for datafile '/dev/vgfeedb02/rfee_data155'     to   '/dev/vx/rdsk/vgfeedb02/fee_data155';
set newname for datafile '/dev/vgfeedb02/rfee_data156'     to   '/dev/vx/rdsk/vgfeedb02/fee_data156';
set newname for datafile '/dev/vgfeedb02/rfee_data157'     to   '/dev/vx/rdsk/vgfeedb02/fee_data157';
set newname for datafile '/dev/vgfeedb02/rfee_data158'     to   '/dev/vx/rdsk/vgfeedb02/fee_data158';
set newname for datafile '/dev/vgfeedb02/rfee_data159'     to   '/dev/vx/rdsk/vgfeedb02/fee_data159';
set newname for datafile '/dev/vgfeedb02/rfee_data16'      to   '/dev/vx/rdsk/vgfeedb02/fee_data16';
set newname for datafile '/dev/vgfeedb02/rfee_data160'     to   '/dev/vx/rdsk/vgfeedb02/fee_data160';
set newname for datafile '/dev/vgfeedb02/rfee_data161'     to   '/dev/vx/rdsk/vgfeedb02/fee_data161';
set newname for datafile '/dev/vgfeedb02/rfee_data162'     to   '/dev/vx/rdsk/vgfeedb02/fee_data162';
set newname for datafile '/dev/vgfeedb02/rfee_data163'     to   '/dev/vx/rdsk/vgfeedb02/fee_data163';
set newname for datafile '/dev/vgfeedb02/rfee_data164'     to   '/dev/vx/rdsk/vgfeedb02/fee_data164';
set newname for datafile '/dev/vgfeedb02/rfee_data165'     to   '/dev/vx/rdsk/vgfeedb02/fee_data165';
set newname for datafile '/dev/vgfeedb02/rfee_data166'     to   '/dev/vx/rdsk/vgfeedb02/fee_data166';
set newname for datafile '/dev/vgfeedb02/rfee_data167'     to   '/dev/vx/rdsk/vgfeedb02/fee_data167';
set newname for datafile '/dev/vgfeedb02/rfee_data168'     to   '/dev/vx/rdsk/vgfeedb02/fee_data168';
set newname for datafile '/dev/vgfeedb02/rfee_data169'     to   '/dev/vx/rdsk/vgfeedb02/fee_data169';
set newname for datafile '/dev/vgfeedb02/rfee_data17'      to   '/dev/vx/rdsk/vgfeedb02/fee_data17';
set newname for datafile '/dev/vgfeedb02/rfee_data170'     to   '/dev/vx/rdsk/vgfeedb02/fee_data170';
set newname for datafile '/dev/vgfeedb02/rfee_data171'     to   '/dev/vx/rdsk/vgfeedb02/fee_data171';
set newname for datafile '/dev/vgfeedb02/rfee_data172'     to   '/dev/vx/rdsk/vgfeedb02/fee_data172';
set newname for datafile '/dev/vgfeedb02/rfee_data173'     to   '/dev/vx/rdsk/vgfeedb02/fee_data173';
set newname for datafile '/dev/vgfeedb02/rfee_data174'     to   '/dev/vx/rdsk/vgfeedb02/fee_data174';
set newname for datafile '/dev/vgfeedb02/rfee_data175'     to   '/dev/vx/rdsk/vgfeedb02/fee_data175';
set newname for datafile '/dev/vgfeedb02/rfee_data176'     to   '/dev/vx/rdsk/vgfeedb02/fee_data176';
set newname for datafile '/dev/vgfeedb02/rfee_data177'     to   '/dev/vx/rdsk/vgfeedb02/fee_data177';
set newname for datafile '/dev/vgfeedb02/rfee_data178'     to   '/dev/vx/rdsk/vgfeedb02/fee_data178';
set newname for datafile '/dev/vgfeedb02/rfee_data179'     to   '/dev/vx/rdsk/vgfeedb02/fee_data179';
set newname for datafile '/dev/vgfeedb02/rfee_data18'      to   '/dev/vx/rdsk/vgfeedb02/fee_data18';
set newname for datafile '/dev/vgfeedb02/rfee_data180'     to   '/dev/vx/rdsk/vgfeedb02/fee_data180';
set newname for datafile '/dev/vgfeedb02/rfee_data181'     to   '/dev/vx/rdsk/vgfeedb02/fee_data181';
set newname for datafile '/dev/vgfeedb02/rfee_data182'     to   '/dev/vx/rdsk/vgfeedb02/fee_data182';
set newname for datafile '/dev/vgfeedb02/rfee_data183'     to   '/dev/vx/rdsk/vgfeedb02/fee_data183';
set newname for datafile '/dev/vgfeedb02/rfee_data184'     to   '/dev/vx/rdsk/vgfeedb02/fee_data184';
set newname for datafile '/dev/vgfeedb02/rfee_data185'     to   '/dev/vx/rdsk/vgfeedb02/fee_data185';
set newname for datafile '/dev/vgfeedb02/rfee_data186'     to   '/dev/vx/rdsk/vgfeedb02/fee_data186';
set newname for datafile '/dev/vgfeedb02/rfee_data187'     to   '/dev/vx/rdsk/vgfeedb02/fee_data187';
set newname for datafile '/dev/vgfeedb02/rfee_data188'     to   '/dev/vx/rdsk/vgfeedb02/fee_data188';
set newname for datafile '/dev/vgfeedb02/rfee_data189'     to   '/dev/vx/rdsk/vgfeedb02/fee_data189';
set newname for datafile '/dev/vgfeedb02/rfee_data19'      to   '/dev/vx/rdsk/vgfeedb02/fee_data19';
set newname for datafile '/dev/vgfeedb02/rfee_data190'     to   '/dev/vx/rdsk/vgfeedb02/fee_data190';
set newname for datafile '/dev/vgfeedb02/rfee_data191'     to   '/dev/vx/rdsk/vgfeedb02/fee_data191';
set newname for datafile '/dev/vgfeedb02/rfee_data192'     to   '/dev/vx/rdsk/vgfeedb02/fee_data192';
set newname for datafile '/dev/vgfeedb02/rfee_data193'     to   '/dev/vx/rdsk/vgfeedb02/fee_data193';
set newname for datafile '/dev/vgfeedb02/rfee_data194'     to   '/dev/vx/rdsk/vgfeedb02/fee_data194';
set newname for datafile '/dev/vgfeedb02/rfee_data195'     to   '/dev/vx/rdsk/vgfeedb02/fee_data195';
set newname for datafile '/dev/vgfeedb02/rfee_data196'     to   '/dev/vx/rdsk/vgfeedb02/fee_data196';
set newname for datafile '/dev/vgfeedb02/rfee_data197'     to   '/dev/vx/rdsk/vgfeedb02/fee_data197';
set newname for datafile '/dev/vgfeedb02/rfee_data198'     to   '/dev/vx/rdsk/vgfeedb02/fee_data198';
set newname for datafile '/dev/vgfeedb02/rfee_data199'     to   '/dev/vx/rdsk/vgfeedb02/fee_data199';
set newname for datafile '/dev/vgfeedb02/rfee_data20'      to   '/dev/vx/rdsk/vgfeedb02/fee_data20';
set newname for datafile '/dev/vgfeedb02/rfee_data200'     to   '/dev/vx/rdsk/vgfeedb02/fee_data200';
set newname for datafile '/dev/vgfeedb02/rfee_data201'     to   '/dev/vx/rdsk/vgfeedb02/fee_data201';
set newname for datafile '/dev/vgfeedb02/rfee_data202'     to   '/dev/vx/rdsk/vgfeedb02/fee_data202';
set newname for datafile '/dev/vgfeedb02/rfee_data203'     to   '/dev/vx/rdsk/vgfeedb02/fee_data203';
set newname for datafile '/dev/vgfeedb02/rfee_data204'     to   '/dev/vx/rdsk/vgfeedb02/fee_data204';
set newname for datafile '/dev/vgfeedb02/rfee_data205'     to   '/dev/vx/rdsk/vgfeedb02/fee_data205';
set newname for datafile '/dev/vgfeedb02/rfee_data206'     to   '/dev/vx/rdsk/vgfeedb02/fee_data206';
set newname for datafile '/dev/vgfeedb02/rfee_data207'     to   '/dev/vx/rdsk/vgfeedb02/fee_data207';
set newname for datafile '/dev/vgfeedb02/rfee_data208'     to   '/dev/vx/rdsk/vgfeedb02/fee_data208';
set newname for datafile '/dev/vgfeedb02/rfee_data209'     to   '/dev/vx/rdsk/vgfeedb02/fee_data209';
set newname for datafile '/dev/vgfeedb02/rfee_data21'      to   '/dev/vx/rdsk/vgfeedb02/fee_data21';
set newname for datafile '/dev/vgfeedb02/rfee_data210'     to   '/dev/vx/rdsk/vgfeedb02/fee_data210';
set newname for datafile '/dev/vgfeedb02/rfee_data211'     to   '/dev/vx/rdsk/vgfeedb02/fee_data211';
set newname for datafile '/dev/vgfeedb02/rfee_data212'     to   '/dev/vx/rdsk/vgfeedb02/fee_data212';
set newname for datafile '/dev/vgfeedb02/rfee_data22'      to   '/dev/vx/rdsk/vgfeedb02/fee_data22';
set newname for datafile '/dev/vgfeedb02/rfee_data23'      to   '/dev/vx/rdsk/vgfeedb02/fee_data23';
set newname for datafile '/dev/vgfeedb02/rfee_data24'      to   '/dev/vx/rdsk/vgfeedb02/fee_data24';
set newname for datafile '/dev/vgfeedb02/rfee_data25'      to   '/dev/vx/rdsk/vgfeedb02/fee_data25';
set newname for datafile '/dev/vgfeedb02/rfee_data26'      to   '/dev/vx/rdsk/vgfeedb02/fee_data26';
set newname for datafile '/dev/vgfeedb02/rfee_data27'      to   '/dev/vx/rdsk/vgfeedb02/fee_data27';
set newname for datafile '/dev/vgfeedb02/rfee_data28'      to   '/dev/vx/rdsk/vgfeedb02/fee_data28';
set newname for datafile '/dev/vgfeedb02/rfee_data29'      to   '/dev/vx/rdsk/vgfeedb02/fee_data29';
set newname for datafile '/dev/vgfeedb02/rfee_data30'      to   '/dev/vx/rdsk/vgfeedb02/fee_data30';
set newname for datafile '/dev/vgfeedb02/rfee_data31'      to   '/dev/vx/rdsk/vgfeedb02/fee_data31';
set newname for datafile '/dev/vgfeedb02/rfee_data32'      to   '/dev/vx/rdsk/vgfeedb02/fee_data32';
set newname for datafile '/dev/vgfeedb02/rfee_data33'      to   '/dev/vx/rdsk/vgfeedb02/fee_data33';
set newname for datafile '/dev/vgfeedb02/rfee_data34'      to   '/dev/vx/rdsk/vgfeedb02/fee_data34';
set newname for datafile '/dev/vgfeedb02/rfee_data35'      to   '/dev/vx/rdsk/vgfeedb02/fee_data35';
set newname for datafile '/dev/vgfeedb02/rfee_data36'      to   '/dev/vx/rdsk/vgfeedb02/fee_data36';
set newname for datafile '/dev/vgfeedb02/rfee_data37'      to   '/dev/vx/rdsk/vgfeedb02/fee_data37';
set newname for datafile '/dev/vgfeedb02/rfee_data38'      to   '/dev/vx/rdsk/vgfeedb02/fee_data38';
set newname for datafile '/dev/vgfeedb02/rfee_data39'      to   '/dev/vx/rdsk/vgfeedb02/fee_data39';
set newname for datafile '/dev/vgfeedb02/rfee_data40'      to   '/dev/vx/rdsk/vgfeedb02/fee_data40';
set newname for datafile '/dev/vgfeedb02/rfee_data41'      to   '/dev/vx/rdsk/vgfeedb02/fee_data41';
set newname for datafile '/dev/vgfeedb02/rfee_data42'      to   '/dev/vx/rdsk/vgfeedb02/fee_data42';
set newname for datafile '/dev/vgfeedb02/rfee_data43'      to   '/dev/vx/rdsk/vgfeedb02/fee_data43';
set newname for datafile '/dev/vgfeedb02/rfee_data44'      to   '/dev/vx/rdsk/vgfeedb02/fee_data44';
set newname for datafile '/dev/vgfeedb02/rfee_data45'      to   '/dev/vx/rdsk/vgfeedb02/fee_data45';
set newname for datafile '/dev/vgfeedb02/rfee_data46'      to   '/dev/vx/rdsk/vgfeedb02/fee_data46';
set newname for datafile '/dev/vgfeedb02/rfee_data47'      to   '/dev/vx/rdsk/vgfeedb02/fee_data47';
set newname for datafile '/dev/vgfeedb02/rfee_data71'      to   '/dev/vx/rdsk/vgfeedb02/fee_data71';
set newname for datafile '/dev/vgfeedb02/rfee_data72'      to   '/dev/vx/rdsk/vgfeedb02/fee_data72';
set newname for datafile '/dev/vgfeedb02/rfee_data73'      to   '/dev/vx/rdsk/vgfeedb02/fee_data73';
set newname for datafile '/dev/vgfeedb02/rfee_system'      to   '/dev/vx/rdsk/vgfeedb02/fee_system';
set newname for datafile '/dev/vgfeedb02/rfee_undo01'      to   '/dev/vx/rdsk/vgfeedb02/fee_undo01';
set newname for datafile '/dev/vgfeedb02/rfee_undo02'      to   '/dev/vx/rdsk/vgfeedb02/fee_undo02';
set newname for datafile '/dev/vgfeedb03/rfee_data001'     to   '/dev/vx/rdsk/vgfeedb03/fee_data001';
set newname for datafile '/dev/vgfeedb03/rfee_data002'     to   '/dev/vx/rdsk/vgfeedb03/fee_data002';
set newname for datafile '/dev/vgfeedb03/rfee_data003'     to   '/dev/vx/rdsk/vgfeedb03/fee_data003';
set newname for datafile '/dev/vgfeedb03/rfee_data004'     to   '/dev/vx/rdsk/vgfeedb03/fee_data004';
set newname for datafile '/dev/vgfeedb03/rfee_data005'     to   '/dev/vx/rdsk/vgfeedb03/fee_data005';
set newname for datafile '/dev/vgfeedb03/rfee_data006'     to   '/dev/vx/rdsk/vgfeedb03/fee_data006';
set newname for datafile '/dev/vgfeedb03/rfee_data007'     to   '/dev/vx/rdsk/vgfeedb03/fee_data007';
set newname for datafile '/dev/vgfeedb03/rfee_data008'     to   '/dev/vx/rdsk/vgfeedb03/fee_data008';
set newname for datafile '/dev/vgfeedb03/rfee_data009'     to   '/dev/vx/rdsk/vgfeedb03/fee_data009';
set newname for datafile '/dev/vgfeedb03/rfee_data010'     to   '/dev/vx/rdsk/vgfeedb03/fee_data010';
set newname for datafile '/dev/vgfeedb03/rfee_data011'     to   '/dev/vx/rdsk/vgfeedb03/fee_data011';
set newname for datafile '/dev/vgfeedb03/rfee_data012'     to   '/dev/vx/rdsk/vgfeedb03/fee_data012';
set newname for datafile '/dev/vgfeedb03/rfee_data013'     to   '/dev/vx/rdsk/vgfeedb03/fee_data013';
set newname for datafile '/dev/vgfeedb03/rfee_data014'     to   '/dev/vx/rdsk/vgfeedb03/fee_data014';
set newname for datafile '/dev/vgfeedb03/rfee_data015'     to   '/dev/vx/rdsk/vgfeedb03/fee_data015';
set newname for datafile '/dev/vgfeedb03/rfee_data016'     to   '/dev/vx/rdsk/vgfeedb03/fee_data016';
set newname for datafile '/dev/vgfeedb03/rfee_data017'     to   '/dev/vx/rdsk/vgfeedb03/fee_data017';
set newname for datafile '/dev/vgfeedb03/rfee_data018'     to   '/dev/vx/rdsk/vgfeedb03/fee_data018';
set newname for datafile '/dev/vgfeedb03/rfee_data019'     to   '/dev/vx/rdsk/vgfeedb03/fee_data019';
set newname for datafile '/dev/vgfeedb03/rfee_data020'     to   '/dev/vx/rdsk/vgfeedb03/fee_data020';
set newname for datafile '/dev/vgfeedb03/rfee_data021'     to   '/dev/vx/rdsk/vgfeedb03/fee_data021';
set newname for datafile '/dev/vgfeedb03/rfee_data022'     to   '/dev/vx/rdsk/vgfeedb03/fee_data022';
set newname for datafile '/dev/vgfeedb03/rfee_data023'     to   '/dev/vx/rdsk/vgfeedb03/fee_data023';
set newname for datafile '/dev/vgfeedb03/rfee_data024'     to   '/dev/vx/rdsk/vgfeedb03/fee_data024';
set newname for datafile '/dev/vgfeedb03/rfee_data025'     to   '/dev/vx/rdsk/vgfeedb03/fee_data025';
set newname for datafile '/dev/vgfeedb03/rfee_data026'     to   '/dev/vx/rdsk/vgfeedb03/fee_data026';
set newname for datafile '/dev/vgfeedb03/rfee_data027'     to   '/dev/vx/rdsk/vgfeedb03/fee_data027';
restore database;
     release channel d1;
     release channel d2;
     release channel d3;
     switch datafile all;
    }
exit
EOF
exit
[oracle:/bakup/database]
4 更改redo日志
alter database rename file '/dev/vgfeedb02/rfee_redo11' to '/dev/vx/rdsk/vgfeedb02/fee_redo11';
alter database rename file '/dev/vgfeedb02/rfee_redo12' to '/dev/vx/rdsk/vgfeedb02/fee_redo12';
alter database rename file '/dev/vgfeedb02/rfee_redo13' to '/dev/vx/rdsk/vgfeedb02/fee_redo13';
alter database rename file '/dev/vgfeedb02/rfee_redo14' to '/dev/vx/rdsk/vgfeedb02/fee_redo14';
alter database rename file '/dev/vgfeedb02/rfee_redo31' to '/dev/vx/rdsk/vgfeedb02/fee_redo31';
alter database rename file '/dev/vgfeedb02/rfee_redo32' to '/dev/vx/rdsk/vgfeedb02/fee_redo32';
alter database rename file '/dev/vgfeedb02/rfee_redo33' to '/dev/vx/rdsk/vgfeedb02/fee_redo33';
alter database rename file '/dev/vgfeedb02/rfee_redo34' to '/dev/vx/rdsk/vgfeedb02/fee_redo34';
5 追加归档恢复数据库
SQL>recover database using backup controlfile until cancel;--根据提示恢复相应归档日志
6 打开数据库到read only
SQL>alter database open read only;

备注:如果数据库能以read only模式打开,则置为read write基本就没什么问题了
7 打开数据库到read write
SQL>shutdown immediate
SQL>startup mount;
SQL>alter database open resetlogs;
8 为临时表空间添加数据文件
SQL>alter tablespace temp add tempfile '/dev/vgfeedb02/rfee_temp01';
SQL>alter tablespace temp add tempfile '/dev/vgfeedb02/rfee_temp02';
9 数据库状态检查
SQL>select open_mode from gv$database;
SQL>alter system switch logfile;
.
.
.
.
10 让开发商检查数据完整性
阅读(485) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~