1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...
:

This command is used to make a query to oracle using SQL Plus and a username/password/host. Prior you need to define Oracle enviroment variables.

Module data

Sample Oracle enviroments variables: 

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server 
export ORACLE_SID=XE 
export ORACLE_VER=10.2.0 
export PATH=$PATH:$ORACLE_HOME/bin 

Sample query: 

echo "SELECT USER_ID FROM DEMO_USERS where USER_NAME = 'ADMIN';" | /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus -S -L hr/hr@localhost | tail -2 | head -1 | awk '{ print $1 }' 

Dont miss the final “;” at the end of SQL sentence

(Visited 473 times, 1 visits today)

For correct visualization of the Pandora FMS library extension, you must have installed version NG 760 or superior

X