Oracle环境变量、监听listener.ora、tnsnames.ora、sqlnet.ora配置

简介: Oracle环境变量、监听listener.ora、tnsnames.ora、sqlnet.ora配置 点击(此处)折叠或打开 NLS_DATE_FORMAT=YYYY-MM-DD HH24:mi:ss NLS_LANG=AMERICAN_CHINA.

Oracle环境变量、监听listener.ora、tnsnames.ora、sqlnet.ora配置


点击(此处)折叠或打开

  1. NLS_DATE_FORMAT=YYYY-MM-DD HH24:mi:ss
  2. NLS_LANG=AMERICAN_CHINA.ZHS16GBK
  3. ORACLE10G=D:\Program files\app\oracle\product\10.2.0\db_1
  4. ORACLE11G=D:\Program files\app\oracle\product\11.2.0.1\dbhome_1
  5. ORACLE8I=D:\Program files\app\oracle\product\ora8i
  6. ORACLE9I=D:\Program files\app\oracle\product\ora92
  7. ORACLE_HOME=D:\Program files\app\oracle\product\11.2.0.1\dbhome_1
  8. PATH=%ORACLE_HOME%\bin
  9. TNS_ADMIN=%ORACLE_HOME%\NETWORK\ADMIN




  10. ---------cmd下设置用户环境变量
  11. SETX "NLS_DATE_FORMAT" "YYYY-MM-DD HH24:MI:SS"
  12. SETX "NLS_LANG" "AMERICAN_CHINA.ZHS16GBK"
  13. SETX "ORACLE10G" "D:\Program files\app\oracle\product\10.2.0\db_1"
  14. SETX "ORACLE11G" "D:\Program files\app\oracle\product\11.2.0.1\dbhome_1"
  15. SETX "ORACLE8I" "D:\Program files\app\oracle\product\ora8i"
  16. SETX "ORACLE9I" "D:\Program files\app\oracle\product\ora92"
  17. SETX "ORACLE_HOME" "D:\Program files\app\oracle\product\11.2.0.1\dbhome_1"
  18. SETX "TNS_ADMIN" "%ORACLE_HOME%\NETWORK\ADMIN"
  19. SETX "Path" "%ORACLE_HOME%\bin"
  20. SETX "VBOX_MSI_INSTALL_PATH" "D:\Program Files\Oracle\VirtualBox"



  21. alter session set nls_language='SIMPLIFIED CHINESE';
  22. alter system set nls_language='AMERICAN' scope=spfile;




  23. ------------------------------------ sqlnet.ora----------------------------------------------
  24. ---------- windows
  25. SQLNET.AUTHENTICATION_SERVICES= (NTS)
  26. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

  27. ---------- linux
  28. SQLNET.AUTHENTICATION_SERVICES= (ALL)
  29. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



  30. --------------------------------------------------------------------- oracle
  31. # .bash_profile

  32. # Get the aliases and functions
  33. if [ -f ~/.bashrc ]; then
  34.     . ~/.bashrc
  35. fi

  36. # User specific environment and startup programs

  37. export PATH=$PATH:/sbin/:$HOME/bin

  38.   
  39. # for oracle user

  40. unset USERNAME

  41. export GLOBAL_DB_UNIQUE_NAME=orclasm
  42. export ORACLE_HOSTNAME=192.168.128.134
  43. export ORACLE_UNQNAME=orclasm

  44. export EDITOR=vi
  45. export ORACLE_SID=orclasm
  46. export ORACLE_BASE=/u01/app/oracle
  47. export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
  48. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
  49. export ORACLE_ALERT=$ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace
  50. export PATH=$ORACLE_HOME/bin:$PATH
  51. export TNS_ADMIN=$ORACLE_HOME/network/admin
  52. export ORACLE_PATH=.:$ORACLE_BASE/dba_scripts/sql:$ORACLE_HOME/rdbms/admin
  53. umask 022

  54. #export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"    SELECT userenv('LANGUAGE') db_NLS_LANG FROM DUAL;
  55. export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
  56. export SQLPATH=$ORACLE_HOME/sqlplus/admin
  57. export NLS_DATE_FORMAT='YYYY-MM-DD HH24:mi:ss';

  58. alias sqlplus='rlwrap sqlplus'
  59. alias rman='rlwrap rman'
  60. alias asmcmd='rlwrap asmcmd'
  61. alias alert_log='tail -200f $ORACLE_ALERT/alert_$ORACLE_SID.log'
  62. alias alert_xml='tail -200f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/alert/log.xml'
  63. alias alert_listener='tail -200f $ORACLE_BASE/diag/tnslsnr/rhel6/listener/trace/listener.log'


  64.  



  65. stty erase ^h
  66. ORACLE_HOME=D:\Program files\app\oracle\product\11.2.0.1\dbhome_1
  67. PATH=%ORACLE_HOME%\bin
  68. TNS_ADMIN=%ORACLE_HOME%\NETWORK\ADMIN
  69. ##NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
  70. NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
  71. #ORACLE_SCRIPT=%ORACLE_HOME%\RDBMS\ADMIN
  72. SQLPATH=.;%ORACLE_BASE%\dba_scripts\sql;%ORACLE_HOME%\rdbms\admin


  73. NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280"
  74. NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
  75. NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
  76. NLS_LANG=AMERICAN_AMERICA.UTF8
  77. NLS_LANG=AMERICAN_AMERICA.AL32UTF8
  78. NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
  79. NLS_LANG=AMERICAN_CHINA.ZHS16GBK


  80. NLS_DATE_FORMAT='YYYY-MM-DD HH24:mi:ss'




  81. --------------------------------------------------------------------- grid

  82. # .bash_profile

  83. # Get the aliases and functions
  84. if [ -f ~/.bashrc ]; then
  85.         . ~/.bashrc
  86. fi

  87. # User specific environment and startup programs

  88. export PATH=$PATH:$HOME/bin


  89. # for grid user
  90. export ORACLE_SID=+ASM
  91. export ORACLE_BASE=/u01/app/grid
  92. export ORACLE_HOME=/u01/app/grid/11.2.0
  93. export LD_LIBRARY_PATH=$ORACLE_HOME/lib
  94. export PATH=$ORACLE_HOME/bin:$PATH
  95. umask 022


  96. alias sqlplus='rlwrap sqlplus'
  97. alias asmcmd='rlwrap asmcmd'
  98. alias alert_log='tail -200f $ORACLE_BASE/diag/asm/+asm/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
  99. alias crsd_log='tail -200f $ORACLE_HOME/log/$HOSTNAME/crsd/crsd.log'



  100. 在linux和unix上有时不知道该使用LD_LIBRARY_PATH还是LIBPATH,经过搜索和实际使用,实际的情况如下

  101. OS Environment Variable                Name
  102. Linux                        LD_LIBRARY_PATH
  103. Solaris 32-bit ruby                LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH
  104. Solaris 64-bit ruby                LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH
  105. HP-UX PA-RISC 32-bit ruby            SHLIB_PATH
  106. HP-UX PA-RISC 64-bit ruby            LD_LIBRARY_PATH
  107. HP-UX IA64                    LD_LIBRARY_PATH
  108. Mac OS X                    DYLD_LIBRARY_PATH
  109. AIX                        LIBPATH



  110. -----------------------------------------------------------------------------------------------
  111. ------------------------------------listener.ora--------------------------------------------
  112. --动态监听: alter system set LOCAL_LISTENER='(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.157)(PORT = 1521))';
  113. -----------------------------------------------------------------------------------------------
  114. # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
  115. # Generated by Oracle configuration tools.

  116. LISTENER =
  117.   (DESCRIPTION_LIST =
  118.     (DESCRIPTION =
  119.       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1521))
  120.     )
  121.   )
  122. SID_LIST_LISTENER =
  123.   (SID_LIST =
  124.    (SID_DESC =
  125.       (SID_NAME = PLSExtProc)
  126.       (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
  127.       (PROGRAM = extproc)
  128.     )
  129.    (SID_DESC =
  130.      (GLOBAL_DBNAME = orcl.lhr.com)
  131.      (SID_NAME = orcl)
  132.      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
  133.    )
  134.    (SID_DESC =
  135.      (GLOBAL_DBNAME = rman.lhr.com)
  136.      (SID_NAME = rman)
  137.      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
  138.    )
  139.   )

  140. LSNR2 =
  141.   (DESCRIPTION_LIST =
  142.     (DESCRIPTION =
  143.       (ADDRESS_LIST =
  144.         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1526))
  145.       )
  146.     )
  147.   )
  148. SID_LIST_LSNR2 =
  149.   (SID_LIST =
  150.     (SID_DESC =
  151.       (SID_NAME = PLSExtProc)
  152.       (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
  153.       (PROGRAM = extproc)
  154.     )
  155.   )

  156. ADR_BASE_LISTENER = /u01/app/oracle


  157. ------------windows 下
  158. SID_LIST_LISTENER =
  159.   (SID_LIST =
  160.     (SID_DESC =
  161.       (SID_NAME = CLRExtProc)
  162.       (ORACLE_HOME = D:\app\oracle\product\11.2.0.1)
  163.       (PROGRAM = extproc)
  164.       (ENVS = "EXTPROC_DLLS=ONLY:D:\app\oracle\product\11.2.0.1\bin\oraclr11.dll")
  165.     )
  166.     (SID_DESC =
  167.      (GLOBAL_DBNAME = orcl.lhr.com)
  168.      (SID_NAME = orcl)
  169.      (ORACLE_HOME = D:\app\oracle\product\11.2.0.1)
  170.    )
  171.   )


  172. -----------------------/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
  173. # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
  174. # Generated by Oracle configuration tools.

  175. orcl =
  176.   (DESCRIPTION =
  177.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.133)(PORT = 1521))
  178.     (CONNECT_DATA =
  179.       (SERVER = DEDICATED)
  180.       (SERVICE_NAME = orcl.lhr.com)
  181.     )
  182.   )

  183. #### 动态监听非默认端口
  184. LSNR_ORCL =
  185.   (DESCRIPTION =
  186.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1526))
  187.     (CONNECT_DATA =
  188.       (SERVICE_NAME = orcl)
  189.     )
  190.   )


  191. -------------------------------------------------------------------- rac
  192. --- TAF BASIC方式
  193. racdb_vip =
  194.   (DESCRIPTION =
  195.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))
  196.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))
  197.     (LOAD_BALANCE = on)
  198.     (CONNECT_DATA =
  199.       (SERVER = DEDICATED)
  200.       (SERVICE_NAME = jmrac)
  201.       (FAILOVER_MODE =
  202.          (TYPE = SELECT)
  203.          (METHOD = BASIC)
  204.          (RETRIES = 180)
  205.          (DELAY = 5)
  206.       )
  207.     )
  208.   )

  209. --- TAF preconnect方式
  210. racdb_vip1 =
  211.   (DESCRIPTION =
  212.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))
  213.     (CONNECT_DATA =
  214.       (SERVER = DEDICATED)
  215.       (SERVICE_NAME = jmrac)
  216.       (FAILOVER_MODE =
  217.          (TYPE = SELECT)
  218.          (METHOD = BASIC)
  219.          (BACKUP = preconnect)
  220.       )
  221.     )
  222.   )

  223. racdb_vip2 =
  224.   (DESCRIPTION =
  225.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))
  226.     (CONNECT_DATA =
  227.       (SERVER = DEDICATED)
  228.       (SERVICE_NAME = jmrac)
  229.       (FAILOVER_MODE =
  230.          (TYPE = SELECT)
  231.          (METHOD = BASIC)
  232.          (BACKUP = preconnect)
  233.       )
  234.     )
  235.   )

