Download Oracle 11g R2 RAC数据库备份通过RMAN恢复到单实例数据库实现

Document related concepts

Database wikipedia , lookup

Relational model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Oracle Database wikipedia , lookup

Transcript
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
一、 Oracle 11g R2 RAC 数据库备份通过 RMAN 恢复到单实例数据库实现
下面是我的一次从 Oracle 11g R2 RAC 到单实例间通过 RMAN 恢复备份集的过程,记录在此。
有些人以此方法作为 RMAN 备份有效性校验,当然我不反对这个说法,但我也相信 RMAN 提供的备份有效性校验方法
操作环境:
Source DB: 2-Node Oracle Database 11g R2 RAC On Linux(11.2.0.1 with ASM)
Target DB: Single Instance Database 11g R2 On Linux(11.2.0.1 with FileSystem)
(利用 EBS 做一份 DB 克隆出来,否则会很麻烦 记得添加环境变量./u01/PROD/db/tech_st/11.2.0/PROD_sing.env)
几点说明:
(1)RMAN 异机恢复的时候,db_name 必须相同。 如果说要想改成其他的实例名,可以在恢复成功后,用 nid 命令修改。 实例名的信息会记录到控制文
件里,所以如果在恢复的时候,如果实例名不一致,恢复的时候会报错。
(2)如果恢复的路径和源库不一致,就需要在 restore 时用 set 命令指定新位置。 并且使用 switch datafile all 将信息更新的到控制文件。
在做 duplicate 的时候,RMAN 会自动根据 pfile 中的 log_file_name_convert 和 db_file_name_convert 来进行 set 的转换。 手工 restore 时,只能使用 set
第 1 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
命令。
(3)异机恢复对相同目录和不同目录都做了说明。
(4)target 库应该用 EBS 的 DB 克隆一份,SID 要和 source 的 SID 相同。
(5)最后测试了 NID 修改 DBID 和 DBNAME.
目标端数据库环境介绍:
[root@sing ~]# hostname
sing
[root@sing ~]# df -h
Filesystem
Size Used Avail Use% Mounted on
/dev/cciss/c0d0p1 388G 9.1G 359G 3% /
/dev/cciss/c0d0p3 421G 2.6G 397G 1% /data
tmpfs
5.9G 0 5.9G 0% /dev/shm
– 目标端磁盘空间需要充足,至少要比源端所有数据文件大小还大。
源端与目标端环境已准备好,下面开始进入操作。
1) 将源端的一个 FULL BACKUPSET 拷贝到目标端
我在目标端创建/u01/BAK/03 目录,将备份文件放于这里
第 2 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
先查询 source 的 DBID
SQL> select name,dbid from v$database;
NAME
DBID
--------- ---------PROD
319809176
备份脚本:(这里我没用 catalog)
backup_full.sh
export DATE=`date +"%Y%m%d_%H%M%S"`
$ORACLE_HOME/bin/rman
target /
rman/rman@RMAN cmdfile=/u01/BAK/backup_full.rcv log=/u01/BAK/bk_$DATE.log
backup_full.rcv
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
RUN {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
第 3 页
共 80 页
catalog
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
allocate channel ch3 type disk;
allocate channel ch4 type disk;
BACKUP database include current controlfile format '/u01/BAK/bk_file/uat_df%d_%T_
%U.bak' tag='FULLDB';
sql 'alter system archive log current';
BACKUP ARCHIVELOG ALL FORMAT '/u01/BAK/bk_file/uat_arch_%U_%T'TAG='ARCHIVELOG';
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
backup current controlfile tag='bak_ctlfile' format='/u01/BAK/bk_file/uat_ctl_%U_
%T';
backup spfile tag='spfile' format='/u01/BAK/bk_file/uat_spfile_%U_%T';
release channel ch4;
release channel ch3;
release channel ch2;
release channel ch1;
}
RESYNC CATALOG;
exit;
将备份文件通过 scp 传送到 target 环境
[root@erpdev ~]# cd /u03/2016/03
[root@erpdev 03]# ls
wyp_arch_8sqvbpuo_1_1_20160301 wyp_ctl_90qvbq9c_1_1_20160301
wyp_dfPROD_20160301_8qqvbpft_1_1.bak
wyp_arch_8tqvbpuo_1_1_20160301 wyp_dfPROD_20160301_8oqvbo9j_1_1.bak
wyp_spfile_91qvbq9f_1_1_20160301
第 4 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
wyp_arch_8uqvbq8t_1_1_20160301 wyp_dfPROD_20160301_8pqvbo9j_1_1.bak
[root@erpdev 01]# cd ..
[root@erpdev 2016]# scp -r 01 [email protected]:/u01/BAK/03
[root@sing ~]# mkdir /u01/BAK/03
[root@sing ~]# chown -R oraprod:dba /u01/BAK/03(切记要执行)
异机拷贝使用 ftp 方式也可以,略。(没有尝试 NFS)
我这里备份文件已打包,所以在目标端进行解压
2) 从备份中恢复参数文件
在动现场之前保留一份源文件
[oraprod@sing dbs]$ pwd
/u01/PROD/db/tech_st/11.2.0/dbs
[oraprod@sing dbs]$
[oraprod@sing dbs]$cp -p spfilePROD.ora spfilePROD.ora.bak
将数据库启动到 nomount 状态
SQL> startup nomount
ORACLE instance started.
第 5 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Total System Global Area 5077495808 bytes
Fixed Size
2212976 bytes
Variable Size
3288337296 bytes
Database Buffers
1744830464 bytes
Redo Buffers
42115072 bytes
通过 RMAN 工具还原出参数文件,还原出初始化参数文件
RMAN> restore spfile to pfile '/u01/PROD/db/tech_st/11.2.0/dbs/initPROD.ora' from '/u01/BAK/03/wyp_spfile_91qvbq9f_1_1_20160301';
Starting restore at 29-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=102 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/BAK/03/wyp_spfile_91qvbq9f_1_1_20160301
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 29-MAR-16
3)
编辑初始化参数文件,相应地创建所需目录
[oracle@luocs dbs]$ cp -p initPROD.ora initPROD.ora.bak
第 6 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
我们恢复过来的参数文件是 RAC 的,所以我们要改成符合单实例数据库
[oracle@luocs dbs]$ cat inithkrt.ora
#hkrt1.__db_cache_size=4362076160
#hkrt2.__db_cache_size=5972688896
#hkrt1.__java_pool_size=67108864
#hkrt2.__java_pool_size=67108864
#hkrt1.__large_pool_size=67108864
#hkrt2.__large_pool_size=67108864
#hkrt1.__pga_aggregate_target=7381975040
#hkrt2.__pga_aggregate_target=6710886400
#hkrt1.__sga_target=9395240960
#hkrt2.__sga_target=10066329600
#hkrt1.__shared_io_pool_size=0
#hkrt2.__shared_io_pool_size=0
#hkrt1.__shared_pool_size=4630511616
#hkrt2.__shared_pool_size=3825205248
#hkrt2.__streams_pool_size=0
#hkrt1.__streams_pool_size=134217728
*.audit_file_dest='/u01/app/oracle/admin/hkrt/adump'
*.audit_trail='db'
第 7 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/hkrt/control01.dbf','/u01/app/oracle/oradata/hkrt/control02.dbf'
*.db_block_size=8192
#*.db_create_file_dest='+ASMDATA'
*.db_domain=''
*.db_name='hkrt'
#*.db_recovery_file_dest='+RECOVERY'
#*.db_recovery_file_dest_size=47185920000
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=hkrtXDB)'
#hkrt2.instance_number=2
#hkrt1.instance_number=1
#hkrt1.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01-vip.hkrt.com)(PORT=1521))))'
#hkrt2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip.hkrt.com)(PORT=1521))))'
*.log_archive_dest_1='LOCATION=/u01/arch'
#*.log_archive_dest_2='LOCATION=+ARCH'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=5034213376
*.open_cursors=300
*.processes=400
第 8 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#*.remote_listener='scan-cluster:1521'
*.remote_login_passwordfile='exclusive'
#hkrt2.thread=2
#hkrt1.thread=1
#hkrt1.undo_tablespace='UNDOTBS1'
#hkrt2.undo_tablespace='UNDOTBS2'
*.undo_tablespace='UNDOTBS1'
(具体参照 initPROD.ora)
+++++++++++++++++++++
焦黄色为注释 蓝色是还没确定 红色是新添加 绿色为修改的
修改的参数有: audit_file_dest, background_dump_dest, core_dump_dest,user_dump_dest, log_archive_dest_1 等,
与路径有关的参数,修改为你单实例环境的对应路径。如:
background_dump_dest=/u01/oracle/ora/9.2.0/admin/DEV_dbtest/bdump
重要的: 移除 cluster_database_instances,cluster_database 参数,因为恢复到的是单实例环境。
移除一个 UNDO_TABLESPACE 设置,这里假设保留的是 APPS_UNDOTBS1
我的方法是有些拿不定注意的看看测试环境是怎样设置的
SQL> show parameter audit_file_dest;
NAME
TYPE
VALUE
------------------------------------ ----------- -----------------------------audit_file_dest
string
第 9 页
/u01/TEST/db/tech_st/11.2.0/rdbms/audit
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
###############################
#PROD.__db_cache_size=7734296576
#PROD2.__db_cache_size=33420214272
#PROD1.__db_cache_size=35836133376
#PROD.__java_pool_size=100663296
#PROD2.__java_pool_size=805306368
#PROD1.__java_pool_size=805306368
#PROD.__large_pool_size=33554432
#PROD2.__large_pool_size=134217728
#PROD1.__large_pool_size=134217728
#PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
#PROD1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
#PROD2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
#PROD.__pga_aggregate_target=1073741824
#PROD2.__pga_aggregate_target=1073741824
#PROD1.__pga_aggregate_target=1073741824
#PROD.__sga_target=8589934592
#PROD2.__sga_target=51539607552
#PROD1.__sga_target=51539607552
#PROD.__shared_io_pool_size=0
#PROD2.__shared_io_pool_size=0
第 10 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#PROD1.__shared_io_pool_size=0
#PROD.__shared_pool_size=654311424
#PROD2.__shared_pool_size=16911433728
#PROD1.__shared_pool_size=14495514624
#PROD.__streams_pool_size=0
#PROD2.__streams_pool_size=0
#PROD1.__streams_pool_size=0
*.audit_file_dest='/u01/PROD/db/tech_st/11.2.0/rdbms/audit'
#*.audit_trail='db'??
#*.cluster_database=TRUE
*.compatible='11.2.0.2.0'
*.control_files='/u01/PROD/db/apps_st/data/cntrl01.dbf','/u01/PROD/db/apps_st/data/cntrl02.dbf','/u01/PROD/db/apps_st/data/cntrl03.dbf'#Restore
Controlfile
#*.control_files='+DATAC1/prod/controlfile/current.301.863906649'#Restore Controlfile
*.db_block_size=8192
#*.db_create_file_dest='+DATAC1'
#*.db_domain=''
*.db_name='PROD'
#*.db_recovery_file_dest='+DATAC1'
#*.db_recovery_file_dest_size=536870912000
*.diagnostic_dest='/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing'
第 11 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#*.dispatchers='(PROTOCOL=TCP) (SERVICE=hkrtXDB)'
#PROD1.instance_number=1
#PROD2.instance_number=2
#hkrt1.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01-vip.hkrt.com)(PORT=1521))))'
#hkrt2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip.hkrt.com)(PORT=1521))))'
*.log_archive_dest_1='location=/u01/PROD/db/apps_st/data/archive'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=5034213376
*.open_cursors=2000
*.processes=2000
#*.remote_listener='dm01-scan:1521'
#*.remote_login_passwordfile='exclusive'
#PROD1.thread=1
#PROD2.thread=2
#PROD1.undo_tablespace='APPS_UNDOTS1'
#PROD2.undo_tablespace='UNDOTBS2'
*.undo_tablespace='APPS_UNDOTS1'
*.sessions=4000
*.background_dump_dest='/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/trace'
*.core_dump_dest='/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/cdump'
*.user_dump_dest='/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/trace'
第 12 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#PROD1.core_dump_dest='/u01/app/oracle/product/11.2.0.4/dbhome_1/admin/PROD_dm01db01/diag/rdbms/prod/PROD1/cdump'
#PROD2.core_dump_dest='/u01/app/oracle/product/11.2.0.4/dbhome_1/admin/PROD_dm01db01/diag/rdbms/prod/PROD2/cdump'
*.max_dump_file_size='20480'# trace file size
*.utl_file_dir='/usr/tmp','/u01/PROD/db/tech_st/11.2.0/appsutil/outbound/PROD_sing', '/u01/PROD/temp'
*.db_files=512# Max. no. of database files
#*._immediate_commit_propagation=TRUE
#*._lm_global_posts=TRUE
#*._optimizer_autostats_job=false# Turning off auto statistics
#*._system_trig_enabled=TRUE
#*._TRACE_FILES_PUBLIC=FALSE
#*.aq_tm_processes=1
#*.AUDIT_SYS_OPERATIONS=TRUE
#*.cursor_sharing='EXACT'# Required 11i settting
#*.db_block_checking='FALSE'
#*.db_block_checksum='TRUE'
#*.db_flashback_retention_target=720
#*.dg_broker_start=FALSE
#*.dml_locks=10000
#*.java_jit_enabled=FALSE
#*.job_queue_processes=1000
#*.log_buffer=10485760
第 13 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#*.log_checkpoint_interval=100000
#*.log_checkpoint_timeout=1200# Checkpoint at least every 20 mins.
#*.log_checkpoints_to_alert=TRUE
#*.nls_comp='binary'# Required 11i setting
#*.nls_date_format='DD-MON-RR'
#*.nls_length_semantics='BYTE'# Required 11i setting
#*.nls_numeric_characters='.,'
#*.nls_sort='binary'# Required 11i setting
#*.nls_territory='america'
#*.olap_page_pool_size=4194304
#*.optimizer_secure_view_merging=FALSE
#*.OS_AUTHENT_PREFIX=''
#*.parallel_max_servers=8
#*.parallel_min_servers=0
#*.pga_aggregate_target=1G
#*.plsql_code_type='INTERPRETED'# Default 11i setting
#*.plsql_optimize_level=2# Required 11i setting
#*.sec_case_sensitive_logon=FALSE
#*.session_cached_cursors=500
#*.sga_max_size=51539607552
#*.sga_target=51539607552
第 14 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
#*.shared_pool_reserved_size=40M
#*.shared_pool_size=400M
#*.SQL92_SECURITY=TRUE
#*.undo_management='AUTO'# Required 11i setting
#*.workarea_size_policy='AUTO'# Required 11i setting
++++++++++++++++++++++
a 创建相应归档日志的存放位置(克隆后自己创建)
[root@luocs ~]# mkdir /u01/TEST/db/apps_st/data/archive
[root@luocs ~]# chown oraprod:dba /u01/TEST/db/apps_st/data/archive
-- 存放归档日志文件
b -- 创建审计跟踪文件存放位置(克隆后自己创建)
[root@luocs ~]# mkdir /u01/app/oracle/admin/hkrt/adump -p
[root@luocs ~]# chown -R oracle.oinstall /u01/app/oracle/admin/hkrt
-- 存放审计跟踪文件相关参数
background_core_dump
string
partial
background_dump_dest
string
/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/trace
core_dump_dest
string
/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/cdump
max_dump_file_size
string
20480
shadow_core_dump
string
partial
第 15 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
user_dump_dest
QQ:107132494
TEL:15117148688
string
/u01/PROD/db/tech_st/11.2.0/admin/PROD_sing/diag/rdbms/prod/PROD/trace
c -- 创建数据文件的存放位置(克隆后自己创建)
[root@luocs ~]# mkdir /u01/PROD/db/apps_st/data
[root@luocs ~]# chown oraprod:dba /u01/PROD/db/apps_st/data
-- 存放数据文件
4)
通过编辑好的初始化参数重启数据库到 NOMOUNT
SQL> shutdown immediate
/u01/PROD/db/tech_st/11.2.0/dbs/spfilePROD.ora
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create spfile from pfile;
create pfile from spfile;
File created.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 5077495808 bytes
Fixed Size
2212976 bytes
第 16 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
Variable Size
3288337296 bytes
Database Buffers
1744830464 bytes
Redo Buffers
QQ:107132494
TEL:15117148688
42115072 bytes
出现错误提示信息"ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance"。查看 background_dump_dest 和
user_dump_dest 两个参数,发现没有变更成功。
删除参数文件中的 background_dump_dest 和 user_dump_dest 两个参数,并重启数据库。数据库正常运行。
阅读 11g 官方文档,发现 background_dump_dest 和 user_dump_dest 两个参数在 11 中废弃了,由新参数 diagnostic_dest 所取代。以下是参
数说明:
USER_DUMP_DEST
USER_DUMP_DEST specifies the pathname for a directory where the server will write debugging trace files on
behalf of a user process.
NOTE
This parameter is ignored by the new diagnosability infrastructure introduced in Oracle Database 11g
Release 1, which places trace and core files in a location controlled by the DIAGNOSTIC_DEST initialization
parameter.
BACKGROUND_DUMP_DEST
BACKGROUND_DUMP_DEST specifies the pathname (directory or disc) where debugging trace files for the background
processes (LGWR, DBWn, and so on) are written during Oracle operations. An alert file in the directory
specified by BACKGROUND_DUMP_DEST logs significant database events and messages. Anything that affects the
database instance or global database is recorded here. The alert file is a normal text file. Its filename is
operating system-dependent. For platforms that support multiple instances, it takes the form alert_sid.log,
where sid is the system identifier. This file grows slowly, but without limit, so you might want to delete it
periodically. You can delete the file even when the database is running.
NOTE
第 17 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
This parameter is ignored by the new diagnosability infrastructure introduced in Oracle Database 11g
Release 1, which places trace and core files in a location controlled by the DIAGNOSTIC_DEST initialization
parameter.
DIAGNOSTIC_DEST
As of Oracle Database 11g Release 1, the diagnostics for each database instance are located in a dedicated
directory, which can be specified through the DIAGNOSTIC_DEST initialization parameter. The structure of the
directory specified by DIAGNOSTIC_DEST is as follows:
<diagnostic_dest>/diag/rdbms/<dbname>/<instname>
This location is known as the Automatic Diagnostic Repository (ADR) Home.For example, if the database name is
proddb and the instance name is proddb1, the ADR home directory would be
diagnostic_dest>/diag/rdbms/proddb/proddb1.
The following files are located under the ADR home directory:
Trace files - located in subdirectory <adr-home>/trace
Alert logs - located in subdirectory <adr-home>/alert. In addition, the alert.log file is now in XML format,
which conforms to the Oracle ARB logging standard.
Core files - located in the subdirectory <adr-home>/cdumd
Incident files - the occurrence of each serious error (for example, ORA-600, ORA-1578,ORA-7445) causes an
incident to be created. Each incident is assigned an ID and dumping for each incident (error stack, call
stack, block dumps, and so on) is stored in its own file, separated from process trace files. Incident dump
files are located in <adr-home>/incident/<incdir#>. You can find the incident dump file location inside the
process trace file.
第 18 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
5)
QQ:107132494
TEL:15117148688
从备份集还原控制文件
我们从备份集里还原出控制文件
RMAN> restore controlfile from '/u01/BAK/03/wyp_ctl_90qvbq9c_1_1_20160301';
Starting restore at 29-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1002 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/PROD/db/apps_st/data/cntrl01.dbf
output file name=/u01/PROD/db/apps_st/data/cntrl02.dbf
output file name=/u01/PROD/db/apps_st/data/cntrl03.dbf
Finished restore at 29-MAR-16
将数据库启动到 MOUNT 状态
RMAN> mount database;
database mounted
released channel: ORA_DISK_1
RMAN> mount database;
第 19 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
6)
QQ:107132494
TEL:15117148688
将备份集注册进控制文件里
RMAN> catalog start with '/u01/BAK/03/';
查出 catalog 的 scn 号
searching for all files that match the pattern /u01/BAK/03/
List of Files Unknown to the Database
=====================================
File Name: /u01/BAK/03/wyp_arch_8tqvbpuo_1_1_20160301
File Name: /u01/BAK/03/wyp_spfile_91qvbq9f_1_1_20160301
File Name: /u01/BAK/03/wyp_arch_8uqvbq8t_1_1_20160301
File Name: /u01/BAK/03/wyp_ctl_90qvbq9c_1_1_20160301
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8oqvbo9j_1_1.bak
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8qqvbpft_1_1.bak
File Name: /u01/BAK/03/wyp_arch_8sqvbpuo_1_1_20160301
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8pqvbo9j_1_1.bak
Do you really want to catalog the above files (enter YES or NO)? YES
第 20 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/BAK/03/wyp_arch_8tqvbpuo_1_1_20160301
File Name: /u01/BAK/03/wyp_spfile_91qvbq9f_1_1_20160301
File Name: /u01/BAK/03/wyp_arch_8uqvbq8t_1_1_20160301
File Name: /u01/BAK/03/wyp_ctl_90qvbq9c_1_1_20160301
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8oqvbo9j_1_1.bak
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8qqvbpft_1_1.bak
File Name: /u01/BAK/03/wyp_arch_8sqvbpuo_1_1_20160301
File Name: /u01/BAK/03/wyp_dfPROD_20160301_8pqvbo9j_1_1.bak
可以通过 list backup;查看#找出最大的 scn 并记录,略。
BS Key Type LV Size
Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------2210
Full
33.80M
DISK
第 21 页
00:00:00
01-MAR-16
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
BP Key: 2212
Status: AVAILABLE
QQ:107132494
TEL:15117148688
Compressed: NO Tag: BAK_CTLFILE
Piece Name: /u01/BAK/03/wyp_ctl_90qvbq9c_1_1_20160301
Control File Included: Ckp SCN: 5967364936377
7)
Ckp time: 01-MAR-16crosscheck backup;
确认数据文件、联机日志文件、临时文件路径
SQL> set pagesize 9999
SQL> col NAME for a65
select 'set newname
for datafile '||chr(39)||name||chr(39)||' to
'||chr(39)||replace(name,'+DG0/db/datafile/','/home/oracle/data2/')||chr(39)||';' from v$datafile;
SQL> select file#,name from v$datafile;
FILE# NAME
---------- ----------------------------------------------------------------1 +DATAC1/prod/datafile/system.325.863906561
2 +DATAC1/prod/datafile/system.324.863906563
3 +DATAC1/prod/datafile/system.323.863906563
4 +DATAC1/prod/datafile/system.322.863906565
5 +DATAC1/prod/datafile/system.321.863906567
6 +DATAC1/prod/datafile/ctxd.282.863906501
7 +DATAC1/prod/datafile/owapub.303.863906585
第 22 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
8 +DATAC1/prod/datafile/apps_ts_queues.314.863906573
9 +DATAC1/prod/datafile/odm.304.863906585
10 +DATAC1/prod/datafile/olap.306.863906581
11 +DATAC1/prod/datafile/sysaux.309.863906579
12 +DATAC1/prod/datafile/apps_ts_tools.313.863906575
13 +DATAC1/prod/datafile/system.337.863906533
14 +DATAC1/prod/datafile/apps_ts_tx_data.340.863906523
15 +DATAC1/prod/datafile/apps_ts_tx_idx.328.863906557
16 +DATAC1/prod/datafile/apps_ts_seed.310.863906577
17 +DATAC1/prod/datafile/apps_ts_interface.305.863906583
18 +DATAC1/prod/datafile/sysaux.319.863906569
19 +DATAC1/prod/datafile/apps_ts_tx_data.346.863906505
20 +DATAC1/prod/datafile/cux_data.345.863906509
21 +DATAC1/prod/datafile/cux_idx.312.863906575
22 +DATAC1/prod/datafile/undotbs2.284.863906907
23 +DATAC1/prod/datafile/apps_ts_seed.281.864494847
24 +DATAC1/prod/datafile/apps_ts_media.280.864494881
25 +DATAC1/prod/datafile/sysaux.279.864494911
26 +DATAC1/prod/datafile/apps_ts_tx_idx.278.867173535
27 +DATAC1/prod/datafile/apps_ts_tx_idx.277.868353677
28 +DATAC1/prod/datafile/apps_ts_tx_idx.256.877350813
第 23 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
29 +DATAC1/prod/datafile/apps_ts_tx_data.272.877350929
30 +DATAC1/prod/datafile/apps_ts_seed.262.877353005
31 +DATAC1/prod/datafile/undotbs2.258.877355669
32 +DATAC1/prod/datafile/apps_ts_interface.257.877357467
33 +DATAC1/prod/datafile/apps_ts_tools.264.878826923
34 +DATAC1/prod/datafile/olap.263.878826927
35 +DATAC1/prod/datafile/portal.261.878826931
36 +DATAC1/prod/datafile/owapub.274.878826933
37 +DATAC1/prod/datafile/ctxd.275.878826935
38 +DATAC1/prod/datafile/apps_undots1.270.879205155
39 +DATAC1/prod/datafile/apps_ts_tx_data.269.879206041
40 +DATAC1/prod/datafile/undotbs2.268.880189069
41 +DATAC1/prod/datafile/apps_undots1.276.880189115
42 +DATAC1/prod/datafile/system.260.880189275
43 +DATAC1/prod/datafile/apps_ts_tx_idx.286.880189307
44 +DATAC1/prod/datafile/apps_ts_summary.287.880189339
45 +DATAC1/prod/datafile/odm.288.880189381
46 +DATAC1/prod/datafile/apps_undots1.290.885292299
47 +DATAC1/prod/datafile/apps_ts_archive.291.886936917
48 +DATAC1/prod/datafile/undotbs2.292.887623371
49 +DATAC1/prod/datafile/apps_undots1.293.887623391
第 24 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
50 +DATAC1/prod/datafile/apps_ts_media.294.891275759
51 +DATAC1/prod/datafile/cux_data.295.891275859
52 +DATAC1/prod/datafile/apps_ts_nologging.296.891364961
53 +DATAC1/prod/datafile/cux_idx.297.895164995
54 +DATAC1/prod/datafile/apps_ts_tx_data.298.897926247
55 +DATAC1/prod/datafile/apps_ts_summary.299.897926307
288 +DATAC1/prod/datafile/system.315.863906573
295 +DATAC1/prod/datafile/system.318.863906569
314 +DATAC1/prod/datafile/portal.308.863906579
351 +DATAC1/prod/datafile/system.317.863906571
352 +DATAC1/prod/datafile/system.344.863906511
353 +DATAC1/prod/datafile/system.342.863906517
354 +DATAC1/prod/datafile/system.316.863906571
379 +DATAC1/prod/datafile/apps_undots1.339.863906527
392 +DATAC1/prod/datafile/apps_ts_tx_data.332.863906549
393 +DATAC1/prod/datafile/apps_ts_tx_idx.329.863906553
394 +DATAC1/prod/datafile/apps_ts_seed.335.863906539
395 +DATAC1/prod/datafile/apps_ts_interface.326.863906561
396 +DATAC1/prod/datafile/apps_ts_summary.330.863906553
397 +DATAC1/prod/datafile/apps_ts_nologging.307.863906581
398 +DATAC1/prod/datafile/apps_ts_archive.320.863906567
第 25 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
399 +DATAC1/prod/datafile/apps_ts_queues.311.863906577
400 +DATAC1/prod/datafile/apps_ts_media.334.863906543
401 +DATAC1/prod/datafile/apps_ts_tx_data.338.863906531
402 +DATAC1/prod/datafile/apps_ts_tx_data.333.863906545
403 +DATAC1/prod/datafile/apps_ts_tx_idx.336.863906537
404 +DATAC1/prod/datafile/apps_ts_tx_idx.327.863906557
405 +DATAC1/prod/datafile/apps_ts_tx_idx.341.863906521
406 +DATAC1/prod/datafile/apps_ts_tx_idx.343.863906515
407 +DATAC1/prod/datafile/apps_ts_seed.331.863906551
79 rows selected.
13 rows selected.
SQL> col MEMBER for a65
SQL> select member from v$logfile;
select 'alter database rename file
'||chr(39)||member||chr(39)||' to
'||chr(39)||replace(member,'+DG0/db/onlinelog/','/home/oracle/data2/')||chr(39)||';' from v$logfile;
MEMBER
----------------------------------------------------------------+DATAC1/prod/onlinelog/group_1.271.863906745
第 26 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
+DATAC1/prod/onlinelog/group_2.266.863906745
+DATAC1/prod/onlinelog/group_3.259.863906747
+DATAC1/prod/onlinelog/group_4.285.863906749
SQL> select name from v$tempfile;--(记得别丢了临时文件)
NAME
-----------------------------------------------------------------
+DATAC1/prod/tempfile/temp1.273.863906849
+DATAC1/prod/tempfile/temp2.283.863906849
清除之前的 dbfile
cd /u01/PROD/db/apps_st/data/
rm -rf *.dbf
8)
通过 RMAN 重命名数据文件和临时文件,进行还原
第 27 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
RMAN>
RUN {
SET NEWNAME FOR DATAFILE 1 to '/u01/PROD/db/apps_st/data/system.325.863906561';
SET NEWNAME FOR DATAFILE 2 to '/u01/PROD/db/apps_st/data/system.324.863906563';
SET NEWNAME FOR DATAFILE 3 to '/u01/PROD/db/apps_st/data/system.323.863906563';
SET NEWNAME FOR DATAFILE 4 to '/u01/PROD/db/apps_st/data/system.322.863906565';
SET NEWNAME FOR DATAFILE 5 to '/u01/PROD/db/apps_st/data/system.321.863906567';
SET NEWNAME FOR DATAFILE 6 to '/u01/PROD/db/apps_st/data/ctxd.282.863906501';
SET NEWNAME FOR DATAFILE 7 to '/u01/PROD/db/apps_st/data/owapub.303.863906585';
SET NEWNAME FOR DATAFILE 8 to '/u01/PROD/db/apps_st/data/apps_ts_queues.314.863906573';
SET NEWNAME FOR DATAFILE 9 to '/u01/PROD/db/apps_st/data/odm.304.863906585';
SET NEWNAME FOR DATAFILE 10 to '/u01/PROD/db/apps_st/data/olap.306.863906581';
SET NEWNAME FOR DATAFILE 11 to '/u01/PROD/db/apps_st/data/sysaux.309.863906579';
SET NEWNAME FOR DATAFILE 12 to '/u01/PROD/db/apps_st/data/apps_ts_tools.313.863906575';
SET NEWNAME FOR DATAFILE 13 to '/u01/PROD/db/apps_st/data/system.337.863906533';
SET NEWNAME FOR DATAFILE 14 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.340.863906523';
SET NEWNAME FOR DATAFILE 15 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.328.863906557';
SET NEWNAME FOR DATAFILE 16 to '/u01/PROD/db/apps_st/data/apps_ts_seed.310.863906577';
SET NEWNAME FOR DATAFILE 17 to '/u01/PROD/db/apps_st/data/apps_ts_interface.305.863906583';
SET NEWNAME FOR DATAFILE 18 to '/u01/PROD/db/apps_st/data/sysaux.319.863906569';
SET NEWNAME FOR DATAFILE 19 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.346.863906505';
SET NEWNAME FOR DATAFILE 20 to '/u01/PROD/db/apps_st/data/cux_data.345.863906509';
第 28 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SET NEWNAME FOR DATAFILE 21 to '/u01/PROD/db/apps_st/data/cux_idx.312.863906575';
SET NEWNAME FOR DATAFILE 22 to '/u01/PROD/db/apps_st/data/undotbs2.284.863906907';
SET NEWNAME FOR DATAFILE 23 to '/u01/PROD/db/apps_st/data/apps_ts_seed.281.864494847';
SET NEWNAME FOR DATAFILE 24 to '/u01/PROD/db/apps_st/data/apps_ts_media.280.864494881';
SET NEWNAME FOR DATAFILE 25 to '/u01/PROD/db/apps_st/data/sysaux.279.864494911';
SET NEWNAME FOR DATAFILE 26 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.278.867173535';
SET NEWNAME FOR DATAFILE 27 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.277.868353677';
SET NEWNAME FOR DATAFILE 28 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.256.877350813';
SET NEWNAME FOR DATAFILE 29 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.272.877350929';
SET NEWNAME FOR DATAFILE 30 to '/u01/PROD/db/apps_st/data/apps_ts_seed.262.877353005';
SET NEWNAME FOR DATAFILE 31 to '/u01/PROD/db/apps_st/data/undotbs2.258.877355669';
SET NEWNAME FOR DATAFILE 32 to '/u01/PROD/db/apps_st/data/apps_ts_interface.257.877357467';
SET NEWNAME FOR DATAFILE 33 to '/u01/PROD/db/apps_st/data/apps_ts_tools.264.878826923';
SET NEWNAME FOR DATAFILE 34 to '/u01/PROD/db/apps_st/data/olap.263.878826927';
SET NEWNAME FOR DATAFILE 35 to '/u01/PROD/db/apps_st/data/portal.261.878826931';
SET NEWNAME FOR DATAFILE 36 to '/u01/PROD/db/apps_st/data/owapub.274.878826933';
SET NEWNAME FOR DATAFILE 37 to '/u01/PROD/db/apps_st/data/ctxd.275.878826935';
SET NEWNAME FOR DATAFILE 38 to '/u01/PROD/db/apps_st/data/apps_undots1.270.879205155';
SET NEWNAME FOR DATAFILE 39 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.269.879206041';
SET NEWNAME FOR DATAFILE 40 to '/u01/PROD/db/apps_st/data/undotbs2.268.880189069';
SET NEWNAME FOR DATAFILE 41 to '/u01/PROD/db/apps_st/data/apps_undots1.276.880189115';
SET NEWNAME FOR DATAFILE 42 to '/u01/PROD/db/apps_st/data/system.260.880189275';
SET NEWNAME FOR DATAFILE 43 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.286.880189307';
SET NEWNAME FOR DATAFILE 44 to '/u01/PROD/db/apps_st/data/apps_ts_summary.287.880189339';
SET NEWNAME FOR DATAFILE 45 to '/u01/PROD/db/apps_st/data/odm.288.880189381';
SET NEWNAME FOR DATAFILE 46 to '/u01/PROD/db/apps_st/data/apps_undots1.290.885292299';
第 29 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SET NEWNAME FOR DATAFILE 47 to '/u01/PROD/db/apps_st/data/apps_ts_archive.291.886936917';
SET NEWNAME FOR DATAFILE 48 to '/u01/PROD/db/apps_st/data/undotbs2.292.887623371';
SET NEWNAME FOR DATAFILE 49 to '/u01/PROD/db/apps_st/data/apps_undots1.293.887623391';
SET NEWNAME FOR DATAFILE 50 to '/u01/PROD/db/apps_st/data/apps_ts_media.294.891275759';
SET NEWNAME FOR DATAFILE 51 to '/u01/PROD/db/apps_st/data/cux_data.295.891275859';
SET NEWNAME FOR DATAFILE 52 to '/u01/PROD/db/apps_st/data/apps_ts_nologging.296.891364961';
SET NEWNAME FOR DATAFILE 53 to '/u01/PROD/db/apps_st/data/cux_idx.297.895164995';
SET NEWNAME FOR DATAFILE 54 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.298.897926247';
SET NEWNAME FOR DATAFILE 55 to '/u01/PROD/db/apps_st/data/apps_ts_summary.299.897926307';
SET NEWNAME FOR DATAFILE 288 to '/u01/PROD/db/apps_st/data/system.315.863906573';
SET NEWNAME FOR DATAFILE 295 to '/u01/PROD/db/apps_st/data/system.318.863906569';
SET NEWNAME FOR DATAFILE 314 to '/u01/PROD/db/apps_st/data/portal.308.863906579';
SET NEWNAME FOR DATAFILE 351 to '/u01/PROD/db/apps_st/data/system.317.863906571';
SET NEWNAME FOR DATAFILE 352 to '/u01/PROD/db/apps_st/data/system.344.863906511';
SET NEWNAME FOR DATAFILE 353 to '/u01/PROD/db/apps_st/data/system.342.863906517';
SET NEWNAME FOR DATAFILE 354 to '/u01/PROD/db/apps_st/data/system.316.863906571';
SET NEWNAME FOR DATAFILE 379 to '/u01/PROD/db/apps_st/data/apps_undots1.339.863906527';
SET NEWNAME FOR DATAFILE 392 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.332.863906549';
SET NEWNAME FOR DATAFILE 393 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.329.863906553';
SET NEWNAME FOR DATAFILE 394 to '/u01/PROD/db/apps_st/data/apps_ts_seed.335.863906539';
SET NEWNAME FOR DATAFILE 395 to '/u01/PROD/db/apps_st/data/apps_ts_interface.326.863906561';
SET NEWNAME FOR DATAFILE 396 to '/u01/PROD/db/apps_st/data/apps_ts_summary.330.863906553';
SET NEWNAME FOR DATAFILE 397 to '/u01/PROD/db/apps_st/data/apps_ts_nologging.307.863906581';
SET NEWNAME FOR DATAFILE 398 to '/u01/PROD/db/apps_st/data/apps_ts_archive.320.863906567';
SET NEWNAME FOR DATAFILE 399 to '/u01/PROD/db/apps_st/data/apps_ts_queues.311.863906577';
SET NEWNAME FOR DATAFILE 400 to '/u01/PROD/db/apps_st/data/apps_ts_media.334.863906543';
第 30 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SET NEWNAME FOR DATAFILE 401 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.338.863906531';
SET NEWNAME FOR DATAFILE 402 to '/u01/PROD/db/apps_st/data/apps_ts_tx_data.333.863906545';
SET NEWNAME FOR DATAFILE 403 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.336.863906537';
SET NEWNAME FOR DATAFILE 404 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.327.863906557';
SET NEWNAME FOR DATAFILE 405 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.341.863906521';
SET NEWNAME FOR DATAFILE 406 to '/u01/PROD/db/apps_st/data/apps_ts_tx_idx.343.863906515';
SET NEWNAME FOR DATAFILE 407 to '/u01/PROD/db/apps_st/data/apps_ts_seed.331.863906551';
SET NEWNAME FOR TEMPFILE 1 to '/u01/PROD/db/apps_st/data/temp1.273.863906849';
SET NEWNAME FOR TEMPFILE 2 to '/u01/PROD/db/apps_st/data/temp2.283.863906849';
set until scn 5967364936377;
RESTORE DATABASE;
SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
}
executing command: SET NEWNAME
executing command: SET NEWNAME
。。。。。。
Starting restore at 12-DEC-2012 00:37:38
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
第 31 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/hkrt/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/hkrt/undotbs1.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/hkrt/sell01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/hkrt/pay01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/hkrt/cms01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/hkrt/itrusradb01.dbf
channel ORA_DISK_1: reading from backup piece /u01/bak/rman_bk/full_HKRT_1knsi76k_1_1
channel ORA_DISK_1: errors found reading piece handle=/u01/bak/rman_bk/full_HKRT_1knsi76k_1_1
channel ORA_DISK_1: failover to piece handle=/data/bak/full_HKRT_1knsi76k_1_1 tag=BACKUPDATABASE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:06:16
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 00002 to /u01/app/oracle/oradata/hkrt/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/hkrt/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/hkrt/undotbs2.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/hkrt/proxy01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/hkrt/payment01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/hkrt/itruscadb01.dbf
channel ORA_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/hkrt/ob2c01.dbf
第 32 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
channel ORA_DISK_1: reading from backup piece /data/bak/full_HKRT_1jnsi76k_1_1
channel ORA_DISK_1: piece handle=/data/bak/full_HKRT_1jnsi76k_1_1 tag=BACKUPDATABASE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:06:05
Finished restore at 12-DEC-2012 00:50:01
datafile 1 switched to datafile copy
input datafile copy RECID=14 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=15 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=17 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=18 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=19 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/sell01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/proxy01.dbf
datafile 8 switched to datafile copy
第 33 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
input datafile copy RECID=21 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/pay01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=22 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/payment01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=23 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/cms01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=24 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/itrusradb01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=25 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/itruscadb01.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=26 STAMP=801795002 file name=/u01/app/oracle/oradata/hkrt/ob2c01.dbf
renamed tempfile 1 to /u01/app/oracle/oradata/hkrt/temp01.dbf in control file
9)
修改联机日志文件的路径(sql>)
alter database rename file '+DATAC1/prod/onlinelog/group_1.271.863906745' to '/u01/PROD/db/apps_st/data/redo1_1.log';
alter database rename file '+DATAC1/prod/onlinelog/group_2.266.863906745' to '/u01/PROD/db/apps_st/data/redo2_1.log';
alter database rename file '+DATAC1/prod/onlinelog/group_3.259.863906747' to '/u01/PROD/db/apps_st/data/redo3_1.log';
alter database rename file '+DATAC1/prod/onlinelog/group_4.285.863906749' to '/u01/PROD/db/apps_st/data/redo4_1.log';
第 34 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
-- 上面操作在执行的时候会报 ERROR,类似如下:
SQL>
alter database rename file '+ASMDATA/hkrt/onlinelog/group_6.257.781033825' to '/u01/app/oracle/oradata/hkrt/redo6_1.log';
alter database rename file '+ASMDATA/hkrt/onlinelog/group_6.257.781033825' to '/u01/app/oracle/oradata/hkrt/redo6_1.log'
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 14779
Session ID: 158 Serial number: 3
-- 可见报错后 session 被断开,我们需要重新连接实例继续往下执行
联机日志文件修改之后查看
SQL> set pagesize 9999
SQL> select member from v$logfile;
MEMBER
-------------------------------------------------------------------------------/u01/PROD/db/apps_st/data/redo1_1.log
/u01/PROD/db/apps_st/data/redo2_1.log
/u01/PROD/db/apps_st/data/redo3_1.log
/u01/PROD/db/apps_st/data/redo4_1.log
第 35 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
4 rows selected.
10) 恢复数据库
RMAN> recover database;
Starting recover at 05-APR-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1252 device type=DISK
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4733
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=2056
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=2057
channel ORA_DISK_1: reading from backup piece /u03/PROD_Backup/wyp_arch_8tqvbpuo_1_1_20160301
channel ORA_DISK_1: errors found reading piece handle=/u03/PROD_Backup/wyp_arch_8tqvbpuo_1_1_20160301
第 36 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
channel ORA_DISK_1: failover to piece handle=/u01/BAK/03/wyp_arch_8tqvbpuo_1_1_20160301 tag=ARCHIVELOG
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:45
archived log file name=/u01/PROD/db/apps_st/data/archive2_2056_863815396.dbf thread=2 sequence=2056
archived log file name=/u01/PROD/db/apps_st/data/archive1_4733_863815396.dbf thread=1 sequence=4733
archived log file name=/u01/PROD/db/apps_st/data/archive2_2057_863815396.dbf thread=2 sequence=2057
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4734
channel ORA_DISK_1: reading from backup piece /u03/PROD_Backup/wyp_arch_8uqvbq8t_1_1_20160301
channel ORA_DISK_1: errors found reading piece handle=/u03/PROD_Backup/wyp_arch_8uqvbq8t_1_1_20160301
channel ORA_DISK_1: failover to piece handle=/u01/BAK/03/wyp_arch_8uqvbq8t_1_1_20160301 tag=ARCHIVELOG
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/PROD/db/apps_st/data/archive1_4734_863815396.dbf thread=1 sequence=4734
unable to find archived log
archived log thread=1 sequence=4735
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/05/2016 10:56:15
第 37 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 4735 and starting SCN of 5967364928659
查看 scn 与之前 scn 的差别
5967364928659
5967364936377
之后会报一个错误:
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 9 and starting SCN of 823627
这里是提醒恢复到一个未知的 scn 号。在 alter database mount 之后,通过 set until scn 或者 set until time 命令设置恢复到的 scn 号或时间。就可
以避免这个错误。
run {
set newname
for datafile '+DG0/db/datafile/sysaux.257.780159407' to '/home/oracle/data2/sysaux.257.780159407';
set newname
for datafile '+DG0/db/datafile/system.256.780159407' to '/home/oracle/data2/system.256.780159407';
set newname
for datafile '+DG0/db/datafile/timelineweb01.dbf' to '/home/oracle/data2/timelineweb01.dbf';
set newname
for datafile '+DG0/db/datafile/undotbs1.258.780159409' to '/home/oracle/data2/undotbs1.258.780159409';
set newname
for datafile '+DG0/db/datafile/undotbs2.264.780159511' to '/home/oracle/data2/undotbs2.264.780159511';
set newname
for datafile '+DG0/db/datafile/users.259.780159409' to '/home/oracle/data2/users.259.780159409';
set until scn 5967364936377;
restore database ;
switch datafile all;
第 38 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
recover database;
}
11.RESETLOGS 打开数据库
SQL> alter database open resetlogs;--重置重做日志
Database altered.
我测试的平台是 11gR2 的版本,在 open resetlogs 之后,自动在原来默认的路径创建了 temp 表空间和 3 组 redo 文件。
如果恢复目录和原来相同,就不用修改。
如果目录不同,我们就需要把这些文件移到我们现在的 data 目录。
源目录:
[oracle@qs-dmm-rh2 dave]$ pwd
/u01/app/oracle/oradata/dave
[oracle@qs-dmm-rh2 dave]$ ls
redo01.log
redo02.log
redo03.log temp01.dbf
现在的目录:
[oracle@qs-dmm-rh2 dave]$ cd /u01/oradata/
[oracle@qs-dmm-rh2 oradata]$ ls
control01.ctl control02.ctl
control03.ctl
第 39 页
sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
11) 后续检查
到这里 RAC 到单实例备份恢复已经完毕,我们可以简单检查下
到这里 RAC 到单实例备份恢复已经完毕,我们可以简单检查下
这里需要对 redo 和 tempundo 操作一下
1.redo
set linesize 20000
先查看一下 redo 的相关信息:
select group#,thread#,archived,bytes/1024/1024||'M' as M,status from v$log;
GROUP#
THREAD# ARC M
STATUS
---------- ---------- --- ----------------------------------------- ---------------1
1 NO 1000M
第 40 页
CURRENT
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
2
1 YES 1000M
UNUSED
3
2 YES 1000M
INACTIVE
4
2 YES 1000M
UNUSED
SQL> select group#,member from v$logfile;
GROUP#
MEMBER
-------------------------------------------------------------------------------1
/u01/PROD/db/apps_st/data/redo1_1.log
2
/u01/PROD/db/apps_st/data/redo2_1.log
3
/u01/PROD/db/apps_st/data/redo3_1.log
4
/u01/PROD/db/apps_st/data/redo4_1.log
SQL> select thread#,status,enabled from v$thread;
THREAD# STATUS
ENABLED
---------- ------------ ----------------
第 41 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
1 OPEN
PUBLIC
2 CLOSED
PUBLIC
删除没用的 thread#
select group# from v$log where THREAD#=2;
GROUP#
---------3
4
alter database disable thread 2;
oracle 至少有 2 组 redo log。 所以我们可以将已经完成归档的 redo drop 掉, 重新创建。
alter database clear unarchived logfile group 3;
alter database clear unarchived logfile group 4;
第 42 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
!mv /u01/PROD/db/apps_st/data/redo4_1.log /u01/PROD/db/apps_st/data/redo4_1.log.bak
!mv /u01/PROD/db/apps_st/data/redo3_1.log /u01/PROD/db/apps_st/data/redo3_1.log.bak
alter database drop logfile group 3;
alter database drop logfile group 4;
SQL>重做 thread#2 的相关 redo 日志
alter database add logfile group 4 ('/u01/PROD/db/apps_st/data/redo4_1.log') size 1000m;
alter database add logfile group 3 ('/u01/PROD/db/apps_st/data/redo3_1.log') size 1000m;
切几次日志,
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
查看 redo 信息
SQL> select group#,bytes/1024/1024||'M',status from v$log;
第 43 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
GROUP# BYTES/1024/1024||'M'
STATUS
---------- ----------------------------------------- ---------------1 1000M
INACTIVE
2 1000M
ACTIVE
3 1000M
INACTIVE
4 1000M
CURRENT
查看归档信息
SQL> archive log list
Database log mode
Archive Mode
Automatic archival
Enabled
Archive destination
/u01/PROD/db/apps_st/data/archive
第 44 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Oldest online log sequence
1
Next log sequence to archive
1
Current log sequence
1
2.temp
SQL> select name from v$tempfile;
NAME
----------------------------------------------------------------+DATAC1/prod/tempfile/temp1.273.863906849
+DATAC1/prod/tempfile/temp2.283.863906849
--表空间 offline
SQL>
alter database tempfile '+DATAC1/prod/tempfile/temp1.273.863906849' offline;
alter database tempfile '+DATAC1/prod/tempfile/temp2.283.863906849' offline;
Database altered.
第 45 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';
TABLESPACE_NAME
-----------------------------TEMP1
TEMP2
--在 OS 级别移动 temp 的数据文件(不做)
SQL> !
!mv /u01/PROD/db/apps_st/data/temp01.dbf /u01/PROD/db/apps_st/data/temp01.dbf.bak
!mv /u01/PROD/db/apps_st/data/temp02.dbf /u01/PROD/db/apps_st/data/temp02.dbf.bak
先创建一个临时表空间 temp01
SQL>
create temporary tablespace temp01 tempfile '/u01/PROD/db/apps_st/data/temp01.dbf' size 512m autoextend on next 1m maxsize unlimited;
create temporary tablespace temp02 tempfile '/u01/PROD/db/apps_st/data/temp02.dbf' size 512m autoextend on next 1m maxsize unlimited;
Tablespace created.
SQL> alter database default temporary tablespace temp01;
删除之前的:
drop tablespace TEMP1 including contents and datafiles;
drop tablespace TEMP2 including contents and datafiles;
Database altered.
select * from v$tempfile;
第 46 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
--temp 表空间 online(不必做)
SQL>
alter database tempfile '/u01/PROD/db/apps_st/data/temp01.dbf ' online;
alter database tempfile '/u01/PROD/db/apps_st/data/temp02.dbf ' online;
Database altered.
--验证
SQL> select name from v$tempfile;
NAME
-------------------------------------------------------------------------------/u01/oradata/temp01.dbf
3.顺便处理 undo
select tablespace_name,status from dba_data_files;
show parameter undo
SQL> show parameter undo
NAME
TYPE
VALUE
------------------------------------ ----------- -----------------------------undo_management
string
AUTO
undo_retention
integer
900
undo_tablespace
string
APPS_UNDOTS1
SQL> select tablespace_name from dba_tablespaces where contents='UNDO';
TABLESPACE_NAME
------------------------------
第 47 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
APPS_UNDOTS1
UNDOTBS2
drop tablespace UNDOTBS2 including contents and datafiles;
重启一下 DB
12) 创建密码文件(可不做)
查看监听状态并配置,编辑 tnsname.ora 文件。通过以下命令创建密码文件,注意密码文件的位置
[oracle@oradb1 dbs]$
cd $ORACLE_HOME/dbs
orapwd file=orapwPROD password=welcomeLS123 entries=30
附:
设置备份片
RMAN> catalog backuppiece '/oracle/backup/arch2_08p0rhm1';
cataloged backup piece
backup piece handle=/oracle/backup/arch2_08p0rhm1 RECID=4 STAMP=839766295
三、总结
在恢复过程中也遇到不少问题,起初没太仔细看备份集信息及归档日志不完全,造成 scn 号不准确,以至于数据库无法完成恢复。作为数据库
第 48 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
管理人员,在对数据库操作时,请仔细核对相关信息,修改文件前最好先保留一份原始文件。详细 RMAN 管理语句、命令请参考 oracle 官方文档。
13) 用 NID 修改
先查看,这个和我们之前的一样
SQL> select name,dbid from v$database;
NAME
----------------------------------------------------------------- ---------PROD
DBID
275653732
源环境的是:
SQL> select name,dbid from v$database;
NAME
DBID
--------- ---------PROD
275653732
几点说明:
(1)在修改 DBID 期间仍然可能会遇到不可恢复的错误。所以修改之前备份数据库,特别是控制文件。因为 nid 会修改控制文件中的信息。
(2)需要将 DB 启动到 mount 状态才能修改。
第 49 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SQL> shutdown immediate
SQL> startup mount;
在执行 NID 命令之前:一定要关闭所有的 session 连接。
nid 命令到执行的最后会关闭数据库,如果有 session 连接,就会阻止这个操作,修改 dbid 就会被挂死。如果中断这个操作。修改就会失败,
数据库就不能 mount。需要恢复。
(1)只改 DBID, 不改 db_name
[oracle@qs-dmm-rh2 trace]$ nid target=sys/welcomeLS123
DBNEWID: Release 11.2.0.1.0 - Production on Fri Mar 11 18:36:33 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to database DAVE (DBID=808234286)
Connected to server version 11.2.0
Control Files in database:
/u01/oradata/control01.ctl
/u01/oradata/control02.ctl
/u01/oradata/control03.ctl
第 50 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Change database ID of database DAVE? (Y/[N]) => y
Proceeding with operation
Changing database ID from 808234286 to 808418162
Control File /u01/oradata/control01.ctl - modified
Control File /u01/oradata/control02.ctl - modified
Control File /u01/oradata/control03.ctl - modified
Datafile /u01/app/oracle/oradata/dave/system01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/sysaux01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/undotbs01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/users01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/temp01.db - dbid changed
Control File /u01/oradata/control01.ctl - dbid changed
Control File /u01/oradata/control02.ctl - dbid changed
第 51 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Control File /u01/oradata/control03.ctl - dbid changed
Instance shut down
Database ID for database DAVE changed to 808418162.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
重启打开数据库:
[oracle@qs-dmm-rh2 ~]$ export ORACLE_SID=PROD
[oracle@qs-dmm-rh2 ~]$ sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 11 18:37:57 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
第 52 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SQL> startup
ORACLE instance started.
Total System Global Area 196681728 bytes
Fixed Size
1335444 bytes
Variable Size
83890028 bytes
Database Buffers
109051904 bytes
Redo Buffers
2404352 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> select name,dbid from v$database;
NAME
DBID
第 53 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
--------- ---------DAVE
808418162
SQL>
(2)修改 DBID 和 DB_NAME
注意一点,修改 DB_NAME 之前,要将 spfile 创建成 pfile,因为修改 dbname 之后,原来的参数文件就没用了。所以要保证最新的参数。 还有修
改 DB_NAME 的值为最新值。 修改完之后,然后用这个新参数启动 DB.
[oracle@qs-dmm-rh2 trace]$ nid target=sys/welcomeLS123 dbname=TEST
DBNEWID: Release 11.2.0.1.0 - Production on Fri Mar 11 18:41:01 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to database DAVE (DBID=808418162)
Connected to server version 11.2.0
Control Files in database:
第 54 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
/u01/oradata/control01.ctl
/u01/oradata/control02.ctl
/u01/oradata/control03.ctl
Change database ID and database name DAVE to DBA? (Y/[N]) => y
Proceeding with operation
Changing database ID from 808418162 to 1204743549
Changing database name from DAVE to DBA
Control File /u01/oradata/control01.ctl - modified
Control File /u01/oradata/control02.ctl - modified
Control File /u01/oradata/control03.ctl - modified
Datafile /u01/app/oracle/oradata/dave/system01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/sysaux01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/undotbs01.db - dbid changed, wrote new name
第 55 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Datafile /u01/app/oracle/oradata/dave/users01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/temp01.db - dbid changed, wrote new name
Control File /u01/oradata/control01.ctl - dbid changed, wrote new name
Control File /u01/oradata/control02.ctl - dbid changed, wrote new name
Control File /u01/oradata/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to DBA.
Modify parameter file and generate a new password file before restarting.
Database ID for database DBA changed to 1204743549.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
第 56 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
验证:
SQL> select name,dbid from v$database;
NAME
DBID
--------- ---------ANQING
676458969
[oratest@xztest 11.2.0]$ nid target=/ dbname=PROD
DBNEWID: Release 11.2.0.3.0 - Production on Thu Jul 9 13:10:06 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to database PROD (DBID=276248112)
Connected to server version 11.2.0
Control Files in database:
/u01/test/db/data/cntrl01.dbf
/u01/test/db/data/cntrl02.dbf
第 57 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
/u01/test/db/data/cntrl03.dbf
Change database ID and database name PROD to TEST? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 276248112 to 2182761391
Changing database name from PROD to TEST
Control File /u01/test/db/data/cntrl01.dbf - modified
Control File /u01/test/db/data/cntrl02.dbf - modified
Control File /u01/test/db/data/cntrl03.dbf - modified
Datafile /u01/test/db/data/system01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system03.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system04.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system05.db - dbid changed, wrote new name
Datafile /u01/test/db/data/ctxd01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/owad01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_queue02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/odm.db - dbid changed, wrote new name
Datafile /u01/test/db/data/olap.db - dbid changed, wrote new name
Datafile /u01/test/db/data/sysaux01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/apps_ts_tools01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system12.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data04.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind06.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref03.db - dbid changed, wrote new name
第 58 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Datafile /u01/test/db/data/a_int02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/sysaux02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system13.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system14.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system15.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system16.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system17.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system18.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system19.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system20.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system21.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system22.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system23.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system24.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system25.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref04.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref05.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref06.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data05.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data06.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data07.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data08.db - dbid changed, wrote new name
Datafile /u01/test/db/data/undo02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system10.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system06.db - dbid changed, wrote new name
Datafile /u01/test/db/data/portal01.db - dbid changed, wrote new name
第 59 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Datafile /u01/test/db/data/system07.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system09.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system08.db - dbid changed, wrote new name
Datafile /u01/test/db/data/system11.db - dbid changed, wrote new name
Datafile /u01/test/db/data/undo01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_int01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_summ01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_nolog01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_archive01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_queue01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_media01.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_data03.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind02.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind03.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind04.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_txn_ind05.db - dbid changed, wrote new name
Datafile /u01/test/db/data/a_ref02.db - dbid changed, wrote new name
Control File /u01/test/db/data/cntrl01.dbf - dbid changed, wrote new name
Control File /u01/test/db/data/cntrl02.dbf - dbid changed, wrote new name
Control File /u01/test/db/data/cntrl03.dbf - dbid changed, wrote new name
Instance shut down
第 60 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Database name changed to TEST.
Modify parameter file and generate a new password file before restarting.
Database ID for database TEST changed to 2182761391.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
14) 用脚本启停数据库
[oratest@xztest 11.2.0]$ cd /u01/PROD/db/tech_st/11.2.0/appsutil/scripts/PROD_sing
[oratest@xztest ~]$ ls
adautocfg.sh addbctl.sh adexecsql.pl adpreclone.pl adstrtdb.sql
adchknls.pl addlnctl.sh adlsnodes.sh adstopdb.sql
[oraprod@sing PROD_sing]$
[oratest@xztest ~]$
./addbctl.sh stop
./addbctl.sh start
Logfile: /u01/test/db/11.2.0/appsutil/log/TEST_xztest/addlnctl.txt
第 61 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
15) 卸载和重装载 JAVA 对象(测试环境)
数据库的 java 对象需卸载重新安装(注释:测试环境内部克隆无需次步骤)
cd ~
ls
sqlplus '/as sysdba'
@rmcorejvm.sql
sqlplus '/as sysdba'
@corejvminst.sql
2.完成后启动数据库
sqlplus '/as sysdba'
startup
16) 清除节点
[oratest@xztest ~]$ sqlplus apps/ls20151010apps
第 62 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 9 15:29:19 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN;
PL/SQL procedure successfully completed.
SQL> COMMIT;
Commit complete.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
17) adautocfg.sh
[oratest@xztest ~]$ cd $ORACLE_HOME/appsutil/scripts
[oratest@xztest scripts]$ ls
第 63 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
PROD_ebs1 TEST_xztest
[oratest@xztest scripts]$ cd TEST_xztest/
[oratest@xztest TEST_xztest]$ ls
adautocfg.sh adchknls.pl addbctl.sh addlnctl.sh adexecsql.pl adlsnodes.sh adpreclone.pl adstopdb.sql adstrtdb.sql
[oratest@xztest TEST_xztest]$ . adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/test/db/11.2.0/appsutil/log/TEST_xztest/07091530/adconfig.log
AutoConfig is configuring the Database environment...
AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /u01/test/db/11.2.0
Classpath
: :/u01/test/db/11.2.0/jdbc/lib/ojdbc6.jar:/u01/test/db/11.2.0/appsutil/java/xmlparserv2.jar:/u01/test/db/11.2.0/appsutil/java:/
u01/test/db/11.2.0/jlib/netcfg.jar:/u01/test/db/11.2.0/jlib/ldapjclnt11.jar
Using Context file
: /u01/test/db/11.2.0/appsutil/TEST_xztest.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 64 bits
第 64 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Configuring templates from ORACLE_HOME ...
AutoConfig completed successfully.
Last login: Thu Jul 9 10:49:02 2015 from 192.168.30.12
18) 不放心再克隆一次
19) 然后用 sing 再转换一份 RAC 环境
+++++++++++++++++
完整输出日志内容:
alter database open resetlogs
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_1.log'
ORA-27037: unable to obtain file status
第 65 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
第 66 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
第 67 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
第 68 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
第 69 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_2.log'
第 70 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
RESETLOGS after incomplete recovery UNTIL CHANGE 121279435
Resetting resetlogs activation ID 3199883568 (0xbeba5930)
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 1 of thread 1
第 71 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/hkrt/redo1_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_2.log'
第 72 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/hkrt/redo2_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 3 of thread 2
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_2.log'
ORA-27037: unable to obtain file status
第 73 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 2: '/u01/app/oracle/oradata/hkrt/redo3_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Dec 12 01:13:12 2012
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 4 of thread 2
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_2.log'
ORA-27037: unable to obtain file status
第 74 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 4 thread 2: '/u01/app/oracle/oradata/hkrt/redo4_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
第 75 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
Additional information: 3
ORA-00312: online log 5 thread 1: '/u01/app/oracle/oradata/hkrt/redo5_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_ora_14794.trc:
ORA-00313: open failed for members of log group 6 of thread 2
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_2.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
第 76 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-00312: online log 6 thread 2: '/u01/app/oracle/oradata/hkrt/redo6_1.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Wed Dec 12 01:13:25 2012
Setting recovery target incarnation to 3
Wed Dec 12 01:13:25 2012
Assigning activation ID 3220640364 (0xbff7126c)
LGWR: STARTING ARCH PROCESSES
Wed Dec 12 01:13:25 2012
ARC0 started with pid=21, OS id=14930
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Wed Dec 12 01:13:26 2012
ARC1 started with pid=25, OS id=14934
Wed Dec 12 01:13:26 2012
ARC2 started with pid=26, OS id=14938
Wed Dec 12 01:13:26 2012
ARC3 started with pid=27, OS id=14942
ARC1: Archival started
第 77 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/hkrt/redo1_1.log
Current log# 1 seq# 1 mem# 1: /u01/app/oracle/oradata/hkrt/redo1_2.log
Successful open of redo thread 1
Wed Dec 12 01:13:26 2012
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Dec 12 01:13:26 2012
SMON: enabling cache recovery
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Redo thread 2 internally disabled at seq 1 (CKPT)
ARC3: Archiving disabled thread 2 sequence 1
Archived Log entry 1974 added for thread 2 sequence 1 ID 0x0 dest 1:
Successfully onlined Undo Tablespace 2.
Dictionary check beginning
Wed Dec 12 01:13:31 2012
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_dbw0_14440.trc:
第 78 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/hkrt/temp01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/hkrt/hkrt/trace/hkrt_dbw0_14440.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/u01/app/oracle/oradata/hkrt/temp01.dbf'
File 201 not verified due to error ORA-01157
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Re-creating tempfile /u01/app/oracle/oradata/hkrt/temp01.dbf
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Wed Dec 12 01:13:38 2012
Starting background process QMNC
Wed Dec 12 01:13:38 2012
第 79 页
共 80 页
MAIL:[email protected]
信息中心-DBA
by Martin
QQ:107132494
TEL:15117148688
QMNC started with pid=28, OS id=14950
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Completed: alter database open resetlogs
Wed Dec 12 01:13:52 2012
Starting background process CJQ0
Wed Dec 12 01:13:52 2012
CJQ0 started with pid=34, OS id=14982
第 80 页
共 80 页