How to use After installing the oracle PLSQL connection [I] installed after Oracle and PLSQLDeveloper, not optional when PLSQLDeveloper Log database and connection issues

simply put:

First, if your locally-installed 32-bit Oracle, you can configure the relevant directory under the file directly in the PLSQl oracle installation path, the direct start PLSQL

Second, if you are 64 locally installed or oracle of Oracle server is not local, to use PLSQL you must install a 32-bit Oracle client,

[Client after extracting the directory C: \ New NETWORK \ ADMIN directory instantclient_11_2 directory, create ADMIN tnsnames.ora file in the directory, add database TNS. eg:

localdb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

[Orcl oracle is the default when installing a named instance name, localdb is just starting identity name to select the drop-down select PLSQL]

Then add two environment variables, add a path after path
1, the TNS_ADMIN value: E: \ App \ OYK \ Product \ 11.2.0 \ dbhome_1 \ the NETWORK \ ADMIN ( the Oracle client installation location coupled with our modified tnsnames. ora file directory )

2, character set environment variables NLS_LANG value: SIMPLIFIED CHINESE_CHINA.ZHS16GBK

3, add the oracle client's bin directory to the path environment variable, such as I: C: \ the Oracle \ ora90 \ BIN \

 

turn:

After installing Oracle and PLSQLDeveloper, not optional when PLSQLDeveloper Log database and connection issues

1. Log in PL / SQL Developer

Here Oracle database and PL / SQL Developer installation steps omitted, pay attention when installing the PL / SQL Developer software, do not install in the Program Files (x86) directory, or can not start PL / SQL Developer.

 

Here wonder why not choose TNS database it? I first installed the database, and then install PL / SQL Developer. It stands to reason when installing PL / SQL Developer, we had already identified the Oracle Home and OCI Libaray up. What the hell? First non-login Login PL / SQL Developer, Oracle Home and set the OCI Libaray.

 

 In Oracle Home This option does not automatically recognize Oracle Home directory, and then manually specify the Oracle Home path.

 

Click "OK" to exit the PL / SQL Developer, log in again.

 

 Or choose less database TNS, no database login attempts, to see what error report.

 

Finally found the key problem, the installation of PL / SQL Deleloper only recognizes oci.dll 32's. It seems safe to 64-bit PL / SQL Deleloper, then search PL / SQL Deleloper 64-bit version online. However, I found PL / SQL Deleloper does not distinguish between 64-bit and 32-bit. It seems only from oci.dll start with. The information given above, it seems that so long as a 32-bit version Installation Oracle Client.

 

2. Install oracle Clinet

首先到Oracle官网上去下载一个Oracle 11g Client,不过需要先申请一个Oracle 帐号,才能下载。

目前下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

 这个一个绿色版的Oracle Client,因此只要需要解压了,就可以是。将下载的Oracle Client文件instantclient-basic-win32-11.2.0.1.0.zip解压到C盘(注意啦!不能下64位的)。然后在解压后的C:\instantclient_11_2目录下新建NETWORK\ADMIN目录,在ADMIN目录下新建tnsnames.ora文件,添加数据库TNS。

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = chiclewu-PC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

(注意:tnsnames.ora文件也可以从Oracle数据库HOME目录的NETWORK\ADMIN目录,还要把sqlnet.ora拷贝过来。然后确定HOST配置是否正确,如果HOST是主机名,需要把主机名后面的域名去掉)

 

3.配置PL/SQL Developer的Oracle Home和OCI Libaray

以非登录模式进入PL/SQL Developer,将Oracle Home路径指定为Oracle Client目录(C:\instantclient_11_2),OCI Libaray路径为Oracle Client目录的oci.dll(C:\instantclient_11_2\oci.dll)。

 

点击“确定”,现在配置已完成,下面就是等待奇迹的时刻。退出PL/SQL Developer。

 

4:添加环境变量(系统变量中添加2个)

   (TNS_ADMIN 值: E:\app\OYK\product\11.2.0\dbhome_1\NETWORK\ADMIN(oracle11g 安装的位置))

    

      第二个是指定数据库使用的编码。如果不设置成以下值,那么连接上数据库后,你看到的所有中文的内容将会是 乱码,都是一堆问号 。
     NLS_LANG 值:SIMPLIFIED CHINESE_CHINA.ZHS16GBK
    

5.重启plsql,或者电脑验证Oracle Client

打开新的PL/SQL Developer,输入用户名和密码,在database选项下,可以看刚才配置的TNS了。

 

 

等待奇迹时刻...........

经过几秒钟的等待,奇迹时刻终于到来了,可以登录了,可以登录了........

检验一下是否可以查询数据。

 

查询数据没有问题,终于大功告成了。

 

参考:

https://blog.csdn.net/finality_000/article/details/49681973

https://www.cnblogs.com/ymj126/p/3712727.html

https://blog.csdn.net/ping802363/article/details/54582002

Guess you like

Origin www.cnblogs.com/libin6505/p/11905341.html