Do not install the oracle client to connect to the Oracle server

Source: Internet
Author: User

I. Introduction

Oracle, as a professional database software system, can run in a multi-layer network structure, including a standalone system, a C/S (Client/Server) structure, and B/S (Browser/Server) structure. In the C/S structure, to enable the client application to connect to the Oracle server, you must install the Oracle client software larger than MB on the client computer and perform complex configuration. If the application needs to be deployed on multiple clients, it will be very cumbersome to install the Oracle client and configure to connect to the Oracle server.

This document uses 9i as an example to describe how to connect an application to the Oracle server on the client without installing the Oracle client.

II. Specific implementation

To connect applications installed on the client to the Oracle database server, the drivers, interface files, and various support files of the Oracle database are required. These files must be stored in the same directory as the application. If they are stored separately,

You can set environment variables so that the application can find these files in the corresponding directory.

1. files required by the application

On the computer where the Oracle client is installed, you can find all the files required by the application to connect to the database. There are 41 files in total, 12.9 MB. These files must be stored in the following directory, and Appdir is the current directory of the application.

30 files in the Appdir Directory, which are the dynamic link library required by the Oracle server

Oci. dll
Oracle. key
Oraclient9.dll
Oracommon9.dll
ORACORE9.DLL
Orageneric9.dll
Oraldapclnt9.dll
Oran9.dll
ORANCDS9.DLL
Orancrypt9.dll
Oranhost9.dll
Oranl9.dll
Oranldap9.dll
ORANLS9.DLL
Oranms. dll
Oranmsp. dll
Orannzsbb9.dll
Oranoname9.dll
Oranro9.dll
Orantns9.dll
ORAPLS9.DLL
ORASLAX9.DLL
ORASNLS9.DLL
ORASQL9.DLL
Oratrace9.dll
ORAUNLS9.DLL
Oravsn9.dll
Orawtc9.dll
ORAXML9.DLL
ORAXSD9.DLL

There is a file in the Appdir \ bin directory.

Orantcp9.dll

The Appdir \ network \ ADMIN directory contains only one file, which is the configuration file for connecting to the database.

Tnsnames. ora

There are 8 files in the Appdir \ ocommon \ nls \ ADMIN \ DATA directory. These files are supported in the simplified Chinese language environment. The files required for other language runtime environments are different.

LX00001.NLB
LX00023.NLB
LX10001.NLB
LX10035.NLB
LX1BOOT. NLB
LX20001.NLB
LX20354.NLB
LX60354.NLB

The Appdir \ oracore \ zoneinfo directory contains only one file to store time zone information.

Timezone. dat

2. Modify the network configuration file

The tnsnames. ora file under the Appdir \ network \ ADMIN directory is an important configuration file, which stores the connection sub-string corresponding to the parameter-service name for connecting to the Oracle Database Server. This file can be edited using notepad. The following is a configuration instance in the tnsnames. ora file:

 
 
  1. APPDB =  
  2. (DESCRIPTION =  
  3.     (ADDRESS_LIST =  
  4.       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))  
  5.     )  
  6.     (CONNECT_DATA =  
  7.       (SERVICE_NAME = APPDB)  
  8.     )  

Parameters in the network configuration file are described as follows:
APPDB: local name, that is, the name of the Oracle database
PROTOCOL: the PROTOCOL used. In this example, TCP is used.
HOST: server address
PORT: the listening PORT number of the server. The default PORT number is 1521.
SERVICE_NAME: name of the Oracle Database Server

3. Edit the oracle. key File

File oracle. key indicates the storage directory of the Oracle program in the Registry, as well as ORACLE_HOME and other environment variables. This file contains very little content and only records simple directory items, you can use NotePad to open and edit it. Generally, the settings are as follows:

Software \ appdir

When Oracle connects to the database, it searches for information about the database in the corresponding item of HKEY_LOCAL_MACHINE \ SOFTWARE \ APPDIR in the registry.

4. Register database information

After completing the above work, you only need to write the language environment and resource path of the Oracle database into the registry, and the application can connect to the Oracle database without setting the environment variables of the operating system, the location where registry information is stored should be

The items set in the oracle. key File correspond. The registry list is as follows:

[HKEY_LOCAL_MACHINE \ SOFTWARE \ APPDIR]
"NLS_LANG" = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
"ORACLE_HOME" = "C: \ Program Files \ appdir"

SIMPLIFIED CHINESE_CHINA.ZHS16GBK indicates that the SIMPLIFIED Chinese character set is used. Applications and Files required to connect to the Oracle database are stored in the C: \ Program Files \ appdir directory, that is, the installation directory of the application.

Iii. Summary

To solve the problem that Client applications can easily connect to the database without installing the Oracle Client, Oracle released a free tool Instant Client in its latest database system, using several files provided by this tool, client applications can connect to the Oracle database server without modifying the registry or setting environment variables, this makes application release and deployment easier, but the core file size provided by the Instant Client exceeds 90 MB. The method file described in this article is small, easy to implement, and has good practical value.
 

Oracle RMAN backup Optimization

Oracle backup using RMAN

Oracle single row date functions

Introduction to Oracle bitand () Functions

Importance of Oracle Database Backup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.