Oracle 11gR2用gpnp profile存放ASM的spfile路徑
從Oracle 11gR2開始,GI整合了ASM,OCR/VOTEDISK也存放在ASM磁碟組了(11gR2以前需要存放於裸裝置中),同時ASM的功能較10g也有很大增強。
我們先引入一個問題:
11gR2中,OCR/VOTEDISK存放在ASM磁碟組,這也就意味著在GI能夠啟動的前提是能夠順利啟動ASM執行個體並且能夠將相應磁碟組MOUNT起來;而ASM的spfile卻放在ASM磁碟組裡,這也同樣意味著要先啟動ASM執行個體並且能讀到參數檔案。那如何解決這個問題呢? 11gR2中引入了pgnp profile,用於存放ASM參數檔案路徑,這允許oracle在ASM執行個體啟動以前讀到參數檔案。
11gR2的RAC環境中,ASM的參數檔案存放於ASM磁碟組裡面.ASM執行個體啟動時候,尋找參數檔案的順序如下,直接找到為止:
1. Grid Plug and Play (GPnP) profile
2. spfile+ASM<node_number>.ora
3. init+ASM<node_number>.ora
請注意: 以上紅色字型部分!!!
因此,11gR2中可以沒有pfile,可以將ASM參數儲存在gpnp profile中,在管理上省下了很多工作.
11gR2RAC環境中,ASM的參數檔案支援備份(spbackup),拷貝(spcopy),移動(spmove),查詢gpnp profile(spget),設定(spset)等操作
特別需要注意一點,ASM的參數檔案最好放在ASM磁組裡,同時確保每個叢集成員的gpnp都為同一個路徑
以簡單例子說明,如何將ASM的spfile重新儲存至ASM磁碟組
=============================================
準備環境
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 14 15:00:00 Y REGISTRY.253.866303695
N spfileasm.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866303695 ----注意這裡是連結
ASMCMD> pwd
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE
ASMCMD> spcopy +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866303695 +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/spcopy.ora
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/spcopy.ora
ORA-15268: internal Oracle file +OCR_VOTE.253.1 already exists.
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)
ASMCMD> spget
/home/grid/registry.253.839197161 --當前gpnp profile配置。該spfile是用spcopy命令產生的
ASMCMD> spmove REGISTRY.253.866303695 old_ora.bak ---刪除預設的SPFILE將導致路徑缺失
ASMCMD> ls -l
ASMCMD-8002: entry 'ASMPARAMETERFILE' does not exist in directory '+OCR_VOTE/rac-cluster/'
執行個體環境就緒,以下是解決辦法:
ASMCMD> spget
/home/grid/registry.253.839197161
ASMCMD> spcopy /home/grid/registry.253.839197161 +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/registry.ora --將本地磁碟上的spfile複製至ASM磁碟
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 14 19:00:00 Y REGISTRY.253.866316081
N registry.ora => +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081 --注意這裡是連結!!!!
ASMCMD> spset +OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081 --更新gpnp profile至連結
ASMCMD> spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081
重啟執行個體生效...
ASMCMD> shutdown --abort
ASM instance shutdown
Connected to an idle instance.
ASMCMD>
ASMCMD>
ASMCMD> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 4094 926 0 926 0 N DATA/
MOUNTED EXTERN N 512 4096 4194304 2032 1592 0 1592 0 Y OCR_VOTE/
ASMCMD> spget
+OCR_VOTE/rac-cluster/ASMPARAMETERFILE/REGISTRY.253.866316081
SQL> show parameter spfile;
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile string
+OCR_VOTE/rac-cluster/asmparameterfile/registry.253.866316081 --證實是通過gpnp profile裡spfile啟動執行個體
同樣,其他資料庫節點需要spset更新spfile路徑,重啟生效即可,此部分操作省略...
Oracle 11gR2 RAC中修改資料庫的SPFILE檔案位置
在CentOS 6.4下安裝Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虛擬機器中安裝步驟
Debian 下 安裝 Oracle 11g XE R2
Oracle效能最佳化 之 共用池