Oracle Client Libraries
In order to connect to an Oracle database from your Virtual Private Server, you will need to use an Oracle Client.
Follow the instructions below to install the Oracle Client on your server.
-
To install the client software, SSH or Telnet to your server
and run the following command, depending on your server O/S.
-
FreeBSD
Install the client, which uses Linux emulation (you do not need to do anything to enable
Linux emulation).
% vinstall oracle-linux
Your Oracle client program is in the ~/usr/local/oracle/ directory of your Virtual
Private Server. This will also install an Oracle enabled PHP
CGI in your ~/usr/local/etc/httpd/cgi-bin/ directory.
-
Solaris
An Oracle client is installed by default on the Solaris Virtual Private Server. If you are using the
Oracle Client 8.1.6, you can upgrade to the newer version. To install the newer Oracle client, do the
following.
-
Run the following command to install the upgraded Oracle client.
% vinstall oracle-upgrade
-
Copy any customized files (such as tnsnames.ora) to the new directory:
% cp ~/usr/local/oracle/filename ~/usr/local/oracle-8.1.7/
-
Once you have moved your customized information, you can delete the old Oracle libraries:
% rm -Rf ~/usr/local/oracle
-
In order to connect properly, you need to link the new libraries to ~/usr/local/oracle.
To do this run the following command:
% ln -s ~/usr/local/oracle-8.1.7 ~/usr/local/oracle
-
Configure the Client libraries to connect to your Oracle database. This is done by creating a
tnsnames.ora file in your TNS_ADMIN directory. On your Virtual Private Server, this will be the
~/usr/local/oracle/network/admin/ directory.
Your tnsnames.ora file needs to contain specific information about connecting to your Oracle database.
It's probable that your database server has instructions on creating your tnsnames.ora file. The following
is an example of what your tnsnames.ora file might look like if your database server's domain was
mydatabase.myhosteddb.net.
mydatabase.myhosteddb.net=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = mydatabase.myhosteddb.net)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SERVICE_NAME = odb)
)
)
If you create this file on your local computer and use FTP to copy it to your Virtual Private Server, be sure to
use the ASCII file format when copying the file.
-
To access the libraries from the shell, set the ORACLE_HOME environment variable according to your shell
(the default shell is csh)
-
csh - add the following line to the ~/.cshrc file using your favorite text editor:
setenv ORACLE_HOME ${HOME}/usr/local/oracle
then run the following command:
% source .cshrc
-
tcsh - add the following line to the ~/.tcshrc file using your favorite text editor:
setenv ORACLE_HOME ${HOME}/usr/local/oracle
then run the following command:
% source .cshrc
-
sh - add the following lines to the ~/.profile file using your favorite text editor:
ORACLE_HOME=${HOME}/usr/local/oracle export ORACLE_HOME
then run the following command:
% . .profile
-
bash - add the following line to the ~/.bashrc file using your favorite text editor:
export ORACLE_HOME=${HOME}/usr/local/oracle/
then run the following command:
% . .profile
|
|
Support clients
|