Oracle RAC環境修改字符集遇到ORA-00205解決方法

mahanso發表於2011-02-01
Oracle  RAC環境修改字符集理論知識參考:http://space.itpub.net/12272958/viewspace-684632

下面是我修改字符集中遇到的問題和解決辦法:

OS:
Linux dotrac1 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

oracle:

SQL> select * from v$version;   

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

2個節點RAC


一、我修改字符集步驟說明:
1.1、完全關閉一個節點1
1.1.1、oracle使用者下執行:
srvctl stop nodeapps -n mahanso1

1.1.2、root使用者下執行:
crsctl stop crs

1.2、在節點2操作,修改cluster_database引數為false,變成單例項:
alter system set cluster_database=false scope=spfile

1.3、在節點2上關閉資料庫,重啟資料庫

SQL>startup mount
ORACLE instance started.

Total System Global Area  127371024 bytes
Fixed Size                   743184 bytes
Variable Size             109051904 bytes
Database Buffers           16777216 bytes
Redo Buffers                 798720 bytes
ORA-00205: error in identifying controlfile, check alert log for more info


檢視alert日誌如下:
Reconfiguration complete
ORACLE_BASE from environment = /orasw/oracle
Sun Jan 30 02:14:32 2011
ALTER DATABASE   MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oradata1/dotrac/control02.ctl'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 10
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oradata1/dotrac/control01.ctl'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 10
ORA-205 signalled during: ALTER DATABASE   MOUNT...
Sun Jan 30 02:14:32 2011
Checker run found 2 new persistent data failures
Sun Jan 30 02:14:33 2011
ALTER SYSTEM SET local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dotrac1-vip)(PORT=1521))))' SCOPE=MEMORY SID='dotrac1';
Sun Jan 30 02:15:07 2011
alter database character set internal_use AL32UTF8
ORA-1507 signalled during: alter database character set internal_use AL32UTF8...
Starting ORACLE instance (normal)
Sun Jan 30 02:15:31 2011
Shutting down instance (immediate)
Shutting down instance: further logons disabled
Stopping background process MMNL
Stopping background process MMON
License high water mark = 2
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
ORA-1507 signalled during: ALTER DATABASE CLOSE NORMAL...
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Sun Jan 30 02:15:34 2011
Stopping background process VKTM: 
Sun Jan 30 02:15:36 2011
freeing rdom 0
Sun Jan 30 02:15:40 2011
Instance shutdown complete


我檢視了:
ORA-00210:
cannot open the specified control file
Cause:         Cannot open the control file.
Action:         Check to make sure the control file exists and is not locked by some other program.

ORA-00202:
control file: 'string'
Cause:         This message reports the name file involved in other messages.
Action:         See associated error messages for a description of the problem.

ORA-27086:
unable to lock file - already in use
Cause:         the file is locked by another process, indicating that it is currently in use by a database instance.
Action:         determine which database instance legitimately owns this file.


當看到詳細錯誤資訊的時候,自己一個一個判斷:
1、ORA-00210:不能開啟控制檔案
2、ORA-00202:給我的資訊作用不大,是問題出現問題導致的連帶反應
3、ORA-27086:檔案正在被佔用


起初我的想法,透過ORA-00210給我的錯誤提示,我把放在共享儲存上的控制檔案和引數檔案複製到本地節點上啟動資料庫,但是資料庫是生產環境,這樣操作風險很大,不到最後一步我不希望有這樣的操作,我嘗試這用其他方法解決這個問題。

然後我試著ORA-27086作為突破口,在網上搜尋相關資源,找到為什麼會出現這個類問題。

下面內容轉自網路資源,作者不詳,感謝作者做出的詳細解釋:
------------------------------------------------------------------
SQL> create tablespace sdf datafile '/nfstest/adsf.dbf' size 10m extent management local;
create tablespace sdf datafile '/nfstest/adsf.dbf' size 10m extent management local
*
ERROR at line 1:
ORA-01119: error in creating database file '/nfstest/adsf.dbf'
ORA-27054: NFS file system where the file is created or resides is not mounted
with correct options
Additional information: 3

根據metalink上ID 781349.1文件的解決方法,在mount NFS的時候使用如下的option:
rw,bg,rsize=32768,wsize=32768,hard,vers=3,nointr,timeo=600,proto=tcp,suid 0 0,
不過實際在Linux下執行時,需去掉最後的suid 0 0:

[root@standby /]# mount -t nfs 172.16.4.179:/nfstest nfstest -o rw,bg,rsize=32768,wsize=32768,hard,vers=3,nointr,timeo=600,proto=tcp

不過這樣仍然會報錯,提示無法獲取鎖:
ORA-27086: unable to lock file - already in use
Linux Error: 37: No locks available
Additional information: 10

同樣的也是mount option的問題,在mount時指定nolock:
[root@standby /]# mount -t nfs 172.16.4.179:/nfstest nfstest -o nolock,rw,bg,rsize=32768,wsize=32768,hard,vers=3,nointr,timeo=600,proto=tcp

-----------------------------------------------------------------

發現客戶的rac環境是用nfs掛載磁碟作充當oracle的共享儲存,我嘗試手動掛載磁碟,並且新增掛載引數nolock,之後重啟資料庫問題得以解決

最後在2個伺服器的 /etc/fstab檔案中新增以下語句,確保每次掛載磁碟都處於nolock狀態:

dotnas1:/nas1/shared_cluster      /cluster      nfs    nolock,rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 0 0
dotnas1:/nas1/shared_oradata1     /oradata1     nfs    nolock,rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0
dotnas1:/nas2/shared_oradata2     /oradata2     nfs    nolock,rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0


總結:這次故障解決,讓我體會到解決問題不能忽視每一個問題的存在,在oracle故障解決中,要認真分析每一個錯誤資訊,找到真正的原因。爭取用最好的方法解決問題。



注:20110212日更改,藍色字型設定錯誤,我發現每次重啟之後都設定成noclock狀態,磁碟2個節點會不同步,導致其他節點不能啟動crs,所以不能設定每次開機掛載的狀態為nolock

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12272958/viewspace-686568/,如需轉載,請註明出處,否則將追究法律責任。

相關文章