Home Database Mysql Tutorial 客户端使用SCNAIP连接11G RAC数据库报错ORA-12545解决

客户端使用SCNAIP连接11G RAC数据库报错ORA-12545解决

Jun 07, 2016 pm 05:34 PM

客户端使用SCNAIP连接11G RAC数据库报错ORA-12545解决

客户端配置及报错:

[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 归档日志过大导致无法存储的解决办法

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Reduce the use of MySQL memory in Docker Reduce the use of MySQL memory in Docker Mar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How to solve the problem of mysql cannot open shared library How to solve the problem of mysql cannot open shared library Mar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin) Run MySQl in Linux (with/without podman container with phpmyadmin) Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overview What is SQLite? Comprehensive overview Mar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guide Running multiple MySQL versions on MacOS: A step-by-step guide Mar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles