雖然掌握得不夠深入,但越來越討厭oracle資料庫這個軟體了,實在不願意再孤島這個笨重、複雜的oracle了。今天花了好幾個小時操作一個實驗環境的遷移、配置,記錄幾個步驟吧,也許後續會有用。
■ 檢視資料庫配置資訊
[oracle@node1:0 ~]$ srvctl config database -db likingdb
Database unique name: likingdb
Database name: likingdb
Database instances: likingdb1,likingdb2,likingdb3
Configured nodes: node1,node2,node3
■ 刪除db例項3
dbca -silent -deleteInstance -nodeList node3 -gdbName likingdb -instanceName likingdb3 [-sysDBAUserName sysdba -sysDBAPassword password]
||
[oracle@node1:0 ~]$ dbca -silent -deleteInstance -nodeList node3 -gdbName likingdb -instanceName likingdb3
[WARNING] [DBT-19203] The Database Configuration Assistant will delete the Oracle instance and its associated OFA directory structure. All information about this instance will be deleted.
Prepare for db operation
40% complete
Deleting instance
Unable to copy the file "node3:/etc/oratab" to "/tmp/oratab.node3".
48% complete
52% complete
56% complete
60% complete
64% complete
68% complete
72% complete
76% complete
80% complete
Completing instance management.
100% complete
[FATAL] Illegal Capacity: -1
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/likingdb/likingdb.log" for further details.
■ 更新inventory
su - oracle
cd $ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1 "CLUSTER_NODES={node1,node2}"
■ 在node3刪除GI節點
[root@node3:1 /u01/app/12.2.0/grid/crs/install]# ./rootcrs.sh -deconfig -force
Using configuration parameter file: /u01/app/12.2.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/node3/crsconfig/crsdeconfig_node3_2024-07-23_04-57-58PM.log
PRCR-1070 : 無法檢查 資源 ora.net1.network 是否已註冊
CRS-0184 : Cannot communicate with the CRS daemon.
PRCR-1070 : 無法檢查 資源 ora.helper 是否已註冊
CRS-0184 : Cannot communicate with the CRS daemon.
PRCR-1070 : 無法檢查 資源 ora.ons 是否已註冊
CRS-0184 : Cannot communicate with the CRS daemon.
2024/07/23 16:58:06 CLSRSC-180: An error occurred while executing the command '/u01/app/12.2.0/grid/bin/srvctl config nodeapps'
2024/07/23 16:58:17 CLSRSC-4006: Removing Oracle Trace File Analyzer (TFA) Collector.
2024/07/23 17:00:20 CLSRSC-4007: Successfully removed Oracle Trace File Analyzer (TFA) Collector.
2024/07/23 17:00:21 CLSRSC-336: Successfully deconfigured Oracle Clusterware stack on this node
■ 在node1刪除node3的CRS配置
[root@node1:0 /etc/oracle/scls_scr/node1/root]# crsctl delete node -n node3
CRS-4661: Node node3 successfully deleted.
■ 在刪除節點上更新node list
su - grid
cd $ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/12.2.0/grid "CLUSTER_NODES={node3}" CRS=TRUE -silent -local
■ 在活動節點刪除VIP配置
su - grid
srvctl config vip -node node3
srvctl stop vip -node node3
srvctl remove vip -vip node3-vip
■ 在node1檢查確認
cluvfy stage -post nodedel -n node3
■ 刪除db例項2
dbca -silent -deleteInstance -nodeList node2 -gdbName likingdb -instanceName likingdb2
||
[oracle@node1:0 ~]$ dbca -silent -deleteInstance -nodeList node2 -gdbName likingdb -instanceName likingdb2
[WARNING] [DBT-19203] Database Configuration Assistant 將刪除 Oracle 例項及其關聯的 OFA 目錄結構。所有有關此例項的資訊都將被刪除。
準備執行資料庫操作
已完成 40%
正在刪除例項
無法將檔案 "node2:/etc/oratab" 複製為 "/tmp/oratab.node2"。
已完成 48%
已完成 52%
已完成 56%
已完成 60%
已完成 64%
已完成 68%
已完成 72%
已完成 76%
已完成 80%
正在進行例項管理。
已完成 100%
[FATAL] Illegal Capacity: -1
有關詳細資訊, 請參閱日誌檔案 "/u01/app/oracle/cfgtoollogs/dbca/likingdb/likingdb0.log"。
■ 更新inventory
su - oracle
cd $ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1 "CLUSTER_NODES={node1}"
■ 在node2刪除GI節點
同上
■ 在node1刪除node2的CRS配置
crsctl delete node -n node2
■ 在刪除節點上更新node list
su - grid
cd $ORACLE_HOME/oui/bin
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/12.2.0/grid "CLUSTER_NODES={node2}" CRS=TRUE -silent -local
■ 在活動節點刪除VIP配置
su - grid
srvctl config vip -node node2
srvctl stop vip -node node2
srvctl remove vip -vip node2-vip
■ 在node1檢查確認
cluvfy stage -post nodedel -n node2
■ 增加GI節點node2
首先要配置好ssh互信
${ORACLE_HOME}/oui/prov/resources/scripts/sshUserSetup.sh -hosts "node1 node2 node3" -user grid -advanced
su - grid
cd ${ORACLE_HOME}/bin
cluvfy comp peer -refnode node1 -n node2
cd ${ORACLE_HOME}/addnode
./addnode.sh -silent -ignoreSysPrereqs -ignorePrereqFailure "CLUSTER_NEW_NODES={node2}" "CLUSTER_NEW_PRIVATE_NODE_NAMES={node2-priv2}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={node2-vip}"
各種報錯,實在不願意鼓搗了
srvctl remove vip -vip node2-vip -force