Solved

oracle apache server

Posted on 2013-01-22
3
500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
best datatype for oracle table email creation 8 104
sum of columns in a row in oracle 3 61
Excess Redo 3 48
Shared Service Environment 2 54
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

734 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