(Click to open topic with navigation)
The following procedure demonstrates how to install the correct ODBC drivers for your Oracle database. This guide is a prerequisite for the Connecting to an Oracle Database with an ODBC Driver task. Each step must be performed as root.
To install the Oracle Instant Client
The process of connecting Oracle to Moab Workload Manager has been tested on Oracle Instant Client version 11.2. The process may work with other versions, but they are not supported.
[root]# rpm -i ./oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
[root]# rpm -i ./oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
[root]# rpm -i ./oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm
To confirm where the RPMs installed the libraries, run rpm -qlp <rpmFileName>.
[root]# cat >/etc/ld.so.conf.d/oracle-instant-client.conf <<EOL
/usr/lib/oracle/11.2/client64/lib
EOL
If you installed Oracle Instant Client from a repository, run repoquery -ql <rpmName> instead.
Rebuild the LD_LIBRARY_PATH.
[root]# ldconfig
[root]# sqlplus64 moab/moab@adaptive-oracle:1561/MOAB
SQL*Plus: Release 11.2.0.4.0 Production on Mon Sep 30 14:35:10 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
The 64-bit sqlplus client was used to connect to a 64-bit 11g instance called MOAB, which is hosted on adaptive-oracle.ac.
SQL> select name from v$database
2 ;
NAME
---------
MOAB
Useful comments are at the top of the script. Read the comments before running the script.
[root]# ./moab-db-oracle-create.sh
SQL> select table_name from all_tables where owner = 'MOAB';
TABLE_NAME
------------------------------
TRIGGERS
MOAB
OBJECTTYPE
VCS
EVENTTYPE
JOBHISTORY
MCHECKPOINT
NODES
EVENTS
NODESTATSGENERICRESOURCES
JOBS
RESERVATIONS
GENERICMETRICS
REQUESTS
GENERALSTATS
NODESTATS
16 rows selected.
SQL>
[root]# cat > /tmp/generateDescribe.sql <<EOL
SET HEADING OFF
SET FEEDBACK OFF
SET ECHO OFF
SET PAGESIZE 0
SPOOL /tmp/describeAllUserTables.sql
select 'desc '||owner||'.'||table_name||';' from all_tables where owner = 'MOAB';
SPOOL OFF
EOL
[root]# SQL> start /tmp/describeAllUserTables.sql
Related topics