oracle instantclient client - ghdrako/doc_snipets GitHub Wiki

Client

sudo yum install -y libaio libaio-devel unzip glibc libnsl make
sudo groupadd oinstall
 
 
sudo groupadd dba
sudo useradd -g oinstall -G dba oracle
sudo passwd oracle
sudo mkdir -p /u01/app/oracle/product/19.0.0/client_1
sudo chown -R oracle:oinstall /u01
sudo chmod -R 775 /u01
mkdir /tmp/oracle_install
yum install libnsl
export CV_ASSUME_DISTID=OEL7.8  # workerand Client 19 on rh 8
mount -o remount,exec /tmp      # java is executet form tmp dir
Template pliku client_install.rsp w rozpakowanym archiwum klienta skopiwac do /tmp
Edytuj plik client_install.rsp, aby odpowiednio ustawić ścieżki instalacyjne:

oracle.install.client.installType=Administrator
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0/client_1
ORACLE_BASE=/u01/app/oracle
./runInstaller -silent -responseFile /tmp/client_install.rsp
sudo /u01/app/oraInventory/orainstRoot.sh
sudo /u01/app/oracle/product/19.0.0/client_1/root.sh

Minimal configuration to execute client tools in .bashrc

export ORACLE_HOME=/u01/app/oracle/product/19.0.0/client_1
export LD_LIBRARY_PATH="$ORACLE_HOME"
export PATH="$ORACLE_HOME/bin:$PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME

Zamiast ustawiac LD_LIBRARY_PATH mozna

$ sudo sh -c "echo /u01/app/oracle/product/19.0.0/client_1/lib > /etc/ld.so.conf.d/oracle-client.conf";sudo ldconfig
sqlplus -v
sqlplus username/password@//your_host:1421/SERVICE_NAME

Instant client

sudo sh -c "echo /u01/app/oracle/product/19.0.0/client_1/lib > /etc/ld.so.conf.d/oracle-instantclient.conf";sudo ldconfig

How do you specify the location of your TNSNAMES.ORA file?

The Oracle website has the answer: Always set the TNS_ADMIN environment variable or registry to the location of the tnsnames.ora file (full directory path only, do not include the file name). This practice will ensure that you are using the appropriate tnsnames.ora for your application when running with Instant Client.

So, for UNIX and Linux systems set the variable TNS_ADMIN like so in your .profile or .bash_profile:

export TNS_ADMIN=/opt/oracle/instantclient_11_2/

On Windows systems, set the environment variables via the Advanced System properties:

  • Open CMD, enter sysdm.cpl
  • In the Advanced tab, select Environment Variables
  • Under “System Variables”, click on New… and enter “TNS_ADMIN” as the name and the path where your TNSNAMES.ORA resides as your value. Uwaga!!! sciezka do katalogu a nie do pliku