在linux上安装完oracle数据库后,如何修改ORACLE_HOSTNAME
Posted 求知若饥,虚心若愚。
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在linux上安装完oracle数据库后,如何修改ORACLE_HOSTNAME相关的知识,希望对你有一定的参考价值。
1、修改HOSTS文件,添加JTWF到本机IP地址的映射:
[[email protected] 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添加如下:
[[email protected] 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)
)
)
以上是关于在linux上安装完oracle数据库后,如何修改ORACLE_HOSTNAME的主要内容,如果未能解决你的问题,请参考以下文章
Oracle数据库安装后,如何进行下一步数据库创建和其他操作?
在小红帽linux下安装完32位oracle11g后发现control01.ctl和control02.ctl没有了,求传一份!!!