Oracle 11gR2用gpnp profile存放ASM的spfile路徑

來源:互聯網
上載者:User

標籤:

從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檔案位置http://www.linuxidc.com/Linux/2012-09/70718.htm

在CentOS 6.4下安裝Oracle 11gR2(x64)http://www.linuxidc.com/Linux/2014-02/97374.htm

Oracle 11gR2 在VMWare虛擬機器中安裝步驟http://www.linuxidc.com/Linux/2013-09/89579p2.htm

Debian 下 安裝 Oracle 11g XE R2http://www.linuxidc.com/Linux/2014-03/98881.htm

Oracle效能最佳化 之 共用池http://www.linuxidc.com/Linux/2012-02/54062.htm

更多Oracle相關資訊見Oracle專題頁面http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新連結地址:http://www.linuxidc.com/Linux/2015-01/112535.htm

Oracle 11gR2用gpnp profile存放ASM的spfile路徑

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.