基於Admin-managed刪除節點

zhangsharp20發表於2016-03-25
第一步:檢視RAC的server pool是基於admin-managed還是基於policy-managed

[grid@node2 ~]$ srvctl config database -d prod
Database unique name: prod
Database name: prod
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +ORADATA/prod/spfileprod.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: prod
Database instances: prod1,prod2
Disk Groups: ORADATA
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed

第二步,刪除節點上的例項

[oracle@node2 ~]$ dbca -silent -deleteInstance -nodeList node1 -gdbName prod -instanceName prod1 -sysDBAUserName sys -sysDBAPassword oracle
Deleting instance
1% complete
oracle@node1's password: 
2% complete
6% complete
13% complete
20% complete
26% complete
33% complete
40% complete
46% complete
53% complete
60% complete
66% complete
Completing instance management.
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/prod.log" for further details.
檢視一下RAC資料庫配置資訊

[grid@node2 ~]$ srvctl config database -d prod
Database unique name: prod
Database name: prod
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +ORADATA/prod/spfileprod.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: prod
Database instances: prod2
Disk Groups: ORADATA
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed

第三步,刪除RAC軟體

1、停止要刪除節點的監聽

[oracle@node2 ~]$ srvctl disable listener -l LISTENER -n node1
[oracle@node2 ~]$ srvctl stop listener -l LISTENER -n node1
PRCC-1017 : LISTENER was already stopped on node1
PRCR-1005 : Resource ora.LISTENER.lsnr is already stopped

2、在要刪除的節點上更新inventory的資訊,位置$ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=Oracle_home_location "CLUSTER_NODES={name_of_node_to_delete}" -local

3、在要刪除的節點上,對於nonshared home,解除安裝oracle RAC

$ORACLE_HOME/deinstall/deinstall -local

4、在仍然存在的節點上更新inventory資訊

[oracle@node2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 "CLUSTER_NODES={node2}"
Starting Oracle Universal Installer...


Checking swap space: must be greater than 500 MB.   Actual 3999 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

第四步,刪除叢集節點

刪除完資料例項和oracle rac軟體之後,就可以開始刪除節點

1、確定Grid_home是安裝叢集件的目錄
2、執行下列命令確定要刪除的節點是否是unpinned和active狀態
$olsnodes -s -t
如果是Pinned狀態,執行crsctl unpin css命令
3、失效要刪除的節點的叢集件應用和監控,在要刪除節點的目錄Grid_home/crs/install使用root執行下列命令
執行之前先關閉dbconsole
emctl stop dbconsole
如果使用的是11.2.0.1或者是11.2.0.2,則在執行rootcrs.pl的時候不包括-deinstall標誌

#./rootcrs.pl -deconfig -deinstall -force

如果要刪除多個節點,在每個要刪除的節點執行上述命令

如果要刪除所有節點,加上-lastnode選項,用於清除OCR和voting disks的資訊
# ./rootcrs.pl -deconfig -deinstall -force -lastnode


Note: If you do not use the -force option in the preceding 
command or the node you are deleting is not accessible for you to 
execute the preceding command, then the VIP resource remains 
running on the node. You must manually stop and remove the VIP 
resource using the following commands as root from any node that 
you are not deleting:
# srvctl stop vip -i vip_name -f
# srvctl remove vip -i vip_name -f
Where vip_name is the VIP for the node to be deleted. If you specify 
multiple VIP names, then separate the names with commas and 
surround the list in double quotation marks ("").

4、從不需要刪除的節點上執行以下命令,使用root,在目錄Grid_home/bin

crsctl delete node -n node_to_be_deleted

5、在要刪除的節點上,在Grid_home/oui/bin目錄下執行下列命令

$ ./runInstaller -updateNodeList ORACLE_HOME=Grid_home "CLUSTER_NODES={node_to_be_deleted}" CRS=TRUE -silent -local

6、對於noshared home的,刪除oracle叢集件的目錄
$ Grid_home/deinstall/deinstall –local

Caution: If you do not specify the -local flag, then the command 
removes the Grid Infrastructure home from every node in the cluster.

7、在任何一個沒有被刪除的節點,在 Grid_home/oui/bin目錄下執行下列命令,多個節點用逗號隔開,例如"node1,node2"

$ ./runInstaller -updateNodeList ORACLE_HOME=Grid_home "CLUSTER_NODES=
{remaining_nodes_list}" CRS=TRUE -silent

Notes:
■ You must run this command a second time where ORACLE_
HOME=ORACLE_HOME, and CRS=TRUE -silent is omitted from 
the syntax, as follows:
$ ./runInstaller -updateNodeList ORACLE_HOME=ORACLE_HOME
 "CLUSTER_NODES={remaining_nodes_list}"
■ If you have a shared Oracle Grid Infrastructure home, then 
append the -cfs option to the command example in this step and 
provide a complete path location for the cluster file system.
例如:

[grid@node2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/11.2.0/grid/ "CLUSTER_NODES={node2}" 
Starting Oracle Universal Installer...


Checking swap space: must be greater than 500 MB.   Actual 3962 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

8、執行CVU命令驗證節點是否被刪除

[grid@node2 bin]$ cluvfy stage -post nodedel -n node1





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

相關文章