dg報表的cron監控時間出現異常。緣由是dg後臺的cron「6 * * * * /etc/paic/shell/odg_mon_stat_dg.sh」在每一個小時06分會連入monitor更新數據。dg報表有300多個dg,每一個dg至少鏈接monitor3次,經ssc分析這是一個鏈接風暴。
對monitor監聽實施監聽負載平衡的方案,經過多個監聽器的負載均衡和冗餘,能夠實現對listener crash問題的workaround,若是再次遇到該問題,當LISTENER監聽器異常crash時,新鏈接會自動經過另外一個監聽器鏈接,客戶端新建鏈接不會感受到切換,能夠避免客戶體驗下降。 shell
現有listener: MONITOR = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1530)(queuesize=1024)) ) ) 考慮到目前dg報表中有300個dg庫,每一個庫至少同時鏈接3次monitor,從長遠看,往後還會增長同城dg和上海dg,所以添加至5個listener。 vi listener.ora 添加以下內容: SID_LIST_MONITOR2 = (SID_LIST = (SID_DESC = (ORACLE_HOME = /paic/app/oracle/rdbms/11g/11.2.0.2_1) (SID_NAME = monitor ) ) ) MONITOR2 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1531)) ) ) SID_LIST_MONITOR3 = (SID_LIST = (SID_DESC = (ORACLE_HOME = /paic/app/oracle/rdbms/11g/11.2.0.2_1) (SID_NAME = monitor ) ) ) MONITOR3 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1532)) ) ) SID_LIST_MONITOR4 = (SID_LIST = (SID_DESC = (ORACLE_HOME = /paic/app/oracle/rdbms/11g/11.2.0.2_1) (SID_NAME = monitor ) ) ) MONITOR4 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1533)) ) ) SID_LIST_MONITOR5 = (SID_LIST = (SID_DESC = (ORACLE_HOME = /paic/app/oracle/rdbms/11g/11.2.0.2_1) (SID_NAME = monitor ) ) ) MONITOR5 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1534)) ) )
lsnrctl start MONITOR2 lsnrctl start MONITOR3 lsnrctl start MONITOR4 lsnrctl start MONITOR5 Lsnrctl Status 查看都爲ready,則進行下一步。
3. 修改monitor主機的tns 數據庫
備份: cp tnsnames.ora tnsnames.ora.0807bk Vi tnsnames.ora LOCAL_MONITOR = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1530)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1531)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1532)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1533)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1534)) ) ) MONITOR = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1530)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1531)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1532)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1533)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.33.30.64)(PORT = 1534)) (CONNECT_DATA = (SERVICE_NAME = monitor) ) )
4. 修改參數 oracle
alter system set local_listener='LOCAL_MONITOR' scope=both;
6. 配置監聽的HA切換腳本
6.1 /oracle_grid/11.2.0/grid/crs/public/monitor增長資源切換的act_lsnr.ksh腳本。
act_lsnr.ksh腳本的做用就是資源切換的時候,起停監聽。增長几組act_lsnr.ksh腳本,將每一個腳本中的監聽名字指定爲對應的monitor新增的監聽。用以控制新監聽的起停。如act_lsnr2.ksh中修改監聽名字爲monitor2
新增腳本: act_lsnr.ksh act_lsnr2.ksh act_lsnr3.ksh act_lsnr4.ksh act_lsnr5.ksh
6.2 測試腳本可以正常起停新的監聽。
6.3 將腳本增長到集羣的全部節點上,保持一致。
6.3 通知主機組增長monitor的資源控制,將幾個監聽都配置好資源管理。
6.3 安排monitor切換測試,驗證listeners的正常起停。 app
7. 在dg client端修改monitor的鏈接串以下: 負載均衡
MONITOR = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP)(HOST = monitor.db.paic.com.cn)(PORT = 1530)) (ADDRESS = (PROTOCOL = TCP)(HOST = monitor.db.paic.com.cn)(PORT = 1531)) (ADDRESS = (PROTOCOL = TCP)(HOST = monitor.db.paic.com.cn)(PORT = 1532)) (ADDRESS = (PROTOCOL = TCP)(HOST = monitor.db.paic.com.cn)(PORT = 1533)) (ADDRESS = (PROTOCOL = TCP)(HOST = monitor.db.paic.com.cn)(PORT = 1534)) (CONNECT_DATA = (SERVICE_NAME = monitor) ) )