程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> 在linux上安裝完oracle數據庫後,如何修改ORACLE_HOSTNAME

在linux上安裝完oracle數據庫後,如何修改ORACLE_HOSTNAME

編輯:Oracle教程

預備:先關閉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)
    )
  )

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved