oracle 配置服务端

删除回忆录丶 提交于 2020-04-06 08:28:55

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

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

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!