Solved

oracle apache server

Posted on 2013-01-22
3
499 Views
Last Modified: 2013-01-23
Hi,
I keep getting an error when running a script from my oracle 11g http server;
If i run the script on the command line ( AIX ) it works fine but when i run through a URL on my 11g HTTP server i get the error below - the script works fine on the old 1og Apache server - is there something i am missing to check

SQL*Plus: Release 11.2.0.3.0 Production Copyright (c) 1982, 2011, Oracle. All rights reserved. Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus statements. Usage 1: sqlplus -H | -V -H Displays the SQL*Plus version and the usage help. -V Displays the SQL*Plus version. Usage 2: sqlplus [ [] [{logon | /nolog}] [] ] is: [-C ] [-L] [-M ""] [-R ] [-S] -C Sets the compatibility of affected commands to the version specified by . The version has the form "x.y[.z]". For example, -C 10.2.0 -L Attempts to log on just once, instead of reprompting on error. -M "" Sets automatic HTML markup of output. The options have the form: HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text] [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}] -R Sets restricted mode to disable SQL*Plus commands that interact with the file system. The level can be 1, 2 or 3. The most restrictive is -R 3 which disables all user commands interacting with the file system. -S Sets silent mode which suppresses the display of the SQL*Plus banner, prompts, and echoing of commands. is: {[/][@] | / } [AS {SYSDBA | SYSOPER | SYSASM}] [EDITION=value] Specifies the database account username, password and connect identifier for the database connection. Without a connect identifier, SQL*Plus connects to the default database. The AS SYSDBA, AS SYSOPER and AS SYSASM options are database administration privileges. can be in the form of Net Service Name or Easy Connect. @[ | [//]Host[:Port]/] is a simple name for a service that resolves to a connect descriptor. Example: Connect to database using Net Service Name and the database net service name is ORCL. sqlplus myusername/mypassword@ORCL Host specifies the host name or IP address of the database server computer. Port specifies the listening port on the database server. specifies the service name of the database you want to access. Example: Connect to database using Easy Connect and the Service name is ORCL. sqlplus myusername/mypassword@Host/ORCL The /NOLOG option starts SQL*Plus without connecting to a database. The EDITION specifies the value for Session Edition. is: @|[.] [ ...] Runs the specified SQL*Plus script from a web server (URL) or the local file system (filename.ext) with specified parameters that will be assigned to substitution variables in the script. When SQL*Plus starts, and after CONNECT commands, the site profile (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile (e.g. login.sql in the working directory) are run. The files may contain SQL*Plus commands. Refer to the SQL*Plus User's Guide and Reference for more information.
0
Comment
Question by:hraja77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:hraja77
ID: 38805114
heres the script form my cgi-bin folder:

"blocking_locks.sh.old" 83 lines, 2116 characters
#!/bin/ksh
# This will list connected database users
#
print "Content-type: text/html\n\n"
print "<HTML>
<HEAD>"
DATE=`date +"%A %B %d %Y %T"`
echo "<H2>$DATE</H2>\n";
echo "  <title>WDF - WDFWMSDBPR Blocking Locks</title>"
echo "</HEAD>"
echo "<BODY align=centre>"

. /home/oracle/.profile

echo "<H1 align=center>WDF - WDFWMSDBPR Blocking Locks</H1>"

export NLS_DATE_FORMAT='DD-MON-YYYY'

RMAN_SCRIPTS_DIR=/home/oracle/scripts

#ctrlmpwd=$($RMAN_SCRIPTS_DIR/get_pass.sh ctrlm system)
systempwd=`$GET_PASS wmsp system`
#echo " ctrlmpwd=$ctrlmpwd"

# access the database on sched_01
/oracle/product/11.2.0/bin/sqlplus -s  system/${systempwd}@wmsp  2>/dev/null <<EOF
SET FEEDBACK OFF
SET TERMOUT OFF
set trimout on
set linesize 80
SET PAGES 500
SET MARKUP HTML ON
SET NUMWIDTH 15
SELECT  /*+ RULE */
    l.session_id
   ,l.ORACLE_USERNAME
   ,l.OS_USER_NAME
   ,s.program
   ,o.OBJECT_NAME
   ,o.OBJECT_TYPE
   ,s.status
   ,decode(s.lockwait,null,'NO',s.lockwait,'BLOCKED') block
   ,round(((((TO_NUMBER(TO_CHAR(SYSDATE,     'J'))*86400) +
                       (TO_NUMBER(TO_CHAR(SYSDATE,     'SSSSS')))) -
                      ((TO_NUMBER(TO_cHAR(s.logon_time,'J'))*86400) +
                       (TO_NUMBER(TO_CHAR(s.logon_time,'SSSSS')))))/60),2) time
   ,floor(last_call_et/3600)||':'||
    floor(mod(last_call_et,3600)/60)||':'||
    mod(mod(last_call_et,3600),60) idle
  FROM  v\$locked_object l,
        dba_objects o,
        v\$session s
  WHERE l.OBJECT_ID = o.OBJECT_ID
        AND   s.sid = l.session_id
/
SELECT count(*) " Total Locks Found"
  FROM  v\$locked_object l,
        dba_objects o,
        v\$session s
  WHERE l.OBJECT_ID = o.OBJECT_ID
        AND   s.sid = l.session_id
/
select * from dba_lock where session_id > 9
/
select * from dba_blockers
/
select * from dba_blockers
/
 select distinct(program), username, count(*) from v\$session
 where username is not null
 group by program, username
 order by 3
/
 select count(*) "Total Sessions" from v\$session
 --where username is not null
 order by 1
/
exit;
EOF

print "</BODY>
</HTML>"
exit 0
0
 
LVL 35

Accepted Solution

by:
johnsone earned 500 total points
ID: 38805558
Based on the output that you are seeing, my guess is that your call to GET_PASS is failing.  That is causing the systempwd to contain nothing, or something that SQL*Plus does not understand.

If you run:

sqlplus -s system/@wmsp

You will see the same output that you are seeing.
0
 
LVL 1

Author Closing Comment

by:hraja77
ID: 38808959
thanks - you are right
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to take different types of Oracle backups using RMAN.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question