在linux上安装完oracle数据库后,如何修改ORACLE_HOSTNAME
预备:先关闭ORACLE数据库及监听,具体方法见:http://blog.csdn.net/zxnlmj/article/details/23096877
1、修改HOSTS文件,添加JTWF到本机IP地址的映射:
[root@JTWF home]# gedit /etc/hosts最后一行为添加的:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 16.54.136.81 JTWF
2、修改/etc/sysconfig/network添加如下:
[root@JTWF home]# gedit /etc/sysconfig/network NETWORKING=yes HOSTNAME=JTWF
3、修改listener.ora
su oracle gedit /home/oracle/product/11.2/db_1/network/admin/listener.ora
修改HOST由HOST=localhost改为HOST=JTWF(随意):
# listener.ora Network Configuration File: /home/oracle/product/11.2/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = JTWF)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /home/oracle
4、tnsnames.ora文件不修改也可,我没修改
gedit /home/oracle/product/11.2/db_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/product/11.2/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。