模拟恢复:spfile 、pfile 、控制文件、数据文件全部丢失。有全备份文件、参数文件和控制文件的备份集。
步骤:
1、用oracle默认的init.ora文件,建一个pfile,在其中要为控制文件指定路径:
control_files = (/db/oracle10g/oradata/peak/control1.dbf,/db/oracle10g/oradata/peak/control2.dbf,/db/oracle10g/oradata/peak/control3.dbf)
还要指定下dbname:
db_name=peak
然后使用该pfile启动到nomount状态。
[oracle@centos1151 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 25 19:27:30 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 96468992 bytes
Fixed Size 1217884 bytes
Variable Size 88083108 bytes
Database Buffers 4194304 bytes
Redo Buffers 2973696 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@centos1151 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jul 25 19:27:38 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: peak (not mounted)
RMAN> run {
2> allocate channel d3 type disk;
3> restore spfile from '/db/oracle10g/rmanbackup/cntrl_c-1837865510-20120725-00';
4> release channel d3;
5> }
using target database control file instead of recovery catalog
allocated channel: d3
channel d3: sid=47 devtype=DISK
Starting restore at 25-JUL-12
channel d3: autobackup found: /db/oracle10g/rmanbackup/cntrl_c-1837865510-20120725-00
channel d3: SPFILE restore from autobackup complete
Finished restore at 25-JUL-12
released channel: d3
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
2、恢复控制文件:
RMAN> run {
2> allocate channel d3 type disk;
3> restore controlfile from '/db/oracle10g/rmanbackup/cntrl_c-1837865510-20120725-00';
4> release channel d3;
5> }
allocated channel: d3
channel d3: sid=47 devtype=DISK
Starting restore at 25-JUL-12
channel d3: restoring control file
channel d3: restore complete, elapsed time: 00:00:04
output filename=/db/oracle10g/oradata/peak/control1.dbf
output filename=/db/oracle10g/oradata/peak/control2.dbf
output filename=/db/oracle10g/oradata/peak/control3.dbf
Finished restore at 25-JUL-12
released channel: d3
RMAN> alter database mount;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 07/25/2012 19:44:29
ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version 10.2.0.0.0
ORA-00202: control file: '/db/oracle10g/oradata/peak/control1.dbf'
报错:ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version 10.2.0.0.0
解决:在刚才手动创建的pfile文件加一行:
compatible = 10.2.0.1.0
然后将库关闭、启动到mount状态。
RMAN> shutdown immediate
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 96468992 bytes
Fixed Size 1217884 bytes
Variable Size 88083108 bytes
Database Buffers 4194304 bytes
Redo Buffers 2973696 bytes
RMAN>
3、恢复数据文件:
RMAN> restore database;
Starting restore at 25-JUL-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=48 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /db/oracle10g/oradata/peak/system01.dbf
restoring datafile 00002 to /db/oracle10g/oradata/peak/undotbs01.dbf
restoring datafile 00003 to /db/oracle10g/oradata/peak/sysaux01.dbf
restoring datafile 00004 to /db/oracle10g/oradata/peak/users01.dbf
restoring datafile 00005 to /db/oracle10g/oradata/peak/perfstat01.dbf
channel ORA_DISK_1: reading from backup piece /db/oracle10g/rmanbackup/PEAK_1_110
channel ORA_DISK_1: restored backup piece 1
piece handle=/db/oracle10g/rmanbackup/PEAK_1_110 tag=TAG20120725T184128
channel ORA_DISK_1: restore complete, elapsed time: 00:02:27
Finished restore at 25-JUL-12
RMAN>
RMAN> alter database open resetlogs;
database opened
更多参考:
the specified nodes are not clusterable
根据rowid删除表中重复的行
Agent process exited abnormally during initialization
一次字符乱码的解决过程
rman实验(一)
rman实验(二)
ORA-00600: internal error code, arguments: [keltnf
ORA-00600: ORA-12012 ORA-08102解决
linux下完全删除oracle
INFO: /usr/bin/ld: crt1.o: No such file: No such file or directory
centos4.8_64上安装oracle10201建库报ORA-12547
EM乱码解决
ORA-31613 Master process DM00 failed during startup
ORA-00600: internal error code, arguments: [4194], [29], [27], [], [], [], [], []
ORA-24324 ORA-01041 ORA-03113
centos5.3升级oracle
pdksh-5.2.14-36.el5.i386.rpm
使用rman进行数据库迁移
oracle10.2.0.1升级到10.2.0.4报错
Upgrade Oracle 10g from 10.2.0.1 to 10.2.0.4 (Single Instance)
改oracle的name和dbid
修改oracle实例名
Solaris8上迁移oracle8i---上
Solaris8上迁移oracle8i---下
未备份归档日志导致数据丢失的实验
使用NBU进行数据库迁移
catalog备份数据库
RMAN FORMAT字符串格式化
Error: can not register my instance state - -1
not all alterations performed
The ASM instance configured on the local node is a single-instance ASM
/u01/crs102/bin/crsctl.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared
Initializing the Oracle ASMLib driver: [FAILED]
ORA-00245: control file backup operation failed
WARNING: failed to read mirror side 1 of virtual extent 229 logical extent
模拟恢复参数文件
Interface eth0 checked failed
import server uses ZHS16GBK character set (possible charset conversion)