客户的用户在10天前误删除数据,做了一次异机小版本有差别的恢复,记录如下:
源库数据库版本:10.1.0.4
目标库数据库版本:10.2.0.1
step1:download data backup file
step2.手动建立spfile参数文件
cp initorcl.ora inithdoadb.ora
inithdoadb.ora
orcl.__db_cache_size=100663296
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=54525952
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/hdoadb/adump'
*.background_dump_dest='/u01/app/oracle/admin/hdoadb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oradata/hdoadb/control01.ctl','/u01/oradata/hdoadb/control02.ctl','/u01/oradata/hdoadb/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/hdoadb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='hdoadb'
*.db_recovery_file_dest='/u01/oradata/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/hdoadb/udump'
修改相应文件
建立相应目录
mkdir -p /u01/app/oracle/admin/hdoadb/adump
mkdir -p /u01/app/oracle/admin/hdoadb/bdump
mkdir -p /u01/app/oracle/admin/hdoadb/cdump
mkdir -p /u01/app/oracle/admin/hdoadb/udump
mkdir -p /u01/app/oracle/admin/hdoadb/pfile
mkdir -p /u01/oradata/hdoadb
mkdir -p /u01/oradata/flash_recovery_area
chown -R oracle:oinstall /u01
step3 启动实例hdoadb
export ORACLE_SID=hdoadb
startup pfile='/u01/app/oracle/admin/hdoadb/pfile/inithdoadb.ora'
SQL> startup pfile='/u01/app/oracle/admin/hdoadb/pfile/inithdoadb.ora'
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
ORA-00205: error in identifying control file, check alert log for more info
step4:恢复控制文件
rman target /
[oracle@oradata pfile]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 2 13:52:07 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: orcl (not mounted)
RMAN> restore controlfile from '/u02/temp/20100716-010100.hdoadb-snapcf.ctl';
Starting restore at 02-AUG-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=/u01/oradata/hdoadb/control01.ctl
output filename=/u01/oradata/hdoadb/control02.ctl
output filename=/u01/oradata/hdoadb/control03.ctl
Finished restore at 02-AUG-10
okay,controfiel has recoverd successfully.
alter database mount;
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
sql statement: create spfile from pfile
sql 'create spfile from pfile';
RMAN> sql 'create spfile from pfile';
sql statement: create spfile from pfile
step5 backup识别备份
catalog start with '/u02/temp/'
RMAN> catalog start with '/u02/temp/';
Starting implicit crosscheck backup at 02-AUG-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 148 objects
Finished implicit crosscheck backup at 02-AUG-10
Starting implicit crosscheck copy at 02-AUG-10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 02-AUG-10
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern /u02/temp/
List of Files Unknown to the Database
=====================================
File Name: /u02/temp/20100716-010100.hdoadb-5251.bkp
File Name: /u02/temp/20100716-010100.hdoadb-5252.bkp
File Name: /u02/temp/20100716-010100.hdoadb_dump.tgz
File Name: /u02/temp/20100716-010100.hdoadb_orapw.tgz
File Name: /u02/temp/20100716-010100.hdoadb_rman.log
File Name: /u02/temp/20100716-010100.spfilehdoadb.ora
File Name: /u02/temp/20100716-010100.hdoadb-snapcf.ctl
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u02/temp/20100716-010100.hdoadb-5251.bkp
File Name: /u02/temp/20100716-010100.hdoadb-5252.bkp
File Name: /u02/temp/20100716-010100.spfilehdoadb.ora
File Name: /u02/temp/20100716-010100.hdoadb-snapcf.ctl
List of Files Which Where Not Cataloged
=======================================
File Name: /u02/temp/20100716-010100.hdoadb_dump.tgz
RMAN-07517: Reason: The file header is corrupted
File Name: /u02/temp/20100716-010100.hdoadb_orapw.tgz
RMAN-07517: Reason: The file header is corrupted
File Name: /u02/temp/20100716-010100.hdoadb_rman.log
RMAN-07517: Reason: The file header is corrupted
report schema
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** /u01/app/oracle/oradata/hdoadb/system01.dbf
2 0 UNDOTBS1 *** /u01/app/oracle/oradata/hdoadb/undotbs01.dbf
3 0 SYSAUX *** /u01/app/oracle/oradata/hdoadb/sysaux01.dbf
4 0 USERS *** /u01/app/oracle/oradata/hdoadb/users01.dbf
5 0 HDOA *** /u01/app/oracle/oradata/hdoadb/hdoa01.dbf
6 0 T_HDOA *** /u01/app/oracle/oradata/hdoadb/t_hdoa.dbf
step6:恢复脚本
run{
set newname for datafile 1
to '/u01/oradata/hdoadb/system01.dbf';
set newname for datafile 2
to '/u01/oradata/hdoadb/undotbs01.dbf';
set newname for datafile 3
to '/u01/oradata/hdoadb/sysaux01.dbf';
set newname for datafile 4
to '/u01/oradata/hdoadb/users01.dbf';
set newname for datafile 5
to '/u01/oradata/hdoadb/hdoa01.dbf';
set newname for datafile 6
to '/u01/oradata/hdoadb/t_hdoa.dbf';
restore database;
switch datafile all;
}
recover database
RMAN> recover database;
Starting recover at 02-AUG-10
using channel ORA_DISK_1
starting media recovery
........................................
media recovery complete, elapsed time: 03:20:00
Finished recover at 03-AUG-10
RMAN> alter database open resetlogs;
RMAN> exit
startup upgrade;
执行升级
dbua -silent -dbname hdoadb -oracleHome /u01/app/oracle/product/10.2.0/db_1 -sysDBAUserName sys -sysDBAPassword orcl -recompile_invalid_objects true
源库数据库版本:10.1.0.4
目标库数据库版本:10.2.0.1
step1:download data backup file
step2.手动建立spfile参数文件
cp initorcl.ora inithdoadb.ora
inithdoadb.ora
orcl.__db_cache_size=100663296
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=54525952
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/hdoadb/adump'
*.background_dump_dest='/u01/app/oracle/admin/hdoadb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oradata/hdoadb/control01.ctl','/u01/oradata/hdoadb/control02.ctl','/u01/oradata/hdoadb/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/hdoadb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='hdoadb'
*.db_recovery_file_dest='/u01/oradata/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/hdoadb/udump'
修改相应文件
建立相应目录
mkdir -p /u01/app/oracle/admin/hdoadb/adump
mkdir -p /u01/app/oracle/admin/hdoadb/bdump
mkdir -p /u01/app/oracle/admin/hdoadb/cdump
mkdir -p /u01/app/oracle/admin/hdoadb/udump
mkdir -p /u01/app/oracle/admin/hdoadb/pfile
mkdir -p /u01/oradata/hdoadb
mkdir -p /u01/oradata/flash_recovery_area
chown -R oracle:oinstall /u01
step3 启动实例hdoadb
export ORACLE_SID=hdoadb
startup pfile='/u01/app/oracle/admin/hdoadb/pfile/inithdoadb.ora'
SQL> startup pfile='/u01/app/oracle/admin/hdoadb/pfile/inithdoadb.ora'
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
ORA-00205: error in identifying control file, check alert log for more info
step4:恢复控制文件
rman target /
[oracle@oradata pfile]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 2 13:52:07 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: orcl (not mounted)
RMAN> restore controlfile from '/u02/temp/20100716-010100.hdoadb-snapcf.ctl';
Starting restore at 02-AUG-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=/u01/oradata/hdoadb/control01.ctl
output filename=/u01/oradata/hdoadb/control02.ctl
output filename=/u01/oradata/hdoadb/control03.ctl
Finished restore at 02-AUG-10
okay,controfiel has recoverd successfully.
alter database mount;
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
sql statement: create spfile from pfile
sql 'create spfile from pfile';
RMAN> sql 'create spfile from pfile';
sql statement: create spfile from pfile
step5 backup识别备份
catalog start with '/u02/temp/'
RMAN> catalog start with '/u02/temp/';
Starting implicit crosscheck backup at 02-AUG-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 148 objects
Finished implicit crosscheck backup at 02-AUG-10
Starting implicit crosscheck copy at 02-AUG-10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 02-AUG-10
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern /u02/temp/
List of Files Unknown to the Database
=====================================
File Name: /u02/temp/20100716-010100.hdoadb-5251.bkp
File Name: /u02/temp/20100716-010100.hdoadb-5252.bkp
File Name: /u02/temp/20100716-010100.hdoadb_dump.tgz
File Name: /u02/temp/20100716-010100.hdoadb_orapw.tgz
File Name: /u02/temp/20100716-010100.hdoadb_rman.log
File Name: /u02/temp/20100716-010100.spfilehdoadb.ora
File Name: /u02/temp/20100716-010100.hdoadb-snapcf.ctl
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u02/temp/20100716-010100.hdoadb-5251.bkp
File Name: /u02/temp/20100716-010100.hdoadb-5252.bkp
File Name: /u02/temp/20100716-010100.spfilehdoadb.ora
File Name: /u02/temp/20100716-010100.hdoadb-snapcf.ctl
List of Files Which Where Not Cataloged
=======================================
File Name: /u02/temp/20100716-010100.hdoadb_dump.tgz
RMAN-07517: Reason: The file header is corrupted
File Name: /u02/temp/20100716-010100.hdoadb_orapw.tgz
RMAN-07517: Reason: The file header is corrupted
File Name: /u02/temp/20100716-010100.hdoadb_rman.log
RMAN-07517: Reason: The file header is corrupted
report schema
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** /u01/app/oracle/oradata/hdoadb/system01.dbf
2 0 UNDOTBS1 *** /u01/app/oracle/oradata/hdoadb/undotbs01.dbf
3 0 SYSAUX *** /u01/app/oracle/oradata/hdoadb/sysaux01.dbf
4 0 USERS *** /u01/app/oracle/oradata/hdoadb/users01.dbf
5 0 HDOA *** /u01/app/oracle/oradata/hdoadb/hdoa01.dbf
6 0 T_HDOA *** /u01/app/oracle/oradata/hdoadb/t_hdoa.dbf
step6:恢复脚本
run{
set newname for datafile 1
to '/u01/oradata/hdoadb/system01.dbf';
set newname for datafile 2
to '/u01/oradata/hdoadb/undotbs01.dbf';
set newname for datafile 3
to '/u01/oradata/hdoadb/sysaux01.dbf';
set newname for datafile 4
to '/u01/oradata/hdoadb/users01.dbf';
set newname for datafile 5
to '/u01/oradata/hdoadb/hdoa01.dbf';
set newname for datafile 6
to '/u01/oradata/hdoadb/t_hdoa.dbf';
restore database;
switch datafile all;
}
recover database
RMAN> recover database;
Starting recover at 02-AUG-10
using channel ORA_DISK_1
starting media recovery
........................................
media recovery complete, elapsed time: 03:20:00
Finished recover at 03-AUG-10
RMAN> alter database open resetlogs;
RMAN> exit
startup upgrade;
执行升级
dbua -silent -dbname hdoadb -oracleHome /u01/app/oracle/product/10.2.0/db_1 -sysDBAUserName sys -sysDBAPassword orcl -recompile_invalid_objects true
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14178352/viewspace-670057/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14178352/viewspace-670057/