|
今天按照网络上的一些帖子,做了一次从windows版本到linux版本的RMAN数据库恢复,最后到是也恢复出来了,但是还有一些小的问题,还请老师或者各位同学帮忙诊断一下。
平台都是64位的,数据库版本也都是11.2.0.4的。
1. 在windows上利用rman备份数据库
run{
backup database format 'E:\rman\bk_%d_%t_%s';
backup archivelog all format 'E:\rman\al_%d_%t_%s';
backup current controlfile format 'E:\rman\cntrl_%d_%t_%s';
}
2. 在linux 服务器上任意创建一个目录(如:/tmp/rmanbackup),将备份集ftp 到该目录下
3. 恢复spfile
su – oracle
$export ORACLE_SID=orcl
$rman target / nocatalog
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/product/db_1/dbs/initorcl.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Rman>restore spfile from '/tmp/rmanbackup/BK_ORCL_938044335_39';
RMAN> shutdown immediate
Oracle instance shut down
$sqlplus "/as sysdba"
SQL> create pfile from spfile;
File created.
4.修改所有关于windows下目录的参数如下:
orcl.__db_cache_size=1560281088
orcl.__java_pool_size=16777216
orcl.__large_pool_size=100663296
orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=872415232
orcl.__sga_target=2147483648
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=452984832
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_file_record_keep_time=365
*.control_files='/oradata/orcl/control01.ctl','/oradata/orcl/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_dest_1='LOCATION=/oradata/archive'
*.log_archive_format='ARC%S_%R.%T'
*.open_cursors=300
*.pga_aggregate_target=858783744
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=2147483648
*.sga_target=2147483648
*.undo_tablespace='UNDOTBS1'
手工创建相关目录:
$mkdir -p /u01/app/oracle/admin/orcl/adump
$mkdir –p /oradata/orcl
$mkdir –p /oradata/archive
5.恢复控制文件
RMAN> startup nomount pfile='/u01/app/oracle/product/11.2.0/dbs/initorcl.ora';
Oracle instance started
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 520095640 bytes
Database Buffers 1610612736 bytes
Redo Buffers 4923392 bytes
RMAN> restore controlfile from '/tmp/rmanbackup/CNTRL_ORCL_938044377_41';
Starting restore at 08-MAR-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=149 device type=DISK
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
6.将备份集信息导入控制文件:
RMAN> catalog start with '/tmp/rmanbackup/';
RMAN> catalog start with '/tmp/rmanbackup/';
searching for all files that match the pattern /tmp/rmanbackup/
List of Files Unknown to the Database
=====================================
File Name: /tmp/rmanbackup/BK_ORCL_938044335_39
File Name: /tmp/rmanbackup/AL_ORCL_938044341_40
File Name: /tmp/rmanbackup/BK_ORCL_938044268_38
File Name: /tmp/rmanbackup/CNTRL_ORCL_938044377_41
Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /tmp/rmanbackup/BK_ORCL_938044335_39
File Name: /tmp/rmanbackup/AL_ORCL_938044341_40
File Name: /tmp/rmanbackup/BK_ORCL_938044268_38
File Name: /tmp/rmanbackup/CNTRL_ORCL_938044377_41
run{
set newname for datafile 1 to '/oradata/orcl/SYSTEM01.DBF';
set newname for datafile 2 to '/oradata/orcl/SYSAUX01.DBF';
set newname for datafile 3 to '/oradata/orcl/UNDOTBS01.DBF';
set newname for datafile 4 to '/oradata/orcl/USERS01.DBF';
set newname for datafile 5 to '/oradata/orcl/TEST01.DBF';
restore database;
switch datafile all;
recover database;
}
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 08-MAR-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=149 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /oradata/orcl/SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to /oradata/orcl/SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00003 to /oradata/orcl/UNDOTBS01.DBF
channel ORA_DISK_1: restoring datafile 00004 to /oradata/orcl/USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to /oradata/orcl/TEST01.DBF
channel ORA_DISK_1: reading from backup piece E:\RMAN\BK_ORCL_938044268_38
channel ORA_DISK_1: errors found reading piece handle=E:\RMAN\BK_ORCL_938044268_38
channel ORA_DISK_1: failover to piece handle=/tmp/rmanbackup/BK_ORCL_938044268_38 tag=TAG20170307T235108
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:03:35
Finished restore at 08-MAR-17
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=938045892 file name=/oradata/orcl/SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=938045892 file name=/oradata/orcl/SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=938045892 file name=/oradata/orcl/UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=938045892 file name=/oradata/orcl/USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=938045892 file name=/oradata/orcl/TEST01.DBF
Starting recover at 08-MAR-17
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=74
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/08/2017 00:18:15
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 74 and starting SCN of 11429105
RMAN> exit
Recovery Manager complete.
至此呢,我的恢复基本算完成,我其实也可以通过resetlog的方式打开数据库,但是会有两个问题,想请教一下老师。
1、是有一个关于归档的报错,我就觉得挺不好的,而且是新加入的归档不能继续去recover,这样就导致我整个恢复过程中,数据库都不能使用,我觉得肯定是我自己做的有问题,还希望能得到老师指点;
2、我备份的时候,数据库是mount的状态下,进行备份的,如果是open的状态去备份,错误更大。
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/29/2013 17:56:31
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/u01/app/oracle/fast_recovery_area/CSDB/archivelog/2013_06_29/o1_mf_1_18_8wxctd6k_.arc'
ORA-10562: Error occurred while applying redo to data block (file# 2, block# 70876)
ORA-10564: tablespace SYSAUX
ORA-01110: data file 2: '/u01/app/oracle/oradata/csdb/sysaux01.dbf'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 70514
ORA-00600: internal error code, arguments: [6122], [0], [41668], [0], [], [], [], [], [], [], [], []
就是类似这样的错误,那文件不一定,有时候是SYSAUX这个表空间,有的时候会是SYSTEM表空间。
所以不知道自己操作的地方是不是还有不到位的地方,请老师有空的时候,帮忙指导一下。
|
|