需求
由于redhat系统上安装了数据库,需要在windows10上面连接数据库查询数据,故而记录一下配置过程。
数据库服务端在redhat系统上,windows10上面需要安装oracle数据库的客户端,而oracle数据库的客户端有oracle client或者用精简版instance-client来代替oracle client
–需要的软件包:
- instantclient-basic-nt-18.3.0.0.0dbru.zip
下载地址(需要使用oracle账号登录,自己注册的即可):
https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
- PL/SQL Developer
Oracle Instant Client是Oracle发布的轻量级数据库客户端,下面我们来看看官方的定义:[^2]
一、Oracle Instant Client
Free, light-weight, and easily installed Oracle Database tools, libraries and SDKs for building and connecting applications to an Oracle Database instance.
Oracle Instant Client enables applications to connect to a local or remote Oracle Database for development and production deployment. The Instant Client libraries provide the necessary network connectivity, as well as basic and high end data features, to make full use of Oracle Database. It underlies the Oracle APIs of popular languages and environments including Node.js, Python and PHP, as well as providing access for OCI, OCCI, JDBC, ODBC and ProC applications. Tools included in Instant Client, such as SQLPlus and Oracle Data Pump, provide quick and convenient data access.
Instant Client Package | Description | References |
Basic | All files required to run OCI, OCCI, and JDBC-OCI applications for Oracle Database | |
Basic Light | Smaller version of the Basic package, with only English error messages and Unicode, ASCII, and Western European character set support | |
SDK | Additional header files and an example makefile for developing OCI and OCCI applications | |
SQL*Plus | Additional package providing the SQL*Plus command-line tool for executing SQL and PL/SQL statements and scripts | |
Tools | Additional tools including Data Pump, SQL*Loader and Workload Replay Client | |
ODBC | Additional libraries providing ODBC | |
Precompilers | Additional tools and libraries providing the Pro*C and Pro*COBOL precompilers | |
JDBC-OCI Supplement | Additional libraries to support Internationalization |
-
将instantclient-basic和instantclient-sqlplus两个安装包放在同一个目录下,解压。
C:\Program Files\instantclient_12_2 -
修改系统变量
NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252 -->> 服务器端字符集
TNS_ADMIN=C:\Program Files\instantclient_12_2 -->> 指定tnsnames.ora所在位置,我的配置如图
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
-
在C:\Program Files\instantclient_12_2 下新建tnsnames.ora配置文件,内容如下:
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl111)
)
)
上述instant-client参考他人博客
上述的安装一个是oracle精简客户端instantclient用来连接oracle服务器。而连接oracle服务器的oracle客户端配置好之后,还需要执行工作中的sql命令,光连接上oracle服务器没有生产力,故需要一个sql命令窗口如dos,或者图形界面工具pl/sql developer
二、PL/SQL Developer 13.0 [^1]
PL/SQL Developer is an Integrated Development Environment that is specifically targeted at the development of stored program units for Oracle Databases. Over time we have seen more and more business logic and application logic move into the Oracle Server, so that PL/SQL programming has become a significant part of the total development process. PL/SQL Developer focuses on ease of use, code quality and productivity, key advantages during Oracle application development.
PL/SQL Developer是一个集成开发环境,专门针对Oracle数据库的存储程序单元的开发。随着时间的推移,我们看到越来越多的业务逻辑和应用程序逻辑进入Oracle服务器,因此PL/SQL编程已经成为整个开发过程的重要组成部分。PL/SQL Developer关注于易用性、代码质量和生产力,以及在Oracle应用程序开发期间的主要优势。plsql百科详细解释
plsql develop取消登录
1、从头安装及配置PL/SQL Developer
plsql它人博客
2、PL/SQL Developer配置使用说明
plsql它人博客
以oracle精简客户端连接服务器,sqlplus作为sql命令工具(或者上述用的plsql developer)
1、sqlplus 的安装和配置
https://blog.youkuaiyun.com/quliuwuyiz/article/details/79965965
2、sqlplus下载及配置
https://blog.youkuaiyun.com/quliuwuyiz/article/details/79965965
上面的介绍是oracle client精简版,而下面是oracle client的标准版
1、windows本地安装配置oracle客户端完整流程(截图版)
https://blog.youkuaiyun.com/qq_26442553/article/details/79596967
2、oracle 用Sqlplus连接的时候中文出现乱码“?胧淙胗没?”的解决方案
https://www.baidu.com/link?url=9gsyq8HLlvHuct8ewFpH2HKIhZn9AtXdoJVl0-vTZ0DKiteueSXh5Fw3vMwftkGVzhvyKOm9nU52Wzv2SWspa_&wd=&eqid=e6ca354d0008ff40000000035c962fa1