1,启动实例报错:
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORA-00439: feature not enabled: Managed Standby
SQL>
SQL> startup nomount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORA-00439: feature not enabled: Managed Standby
SQL>
2,后台alert日志trac日志报错如下:
ORA-00439: feature not enabled: Managed Standby
Thu Dec 03 11:39:24 2015
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Errors in file /oracle/app/oracle/diag/rdbms/pdunq/powerdes/trace/powerdes_ora_5717.trc:
ORA-00439: feature not enabled: Managed Standby
分析:是启动参数报错的缘故,要修改完善下启动参数。
3,导出参数文件
SQL> create pfile='/oracle/pfile1203.ora' from spfile;
File created.
SQL>
参数文件内容如下:
powerdes.__db_cache_size=3087007744
powerdes.__java_pool_size=67108864
powerdes.__large_pool_size=67108864
powerdes.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
powerdes.__pga_aggregate_target=3959422976
powerdes.__sga_target=7449083904
powerdes.__shared_io_pool_size=0
powerdes.__shared_pool_size=4026531840
powerdes.__streams_pool_size=134217728
*.audit_file_dest='/oracle/app/oracle/admin/powerdes/adump'
*.audit_sys_operations=TRUE
*.audit_trail='NONE'
*.compatible='11.2.0.0.0'
*.control_files='/home/oradata/powerdes/control01.ctl','/oracle/app/oracle/flash_recovery_area/powerdes/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='/home/oradata/powerdes','/home/oradata/pwerdes'
*.db_name='powerdes'
*.db_recovery_file_dest='/oracle/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=16106127360
*.db_unique_name='pdunq'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=powerdesXDB)'
*.fal_client='PD'
*.fal_server='PD_DG'
*.global_names=FALSE
*.job_queue_processes=1000
*.log_archive_config='DG_CONFIG=(pdunq,pddgunq)'
*.log_archive_dest_1='LOCATION=/oracle/app/oracle/flash_recovery_area/archivelog VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=pdunq'
*.log_archive_dest_2='SERVICE=PD_DG VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pddgunq lgwr sync affirm'
*.log_archive_dest_3=''
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='defer'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=20
*.log_archive_start=FALSE
*.log_file_name_convert='/home/oradata/powerdes','/home/oradata/powerdes'
*.memory_target=11379146752
*.open_cursors=300
*.optimizer_index_caching=90
*.optimizer_index_cost_adj=25
*.optimizer_mode='FIRST_ROWS'
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=335
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
里面有很多关于dataguard的配置信息,需要去掉
4,修改参数文件
去掉archive_dest:
*.log_archive_config='DG_CONFIG=(pdunq,pddgunq)'
*.log_archive_dest_2='SERVICE=PD_DG VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pddgunq lgwr sync affirm'
*.log_archive_dest_3=''
*.log_archive_dest_state_2='defer'
*.log_archive_dest_state_3='ENABLE'
*.log_file_name_convert='/home/oradata/powerdes','/home/oradata/powerdes'
去掉fal
*.fal_client='PD'
*.fal_server='PD_DG'
去掉standby
*.standby_file_management='AUTO'
保存为pfile1203_01.ora:
powerdes.__db_cache_size=3087007744
powerdes.__java_pool_size=67108864
powerdes.__large_pool_size=67108864
powerdes.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
powerdes.__pga_aggregate_target=3959422976
powerdes.__sga_target=7449083904
powerdes.__shared_io_pool_size=0
powerdes.__shared_pool_size=4026531840
powerdes.__streams_pool_size=134217728
*.audit_file_dest='/oracle/app/oracle/admin/powerdes/adump'
*.audit_sys_operations=TRUE
*.audit_trail='NONE'
*.compatible='11.2.0.0.0'
*.control_files='/home/oradata/powerdes/control01.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='/home/oradata/powerdes','/home/oradata/pwerdes'
*.db_name='powerdes'
*.db_recovery_file_dest='/oracle/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=16106127360
*.db_unique_name='pdunq'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=powerdesXDB)'
*.global_names=FALSE
*.job_queue_processes=1000
*.log_archive_dest_1='LOCATION=/oracle/app/oracle/flash_recovery_area/archivelog VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=pdunq'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=20
*.log_archive_start=FALSE
*.log_file_name_convert='/home/oradata/powerdes','/home/oradata/powerdes'
*.memory_target=11379146752
*.open_cursors=300
*.optimizer_index_caching=90
*.optimizer_index_cost_adj=25
*.optimizer_mode='FIRST_ROWS'
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=335
*.undo_tablespace='UNDOTBS1'
5,重新生成参数文件
SQL> create spfile from pfile='/oracle/pfile1203_01.ora';
File created.
SQL>
#建立默认的参数文件
SQL> create pfile from spfile;
File created.
SQL>
6,重新启动到nomount
SQL> startup nomount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1.1358E+10 bytes
Fixed Size 2216744 bytes
Variable Size 8254393560 bytes
Database Buffers 3087007744 bytes
Redo Buffers 13946880 bytes
SQL>
7,开始恢复控制文件
RMAN> restore controlfile to '/home/oradata/powerdes/control01.ctl' from '/oracle/ctl_auto/c-3391761643-20151202-02';
Starting restore at 03-DEC-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=771 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 03-DEC-15
RMAN>
8,加载到mount
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN>
9,使用Catalog命令注册RMAN备份集
RMAN> catalog start with '/oracle/2015-12-02/';
Starting implicit crosscheck backup at 03-DEC-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=771 device type=DISK
Crosschecked 6 objects
Finished implicit crosscheck backup at 03-DEC-15
Starting implicit crosscheck copy at 03-DEC-15
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 03-DEC-15
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern /oracle/2015-12-02/
List of Files Unknown to the Database
=====================================
File Name: /oracle/2015-12-02/pfile01.ora
File Name: /oracle/2015-12-02/rman_backup.log
File Name: /oracle/2015-12-02/full_POWERDES_20151202_5052.bak
File Name: /oracle/2015-12-02/cntrl_5053_1_897427575
File Name: /oracle/2015-12-02/cntrl_5055_1_897427607
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /oracle/2015-12-02/full_POWERDES_20151202_5052.bak
File Name: /oracle/2015-12-02/cntrl_5053_1_897427575
File Name: /oracle/2015-12-02/cntrl_5055_1_897427607
List of Files Which Where Not Cataloged
=======================================
File Name: /oracle/2015-12-02/pfile01.ora
RMAN-07517: Reason: The file header is corrupted
File Name: /oracle/2015-12-02/rman_backup.log
RMAN-07517: Reason: The file header is corrupted
RMAN>
10,开始恢复整个库
因为前面恢复了整个spfile已经controlfile,所以接下来恢复所有库的话,就不用带参数,直接恢复restore database就可以 ; rman的restore恢复遇到这个诡异的问题了
RMAN> restore database;
Starting restore at 03-DEC-15
using channel ORA_DISK_1
skipping datafile 7; already restored to file /home/oradata/powerdes/pl01.dbf
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oradata/powerdes/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/oradata/powerdes/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/oradata/powerdes/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/oradata/powerdes/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/oradata/powerdes/powerdesk01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /home/oradata/powerdes/plas01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /home/oradata/powerdes/help01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /home/oradata/powerdes/adobelc01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /home/oradata/powerdes/sms01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /home/oradata/powerdes/plcrm01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /home/oradata/powerdes/powerdesk02.dbf
channel ORA_DISK_1: restoring datafile 00013 to /home/oradata/powerdes/datagm01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/2015-12-02/full_POWERDES_20151202_5052.bak
channel ORA_DISK_1: ORA-19870: error while restoring backup piece /oracle/2015-12-02/full_POWERDES_20151202_5052.bak
ORA-19502: write error on file "/home/oradata/powerdes/plcrm01.dbf", block number 37952 (block size=8192)
ORA-27072: File I/O error
Linux-x86_64 Error: 25: Inappropriate ioctl for device
Additional information: 4
Additional information: 37952
Additional information: 425984
failover to previous backup
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/03/2015 15:21:51
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN>
猜猜问题是由于磁盘不足,因为/home目录只有10g多,所以做个映射到/oracle目录,这个/oracle目录有200多个G的大小。
mkdir -p /home/oradata
ln -s /oracle/app/oracle/oradata/powerdes /home/oradata/powerdes
然后继续执行restore恢复,restore成功,如下所示:
RMAN> restore database;
Starting restore at 03-DEC-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oradata/powerdes/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/oradata/powerdes/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/oradata/powerdes/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/oradata/powerdes/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/oradata/powerdes/powerdesk01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /home/oradata/powerdes/plas01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /home/oradata/powerdes/pl01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /home/oradata/powerdes/help01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /home/oradata/powerdes/adobelc01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /home/oradata/powerdes/sms01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /home/oradata/powerdes/plcrm01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /home/oradata/powerdes/powerdesk02.dbf
channel ORA_DISK_1: restoring datafile 00013 to /home/oradata/powerdes/datagm01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/2015-12-02/full_POWERDES_20151202_5052.bak
channel ORA_DISK_1: piece handle=/oracle/2015-12-02/full_POWERDES_20151202_5052.bak tag=TAG20151202T211859
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:25:45
Finished restore at 03-DEC-15
RMAN>
11,recover数据库
RMAN> recover database;
Starting recover at 03-DEC-15
using channel ORA_DISK_1
starting media recovery
RMAN-08187: WARNING: media recovery until SCN 11702491357 complete
Finished recover at 03-DEC-15
RMAN>
12,打开数据库
alter database open resetlogs;
RMAN> alter database open resetlogs;
database opened
RMAN>
13,登录验证
[oracle@oracle_yueworld admin]$ rlwrap sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 3 21:03:53 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL>