検索

tnsnames.ora 在listener的作用,数据库只是在启动的过程中会读到tnsnames.ora中的内容去解析LOCAL_LISTENER,之后tnsnames的变化

1、tnsnames.ora 在listener的作用
数据库只是在启动的过程中会读到tnsnames.ora中的内容去解析LOCAL_LISTENER,之后tnsnames的变化和侦听无关


---设置了LOCAL_LISTENER,1522端口
SQL> show parameter list


NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string LISTENER_1
remote_listener string


---listener.ora里面的内容
[Oracle@node1 admin]$ more listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/db/network/admin/listener.ora
# Generated by Oracle configuration tools.


LISTENER_1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.10)(PORT = 1522))
)


ADR_BASE_LISTENER_1 = /oracle/app/oracle


---tnsnames.ora里面的内容
LISTENER_1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.10)(PORT = 1522))
)
)
目前数据库状态正常

 


现在删除tnsnames。ora,启动数据库
SQL> ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_1
数据库报错,说明数据库在启动的时候是通过tnsnames.ora去解析LOCAL_LISTENER的


step2:修改tnsnames。ora的内容给他一个错误的IP地址
[oracle@node1 admin]$ vi tnsnames.ora


LISTENER_1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.17)(PORT = 1522))
)
)
1.1.1.17为错误的IP
SQL> startup
ORACLE instance started.


Total System Global Area 1054593024 bytes
Fixed Size 1349616 bytes
Variable Size 507512848 bytes
Database Buffers 541065216 bytes
Redo Buffers 4665344 bytes
Database mounted.
Database opened.
SQL>
数据库能正常启动

 


SQL> !ps -ef | grep tns
oracle 3219 1 0 21:26 ? 00:00:00 /oracle/app/oracle/db/bin/tnslsnr LISTENER_1 -inherit
oracle 4125 3881 0 21:40 pts/1 00:00:00 /bin/bash -c ps -ef | grep tns
oracle 4127 4125 0 21:40 pts/1 00:00:00 /bin/bash -c ps -ef | grep tns


SQL> !lsnrctl status LISTENER_1


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 30-SEP-2013 21:40:25


Copyright (c) 1991, 2011, Oracle. All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.10)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_1
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 30-SEP-2013 21:26:50
Uptime 0 days 0 hr. 13 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/db/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/node1/listener_1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=1.1.1.10)(PORT=1522)))
The listener supports no services
The command completed successfully


SQL>

 


没有服务注册到listener


step3:修改tnsnames.ora的内容为正确的IP


重新启动listener
[oracle@node1 admin]$ lsnrctl stop LISTENER_1
[oracle@node1 admin]$ lsnrctl start LISTENER_1


SQL> alter system register;


System altered.


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 admin]$ lsnrctl status LISTENER_1


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 30-SEP-2013 21:43:03


Copyright (c) 1991, 2011, Oracle. All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.10)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_1
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 30-SEP-2013 21:42:30
Uptime 0 days 0 hr. 0 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/db/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/node1/listener_1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=1.1.1.10)(PORT=1522)))
The listener supports no services
The command completed successfully


还是不行
[oracle@node2 admin]$ sqlplus vic@vic2


SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 30 21:43:32 2013


Copyright (c) 1982, 2011, Oracle. All rights reserved.


Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor


客服端也无法连接,说明重启listner对不会读取tnsnames。ora的内容。

接下来请看第2页精彩内容

 

相关阅读:

Oracle数据库中listener.ora sqlnet.ora tnsnames.ora的区别

Oracle RAC 下非缺省端口监听配置(listener.ora tnsnames.ora) 

Oracle RAC 监听配置 (listener.ora tnsnames.ora)

Oracle: listener.ora 、sqlnet.ora 、tnsnames.ora的配置及例子

Oracle本地命名服务tnsnames.ora配置

linux

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
MySQLで既存のビューをドロップまたは変更するにはどうすればよいですか?MySQLで既存のビューをドロップまたは変更するにはどうすればよいですか?May 16, 2025 am 12:11 AM

todropaviewinmysql、 "dropviewifexistsview_name;" andtomodifyaviewを使用して、 "createorreplaceviewview_nameasselect ..."を使用します

MySQLビュー:どのデザインパターンを使用できますか?MySQLビュー:どのデザインパターンを使用できますか?May 16, 2025 am 12:10 AM

mysqlviewscanefectiveativeativeizedesignpatternslikeadapter、decorator、factory、andobserver.1)adapterpatternadaptsdatafromdifferenttablesintoaunifiedview.2)decoratorpatternenhancesdatawithedfieldsfieldsiffieldsiffieldsiffiedを

MySQLでビューを使用することの利点は何ですか?MySQLでビューを使用することの利点は何ですか?May 16, 2025 am 12:09 AM

viewsinmysqlarebenefentialforsimprifiningcomplexqueries、拡張セキュリティ、ダタコンシーニング、および最適化されたパフォーマンスを保証する1)itsmplifyififycomplexqueriesbyencapsulsingthemintoreusableviews.2)viewsencurationecuritybycontrollingcescesces.3)

MySQLで簡単なビューを作成するにはどうすればよいですか?MySQLで簡単なビューを作成するにはどうすればよいですか?May 16, 2025 am 12:08 AM

to CreateAsimpleviewinmysql、usethecreateviewstatement.1)DefinetheTheTheThecreateview_nameas.2)SpecifyTheSelectStatementtatementtatementtatementtatementtatementtatementedeSireddata.3)

MySQLはユーザーステートメントの作成:例と一般的なエラーを作成しますMySQLはユーザーステートメントの作成:例と一般的なエラーを作成しますMay 16, 2025 am 12:04 AM

tocleateusersinmysql、usethecreateuserstatement.1)foralocaluser:createUser'localuser '@' localhost'identifidedifiedifiedified 'securepassword';

MySQLでビューを使用することの限界は何ですか?MySQLでビューを使用することの限界は何ですか?May 14, 2025 am 12:10 AM

mysqlviewshavelimitations:1)supportallsqloperations、制限、dataManipulationswithjoinsorubqueries.2)それらは、特にパフォーマンス、特にパルフェクソルラージャターセット

MySQLデータベースのセキュリティ:ユーザーの追加と特権の付与MySQLデータベースのセキュリティ:ユーザーの追加と特権の付与May 14, 2025 am 12:09 AM

reperusermanmanagementInmysqliscialforenhancingsecurationsinginuring databaseaperation.1)usecreateusertoaddusers、指定connectionsourcewith@'localhost'or@'% '。

MySQLで使用できるトリガーの数にどのような要因がありますか?MySQLで使用できるトリガーの数にどのような要因がありますか?May 14, 2025 am 12:08 AM

mysqldoes notimposeahardlimitontriggers、しかしpracticalfactorsdeTerminetheireffectiveuse:1)serverconufigurationStriggermanagement; 2)complentiggersincreaseSystemload;

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強力な PHP 統合開発環境

SecLists

SecLists

SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

AtomエディタMac版ダウンロード

AtomエディタMac版ダウンロード

最も人気のあるオープンソースエディター

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

MantisBT

MantisBT

Mantis は、製品の欠陥追跡を支援するために設計された、導入が簡単な Web ベースの欠陥追跡ツールです。 PHP、MySQL、Web サーバーが必要です。デモおよびホスティング サービスをチェックしてください。