plsql 连接数据库

对于NLS_LANG环境变量, 最好设置成和数据库端一致, 首先从数据库端查询字符集信息:
SQL> select userenv('language') nls_lang from dual;
NLS_LANG
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK

右击"我的电脑" - "属性" - "高级" - "环境变量" - "系统环境变量":
1>.选择"Path" - 点击"编辑", 把 "D:\Oracle\app\YM\product\instantclient_11_2;" 加入;
2>.点击"新建", 变量名设置为"TNS_ADMIN", 变量值设置为"D:\Oracle\app\YM\product\instantclient_11_2;", 点击"确定";
3>.点击"新建", 变量名设置为"NLS_LANG", 变量值设置为"SIMPLIFIED CHINESE_CHINA.ZHS16GBK", 点击"确定";
最后点击"确定"退出.


network\admin

# tnsnames.ora Network Configuration File: /media/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 218.85.137.110)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

你可能感兴趣的:(plsql)