Oracle中怎么修改监听IP地址
本篇文章给大家分享的是有关Oracle中怎么修改监听IP地址,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
一、修改hosts文件
打开cmd,输入hostname,记下主机名 用记事本打开c:\windows\system32\drivers\etc\hosts 文件,添加主机名。
<codeclass="hljsvala">#Copyright(c)1993-2009MicrosoftCorp.#ThisisasampleHOSTSfileusedbyMicrosoftTCP/IPforWindows.#ThisfilecontainsthemappingsofIPaddressestohostnames.Each#entryshouldbekeptonanindividualline.TheIPaddressshould#beplacedinthefirstcolumnfollowedbythecorrespondinghostname.#TheIPaddressandthehostnameshouldbeseparatedbyatleastone#space.##Additionally,comments(suchasthese)maybeinsertedonindividual#linesorfollowingthemachinenamedenotedbya'#'symbol.#Forexample:#102.54.94.97rhino.acme.com#sourceserver#38.25.63.10x.acme.com#xclienthost#localhostnameresolutionishandledwithinDNSitself.#127.0.0.1localhost#::1localhost[主机IP][主机名]</code>
二、修改oracle监听文件
1、打开listener.ora
文件在F:\app\young\product\11.2.0\dbhome_1\NETWORK\ADMIN 目录下,将里面的localhost换为自己的主机名。
<codeclass="hljsvala"><codeclass="hljstex">#listener.oraNetworkConfigurationFile:F:\app\young\product\11.2.0\dbhome_1\network\admin\listener.ora#GeneratedbyOracleconfigurationtools.SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=CLRExtProc)(ORACLE_HOME=F:\app\young\product\11.2.0\dbhome_1)(PROGRAM=extproc)(ENVS="EXTPROC_DLLS=ONLY:F:\app\young\product\11.2.0\dbhome_1\bin\oraclr11.dll")))LISTENER=(DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))(ADDRESS=(PROTOCOL=TCP)(HOST=Young-PC)(PORT=1521))//Young-PC原为localhost))ADR_BASE_LISTENER=F:\app\young</code></code>
2、修改tnsnames.ora
目录同上,也将localhost更改为主机名。
<codeclass="hljsvala"><codeclass="hljstex"><codeclass="hljstex">#tnsnames.oraNetworkConfigurationFile:F:\app\young\product\11.2.0\dbhome_1\network\admin\tnsnames.ora#GeneratedbyOracleconfigurationtools.LISTENER_ORCL=(ADDRESS=(PROTOCOL=TCP)(HOST=Young-PC)(PORT=1521))//Young-PC原为localhostORACLR_CONNECTION_DATA=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))(CONNECT_DATA=(SID=CLRExtProc)(PRESENTATION=RO)))ORCL=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Young-PC)(PORT=1521))//Young-PC原为localhost(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))</code></code></code>
3、重启tnslsnr。
打开cmd,输入以下命令。
<codeclass="hljsvala"><codeclass="hljstex"><codeclass="hljstex"><codeclass="hljssql">lsnrctlstoplsnrctlstartlsnrctlstat</code></code></code></code>
以上就是Oracle中怎么修改监听IP地址,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。