目录
相关文章
|
6月前
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——Dept实体类和对应的配置信息
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——Dept实体类和对应的配置信息
|
6月前
|
Oracle 关系型数据库 Linux
Oracle设置监听之Navicat的锅
Oracle设置监听之Navicat的锅
102 0
|
2月前
|
Ubuntu Oracle 关系型数据库
Oracle VM VirtualBox之Ubuntu 22.04LTS双网卡网络模式配置
这篇文章是关于如何在Oracle VM VirtualBox中配置Ubuntu 22.04LTS虚拟机双网卡网络模式的详细指南,包括VirtualBox网络概述、双网卡网络模式的配置步骤以及Ubuntu系统网络配置。
260 3
|
3月前
|
Oracle 关系型数据库 BI
ORACLE Apex: EBS多组织结构 理解与配置
【8月更文挑战第11天】在Oracle Apex中理解和配置与EBS多组织结构相关内容需掌握:1) EBS多组织结构概念及组成部分,如法律实体、业务单位与库存组织;2) Oracle Apex与EBS集成的目的与方式,包括提供友好界面及自定义业务流程;3) 在Apex中配置多组织结构应用,涉及数据访问控制、页面报表设计及业务流程集成。整体而言,需精通EBS架构与Apex开发技术,以实现高效灵活的企业解决方案。
|
4月前
|
Oracle 关系型数据库 Unix
关系型数据库Oracle设置环境变量:
【7月更文挑战第22天】
554 4
|
6月前
|
SQL Oracle 关系型数据库
实时计算 Flink版产品使用合集之可以通过配置Oracle数据库的schema注册表来监测表结构的变化吗
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
53 1
|
6月前
|
敏捷开发 人工智能 Oracle
Oracle PLM Agile936 单点登录配置方式
Oracle PLM Agile936 单点登录配置方式
|
SQL Oracle 关系型数据库
Oracle21C + PLSQL Developer 15 + Oracle客户端21安装配置完整图文版
Oracle21C + PLSQL Developer 15 + Oracle客户端21安装配置完整图文版
521 0
|
6月前
|
JavaScript Java 数据库连接
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——Emp实体类和对应的配置信息
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——Emp实体类和对应的配置信息
|
消息中间件 Oracle 关系型数据库
Flink CDC确实支持Oracle分区表的CDC,但是在配置时需要特别注意。以下是一些可能的解决方案
Flink CDC确实支持Oracle分区表的CDC,但是在配置时需要特别注意。以下是一些可能的解决方案
133 1