Use PL/SQL to connect to Oracle without installing the Oracle client
Want to connect to the Oracle database? Install the client. OH ~ NO !, A few hundred megabytes are missing. Now you only need to download a software named Instant Client Package from Oracle. You only need to decompress the Package and use it, and the size is more than 30 MB, which is very convenient, even if the system is reinstalled, it can still be used.
1. Take 11.2.0.3.0 version as an example, download Basic software package (to support Chinese can only download Basic software package),: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
2. decompress the downloaded package to D: \ instantclient_10_2 \ or any directory. The path below prevails;
3. Set environment variables:
NLS_lANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
TNS_ADMIN= D:\instantclient_10_2\
Path=D:\instantclient_10_2\;%Path%
Note:
- NLS_LANG: Chinese characters may be garbled during database access. The setting of NLS_lANG is very important. If it is not configured, the following warning will pop up during PL/SQL login:
- TNS_ADMIN: If not set, tnsnames. ora is addressed to the NETWORK \ ADMIN directory under the Instant Client Directory by default. If the file Oracle is not found, an ORA-12154 error is reported, as shown in:
- Path: This has been tried, and it has no effect if it is not set;
4. Compile tnsnames. ora according to the following content and save it to the installation directory: D: \ instantclient_10_2:
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1555)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )
You can configure the preceding settings based on your actual situation.
5. Open PL/SQL and set OCI Library and Oracle_home in perference. My settings are OCI Library = D: \ instantclient_10_2 \ oci. dll, Oracle_home = D: \ instantclient_10_2. re-open PL/SQL to log on. Congratulations!
-------------------------------------- Split line --------------------------------------
Rlwrap
SQLPLUS spool to dynamic Log File Name
Oracle SQLPLUS prompt settings
Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)
PL/SQL Developer Practical Skills
-------------------------------------- Split line --------------------------------------