用戶端配置及報錯:
[Oracle@bys3 admin]$ cat tnsnames.ora
bysrac =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) --其中HOST = 192.168.1.228 這裡的IP為RAC的SCANIP。
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bysrac)
)
)
[oracle@bys3 admin]$ tnsping bysrac
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 20:25:19
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) --tnsping可以正常聯通。
用戶端的使用sqlplus bys/bys@bysrac登陸時報錯:ORA-12545: Connect failed because target host or object does not exist
[oracle@bys3 admin]$ sqlplus bys/bys@bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 1 20:10:31 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
################
解決方案:修改RAC的local_listener參數,將參數值中HOST=的值改為當前節點的VIP或者scanip
注意:HOST主機參數為當前節點vip的ip地址時,用戶端通過SCANIP或者VIP都可以串連到RAC資料庫庫--我這裡就是修改為VIP的IP。--其實應該修改為SCANIP,用戶端統一使用SCANIP來串連。
HOST主機參數為scanip地址,則修改完參數後,scanip能夠正常使用,但如果有用戶端配置使用vip的話,串連時則會出現錯誤:ORA-12514: TNS:listener does not currently know of service requested in connect descriptor。
具體修改步驟:
查看RAC的SCANIP狀態及監聽狀態
[oracle@bysrac1 ~]$ su - grid
Password:
[grid@bysrac1 ~]$ srvctl config scan
SCAN name: bysrac-cluster-scan, Network: 1/192.168.1.128/255.255.255.128/eth0
SCAN VIP name: scan1, IP: /bysrac-cluster/192.168.1.228
[grid@bysrac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node bysrac1
[grid@bysrac1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-JAN-2014 20:10:13
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 28-DEC-2013 20:06:56
Uptime 4 days 0 hr. 3 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/app/grid/diag/tnslsnr/bysrac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.226)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.221)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "bysrac" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
Service "caiwu" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
Service "jiaoyi" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@bysrac1 ~]$ exit
[oracle@bysrac1 ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.221 bysrac1 bysrac1.bys.com
192.168.1.226 bysrac1-vip
192.168.1.222 bysrac2 bysrac2.bys.com
192.168.1.227 bysrac2-vip
192.168.10.1 bysrac1-priv
192.168.10.2 bysrac2-priv
192.168.1.228 bysrac-cluster bysrac-cluster-scan
實驗1:修改RAC的local_listener參數,將參數值中HOST=的值改為當前節點的VIP值--RAC多節點都需要改
[oracle@bysrac1 ~]$ sqlplus bys/bys
BYS@ bysrac>select instance_name from v$instance;
INSTANCE_NAME
----------------
bysrac1
BYS@ bysrac1>show parameter local_l -------查看local_listener 參數的值
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=bysr
ac1-vip)(PORT=1521))))
BYS@ bysrac1>alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.226)(PORT=1521))))' sid='bysrac1';
System altered. --這裡HOST=192.168.1.226,修改為該節點VIP的IP值。我這裡只修改了一個節點的,如果多個節點,照此方法在其它節點修改。
BYS@ bysrac1>show parameter local_l
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.1.226)(PORT=1521))))
BYS@ bysrac1>exit ---退出前可以手工註冊下監聽alter system register; 我這裡沒做也是可以的。
Oracle ORA-01555 快照過舊 說明
ORA-01078 和 LRM-00109 報錯解決方案
ORA-01555超長的Query Duration時間
ORA-00471 處理方法筆記
ORA-00314,redolog 損壞,或丟失處理方法
ORA-00257 歸檔日誌過大導致無法儲存的解決辦法