# TSTdbi.def: Tests SQL Settings using DBI # $Id: TSTdbi.def,v 1.1 2009/04/27 05:01:49 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/TSTdbi.def,v 1.1 2009/04/27 05:01:49 mschenke Exp $ # # Change History # 20090422 MSC Initial version. =head1 NAME TSTsql - Tests SQL*Plus Settings and Gets some Database Configuration Information =head1 DESCRIPTION =cut echo tput('bold'),'Processing SQL test module ...',tput('off') echo 'Setting logins ...' # Get the current login var $log = setSqlLogin() # Define the SQL logins loop $key (grepSetting('^SQL_PASSWORD_')) {echo " Set the password for '",substr($key,13),"'" call setSqlLogin(substr($key,13),unpack('u',getSetting($key))) } loop $key (grepSetting('^SQL_PASS_\d+$')) {var ($usr,$sid) = split('\@',getSetting(replace($key,'_PASS_','_USER_')),2) echo " Set the password for '",$usr,cond($sid,concat('@',$sid)),"'" call setSqlLogin($usr,unpack('u',getSetting($key)),$sid) } # Restore the current login call setSqlLogin($log) =pod This tool loads the passwords that are encoded in the setup file and collects the following information: =over 4 =item o Current user =item o Content of the C table =item o Content of the C table =item o Content of the C table =item o Value of the C parameter =item o Records of the C table with a null C =back =cut call setDbTrace(setTrace()) set $job {# ECHO Current User: "# ECHO ============= "# SQL "SELECT USER " FROM dual "/ "# ECHO "# ECHO v$version "# ECHO ========= "# SQL "SELECT * " FROM v$version "/ "# ECHO "# ECHO v$database "# ECHO ========== "# SQL "SELECT * " FROM v$database "/ "# ECHO "# ECHO v$pwfile_users "# ECHO ============== "# SQL "SELECT * " FROM v$pwfile_users "/ "# ECHO "# ECHO remote_login_passwordfile Parameter "# ECHO =================================== "# SQL "SELECT value " FROM v$parameter " WHERE name = 'remote_login_passwordfile' "/ "# ECHO "# ECHO dba_triggers (null table_name) "# ECHO ============================== "# SQL "SELECT owner,trigger_name,triggering_event,trigger_type,status " FROM dba_triggers " WHERE table_name IS NULL " ORDER BY 1,2 "/ } if loadDb($job) {loop $lin(grepLastDb('.*')) {echo $lin } } if getDbMessage() echo last echo echo 'DBI Information' echo '===============' echo 'DB Name: ',getDbName() echo 'DB Version: ',getDbVersion() echo echo join("\012 ",'Available drivers:',getDrivers()) echo echo 'DBM Driver: ',nvl(isDriverAvailable('DBM'),'(Not available)') echo 'ODBC Driver: ',nvl(isDriverAvailable('ODBC'),'(Not available)') echo 'Oracle Driver: ',nvl(isDriverAvailable('Oracle'),'(Not available)') =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut