20121218_异机恢复记录

来源:互联网 发布:哪里可以接java私活 编辑:程序博客网 时间:2024/05/16 12:19

总结:
1.控制文件名称
2.备份权限、目录、状态
3.注册数据库
4.asm操作:

run{
allocate channel cha1 type disk;
allocate channel cha2 type disk;
allocate channel cha3 type disk;
allocate channel cha4 type disk;
allocate channel cha5 type disk;
set until time= "to_date('2013-05-26 02:31:21', 'yyyy-mm-dd hh24:mi:ss')";
restore database;
recover database;
sql 'alter database open resetlogs';
release channel cha1;
release channel cha2;
release channel cha3;
release channel cha4;
release channel cha5;
}


ERROR: failed to establish dependency between database sgerp5 and diskgroup resource ora.DATA.dg


P550:/home/grid$crsctl status resource -t
crsctl start resource ora.diskmon 


srvctl status database -d sgerp5
srvctl modify database -d sgerp5 -a "DATA"


alter diskgroup data dismount;
drop diskgroup data including contents;


crs  asm comp  start catalog with      set newname for datafile  'xxxxxx/xxx/xxxx' to '+xxx/xxxxxx'
srvctl add database -d sgerp5 -o /u01/app/product/11.2

srvctl config database -d sgerp5
srvctl add database
crsctl stat res -t

run{
set newname for datafile 1 to '+DATA';
restore datafile 1;
switch datafile;
}

startup mount pfile=/u01/app/product/11.2/dbs/initsgerp5.ora
restore controlfile from '/orabak/AutoCtl_SGERP5_20121219_c-3580899532-20121219-00';

Starting backup at 2012-12-18 20:52:02

restore database until time "to_date('2012-12-18 20:52:02', 'yyyy-mm-dd hh24:mi:ss')";
alter database open resetlogs;


RMAN> restore database;

Starting restore at 2012-12-20 00:53:06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=157 device type=DISK

creating datafile file number=1 name=+DATA/sgerp5/datafile/system.264.799890707
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/20/2012 00:53:08
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+DATA/sgerp5/datafile/system.264.799890707'

RMAN>
recover datafile '+DATA/sgerp5/datafile/system.264.799890707'

restore datafile '+DATA/sgerp5/datafile/system.264.799890707'

P550:/home/oracle$rman target/

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Dec 20 01:35:11 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SGERP5 (not mounted)

RMAN> restore controlfile from '/orabak/AutoCtl_SGERP5_20121219_c-3580899532-20121219-00';

Starting restore at 2012-12-20 01:35:15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:13
output file name=+DATA/sgerp5/controlfile/current.256.802488929
output file name=+DATA/sgerp5/controlfile/current.257.802488929
Finished restore at 2012-12-20 01:35:29

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
117     B  0  A DISK        2012-12-19 00:56:03 1       1       YES        TAG20121218T205203
118     B  0  A DISK        2012-12-19 00:59:48 1       1       YES        TAG20121218T205203
119     B  0  A DISK        2012-12-19 01:00:33 1       1       YES        TAG20121218T205203
120     B  0  A DISK        2012-12-19 01:02:26 1       1       YES        TAG20121218T205203
121     B  0  A DISK        2012-12-19 01:03:33 1       1       YES        TAG20121218T205203

RMAN> restore database;

Starting restore at 2012-12-20 01:36:21
Starting implicit crosscheck backup at 2012-12-20 01:36:21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3 device type=DISK
Crosschecked 5 objects
Finished implicit crosscheck backup at 2012-12-20 01:36:21

Starting implicit crosscheck copy at 2012-12-20 01:36:21
using channel ORA_DISK_1
Finished implicit crosscheck copy at 2012-12-20 01:36:22

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

creating datafile file number=1 name=+DATA/sgerp5/datafile/system.264.799890707
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/20/2012 01:36:23
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+DATA/sgerp5/datafile/system.264.799890707'

RMAN>

 

 

catalog start with '路径'
change backupset 117 available;
change backupset 118 available;
change backupset 119 available;
change backupset 120 available;
change backupset 121 available;

sgerp5.__db_cache_size=10240M
sgerp5.__java_pool_size=256M
sgerp5.__large_pool_size=256M
sgerp5.__oracle_base='/u01/app'#ORACLE_BASE set from environment
sgerp5.__pga_aggregate_target=2048M
sgerp5.__sga_target=20480M
sgerp5.__shared_io_pool_size=0
sgerp5.__shared_pool_size=2048M
sgerp5.__streams_pool_size=256M
*.audit_file_dest='/u01/app/admin/sgerp5/adump'
*.audit_trail='NONE'
*.compatible='11.2.0.0.0'
*.control_files='+DATA/sgerp5/controlfile/current.256.799890705','+DATA/sgerp5/controlfile/current.257.799890705'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='sgerp5'
*.db_recovery_file_dest='+DATA'
*.db_recovery_file_dest_size=5G
*.diagnostic_dest='/u01/app'
*.distributed_lock_timeout=300
*.event='10949 trace name context forever, level 1'
*.log_archive_dest_1='location=/oraarch'
*.log_archive_format='ARC_ERP5_%s_%r_%t.log'
*.memory_target=33G
*.open_cursors=1000
*.processes=800
*.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'
*.session_cached_cursors=100
*.sessions=885
*.undo_retention=25200
*.undo_tablespace='UNDOTBS1'

 

原创粉丝点击