码迷,mamicode.com
首页 > 数据库 > 详细

oracle 配置服务端

时间:2016-09-11 17:18:48      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

oracle 配置服务端,类似我们配置java环境一样

防止乱码的配置:

变量名:NLS_LANG

变量值:SIMPLIFIED CHINESE_CHINA.ZHS16GBK

选择数据库的配置(重要):

变量值:TNS_ADMIN

变量名:D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN(就是你的oracle安装的目录)

这是我的path配置:

D:\app\Administrator\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME%\bin;%MAVEN_HOME%\bin;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

 

 

oracle有两个文件特别重要  listener,和tnsnames,在D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN文件夹下

修改后的文件:

listener:

# listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =   
     (GLOBAL_DBNAME = orcl)   
     (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)   
     (SID_NAME = orcl)   
   )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST =wangPC)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\app\Administrator
tnsnames:

# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLE_105 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORACLE_117 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_j1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_164 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_130 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_211 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_135 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORACLE_136 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orclapp)
    )
  )
ORCL_200 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORACLE_j1200 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 公司数据库地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
 
ORACLE_204 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =公司数据库地址)(PORT = 1515))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = j1rep)
    )
  )
 
  ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wangPC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
   其中HOST=wangPC  ,指的是计算机名,修改计算机名可自行百度,如有疑问可以给我留言

 

 

验证path的配置:

输入sqlplus

用户名:scott

口令(密码):tiger

 

 

注意,只要修改了这两个配置文件,一定要重启oracle服务,记住,一定要先启动OracleServiceORCL 再去启动OracleOraDb11g_home1TNSListener

顺序一定不能变,否则服务不能正常启动,会报监听找不到

 

oracle 配置服务端

标签:

原文地址:http://www.cnblogs.com/wangchuanfu/p/5862101.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!