公司的一套oracle11gRAC(2節點)的資料庫,用的儲存是ASM,作業系統是RHEL
只有一個控制檔案,昨天我準備增加一個控制檔案, 在sqlplus 中 alter system set control_files='+DATA/kabiz/controlfile/current.260.797421353, +ARCH/kabiz/controlfile/current.256.797421353' scope=spfile;運行這個命令後才發現不知道怎麼在 ASM下複製新的控制檔案,導致資料庫不管在nomount,mount狀態下都啟動不了(spfile,controlfile,datafile 都在ASM下)ORA-15124: ASM file name '+DATA/kabiz/controlfile/current.260.797421353, +ARCH/kabiz/controlfile/current.256.797421353' contains an invalid alias name 解決辦法:1. 登入sqlplus,將spfile二進位檔案轉存為pfile文字檔SQL> create pfile='/u01/oracle/db_1/dbs/pfile.ora' from spfile='+DATA/KABIZ/spfilekabiz.ora' 2. 修改pfile檔案中controlfiles參數指定的控制檔案所在位置,尋找ASM裡的控制檔案可通過asmcmd命令尋找環境變數設定: export ORACLE_SID=+ASM export ORACLE_HOME=/u01/oracle/grid運行asmcmd命令[oracle@qaora02 dbs]$ asmcmdASMCMD> lsARCH/DATA/ASMCMD> cd DATAASMCMD> lsASM/KABIZ/ASMCMD> cd KABIZASMCMD> lsCONTROLFILE/DATAFILE/ONLINELOG/PARAMETERFILE/TEMPFILE/spfilekabiz.oraASMCMD> cd CONTROLFILEASMCMD> lsCurrent.260.797421353ASMCMD> pwd+DATA/KABIZ/CONTROLFILEASMCMD> ***************************************************pfile裡部分內容****************************************************.audit_file_dest='/u01/oracle/admin/kabiz/adump'*.audit_trail='db'*.compatible='11.2.0.0.0'*.control_files='+DATA/kabiz/controlfile/Current.260.797421353'*.db_block_size=8192*.db_create_file_dest='+DATA' 把oracle環境變數修改回來, export ORACLE_SID=orcl export ORACLE_HOME=/u01/oracle/db_1 [oracle@qaora02 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 18 15:18:31 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount pfile=/u01/oracle/db_1/dbs/pfile.oraORACLE instance started. Total System Global Area 3140026368 bytesFixed Size 2217464 bytesVariable Size 2415921672 bytesDatabase Buffers 704643072 bytesRedo Buffers 17244160 bytesDatabase mounted. SQL> show parameter control_file; NAME TYPE VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time integer 7control_files string +DATA/kabiz/controlfile/curren t.260.797421353 SQL> alter database open; SQL> create SPFILE='+DATA/kabiz/spfilekabiz.ora' from pfile='/u01/oracle/db_1/dbs/pfile.ora'; File created. SQL> shutdown immediate; SQL> startup;ORACLE instance started. Total System Global Area 3140026368 bytesFixed Size 2217464 bytesVariable Size 2415921672 bytesDatabase Buffers 704643072 bytesRedo Buffers 17244160 bytesDatabase mounted.Database opened.SQL>
本文出自 “為技術而癡狂” 部落格,請務必保留此出處http://ontherd.blog.51cto.com/2062140/1093298