您好,登錄后才能下訂單哦!
下面測(cè)試來(lái)至一次增加與刪除實(shí)例實(shí)驗(yàn),在10G RAC中知道監(jiān)聽(tīng)是通過(guò)netca來(lái)管理的,跟11G的機(jī)制不一樣。
當(dāng)增加節(jié)點(diǎn)的時(shí)候,需要手動(dòng)執(zhí)行netca來(lái)注冊(cè)監(jiān)聽(tīng)服務(wù)。其實(shí)我們也可以通過(guò)crs_profile工具來(lái)手動(dòng)注冊(cè)監(jiān)聽(tīng)服務(wù)。
歡迎大家加入ORACLE超級(jí)群:17115662 免費(fèi)解決各種ORACLE問(wèn)題
數(shù)據(jù)庫(kù)版本信息
[oracle@www.htz.pw oracle] $sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun May 11 17:06:26 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options
SQL> select * from v$version;
BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for Solaris: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production |
1,配置tnsnames.ora與listener.ora文件
如下:
[root@www.htz.pw admin] $ cat listener.ora # listener.ora.sol1 Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.sol1 # Generated by Oracle configuration tools.
LISTENER_SOL1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.111.48)(PORT = 1521)(IP = FIRST)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.111.46)(PORT = 1521)(IP = FIRST)) ) ) #這里建議使用IP地址 SID_LIST_LISTENER_SOL1 = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) )
[root@www.htz.pw app] $cd $ORACLE_HOME/network/admin [root@www.htz.pw admin] $ cat tnsnames.ora # tnsnames.ora.sol1 Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora.sol1 # Generated by Oracle configuration tools.
LISTENERS_SOL10G = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = sol1-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = sol2-vip)(PORT = 1521)) ) #這里建議使用IP地址,在10G中配置REMOTE_LISTENER的時(shí)候,默認(rèn)會(huì)用到這里的東西 SOL10G2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = sol2-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sol10g) (INSTANCE_NAME = sol10g2) ) )
SOL10G1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = sol1-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sol10g) (INSTANCE_NAME = sol10g1) ) )
SOL10G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = sol1-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = sol2-vip)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sol10g) ) ) |
2,crs_register注冊(cè)監(jiān)聽(tīng)服務(wù)
注意監(jiān)聽(tīng)服務(wù)有兩種方法,1,利用現(xiàn)在的監(jiān)聽(tīng)的配置信息。2,使用crs_profile來(lái)創(chuàng)建
2.1 利用現(xiàn)有的監(jiān)聽(tīng)配置信息
[oracle@www.htz.pw oracle] $ crs_stat -p ora.sol2.LISTENER_SOL2.lsnr >/tmp/listener.txt 這里導(dǎo)出正常節(jié)點(diǎn)的監(jiān)聽(tīng)配置信息
[oracle@www.htz.pw oracle] $ cat /tmp/listener.txt NAME=ora.sol1.LISTENER_SOL1.lsnr #這里需要注意的LISTENER_SOL1這個(gè)名字需要跟listener.ora中的監(jiān)聽(tīng)名一致 TYPE=application ACTION_SCRIPT=/oracle/app/oracle/product/10.2.0/db_1/bin/racgwrap ACTIVE_PLACEMENT=0 AUTO_START=1 CHECK_INTERVAL=600 DESCRIPTION=CRS application for listener on node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=sol1 OPTIONAL_RESOURCES= PLACEMENT=restricted REQUIRED_RESOURCES=ora.sol1.vip RESTART_ATTEMPTS=5 SCRIPT_TIMEOUT=600 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF= USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK= USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP= 一共就3個(gè)地址需要修改 [oracle@www.htz.pw oracle]$ mv /tmp/listener.txt $ORA_CRS_HOME/crs/public/ora.sol1.LISTENER_SOL1.lsnr.cap [oracle@www.htz.pw oracle]$ crs_register ora.sol1.LISTENER_SOL1.lsnr [oracle@www.htz.pw oracle]$ crs_start ora.sol1.LISTENER_SOL1.lsnr Attempting to start `ora.sol1.LISTENER_SOL1.lsnr` on member `sol1` Start of `ora.sol1.LISTENER_SOL1.lsnr` on member `sol1` succeeded. 監(jiān)聽(tīng)能正常啟動(dòng) |
2.2 使用crs_profiler來(lái)手動(dòng)創(chuàng)建監(jiān)聽(tīng)
不到萬(wàn)不得以,不建議使用下面的方法
[oracle@www.htz.pw oracle]$ crs_profile -create ora.sol1.LISTENER_SOL1.lsnr -t application -a /oracle/app/oracle/product/10.2.0/db_1/bin/racgwrap -d "CRS application for listener on node" -h sol1 -r ora.sol1.vip -p restricted -o as=1,ci=600,st=600,ra=5
[oracle@www.htz.pw oracle]$ cat ora.sol1.LISTENER_SOL1.lsnr.cap NAME=ora.sol1.LISTENER_SOL1.lsnr TYPE=application ACTION_SCRIPT=/oracle/app/oracle/product/10.2.0/db_1/bin/racgwrap ACTIVE_PLACEMENT=0 AUTO_START=1 CHECK_INTERVAL=600 DESCRIPTION=CRS application for listener on node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=sol1 OPTIONAL_RESOURCES= PLACEMENT=restricted REQUIRED_RESOURCES=ora.sol1.vip RESTART_ATTEMPTS=5 SCRIPT_TIMEOUT=600 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF= USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK= USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP=
[oracle@www.htz.pw oracle]$ crs_register ora.sol1.LISTENER_SOL1.lsnr [oracle@www.htz.pw oracle]$ crs_start ora.sol1.LISTENER_SOL1.lsnr Attempting to start `ora.sol1.LISTENER_SOL1.lsnr` on member `sol1` Start of `ora.sol1.LISTENER_SOL1.lsnr` on member `sol1` succeeded
其實(shí)如果是VIP資源的時(shí)候,我們需要注意了,因?yàn)?/span>VIP資料的屬組是root [oracle@www.htz.pw oracle]$ crs_stat -ls Name Owner Primary PrivGrp Permission ----------------------------------------------------------------- ora....L1.lsnr oracle oinstall rwxrwxr-- ora.sol1.gsd oracle oinstall rwxr-xr-- ora.sol1.ons oracle oinstall rwxr-xr-- ora.sol1.vip root oinstall rwxr-xr-- ora.sol10g.db oracle oinstall rwxrwxr-- ora....g2.inst oracle oinstall rwxrwxr-- ora....SM2.asm oracle oinstall rwxrwxr-- ora....L2.lsnr oracle oinstall rwxrwxr-- ora.sol2.gsd oracle oinstall rwxr-xr-- ora.sol2.ons oracle oinstall rwxr-xr-- ora.sol2.vip root oinstall rwxr-xr |
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。