HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Oracle SQL script to display ORACLE users on a...
Operating System - HP-UX
1828472
Members
3224
Online
109978
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 03:39 AM
02-09-2007 03:39 AM
Oracle SQL script to display ORACLE users on a SAP system
Hi,
I am trying to write a script to display Oracle users in a SAP system for SOX compliance, i want to cron the script to run at the begining of every Month.
However the script doesnt seem to be working.
Any ideas, below is the script.
#!/usr/bin/csh
$(ORACLE_HOME)/bin/sqlplus / as sysdba < /dev/null
spool /tmp/oracle_users.txt
select username, account_status from dba_users;
spool off;
exit;
EOF
I am trying to write a script to display Oracle users in a SAP system for SOX compliance, i want to cron the script to run at the begining of every Month.
However the script doesnt seem to be working.
Any ideas, below is the script.
#!/usr/bin/csh
$(ORACLE_HOME)/bin/sqlplus / as sysdba <
spool /tmp/oracle_users.txt
select username, account_status from dba_users;
spool off;
exit;
EOF
I hear and I forget. I see and I remember. I do and I understand
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 03:49 AM
02-09-2007 03:49 AM
Re: Oracle SQL script to display ORACLE users on a SAP system
First make sure that your script can run from a shell as the cron'ed user. Unless there is an extremely compelling reason, I would not use csh. Under cron, which intentionally has a very sparse environment, ORACLE_HOME, ORACLE_SID, and essentially all but a handful of variables are not defined. Moreover PATH is extremely limited as well. You need to explicitly set and export any needed environment variables within the cron'ed script before you ever invoke sqlplus.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 05:28 AM
02-09-2007 05:28 AM
Re: Oracle SQL script to display ORACLE users on a SAP system
I agree with Clay,
should go like this:
put in your ORACLE_SID for xxx
and adjust 102_64 to 920_64 if not upgraded yet.
This script by the way would normally not be ruanble as root, because root does not belong to group "dba" and will therefore never be able to connet as sysdba. So I guess you'll run it as orasid ?!
#!/usr/bin/csh
setenv ORACLE_SID xxx
setenv ORACLE_HOME /oracle/${ORACLE_SID}/102_64
${ORACLE_HOME}/bin/sqlplus ..... rest is ok
Volker
should go like this:
put in your ORACLE_SID for xxx
and adjust 102_64 to 920_64 if not upgraded yet.
This script by the way would normally not be ruanble as root, because root does not belong to group "dba" and will therefore never be able to connet as sysdba. So I guess you'll run it as orasid ?!
#!/usr/bin/csh
setenv ORACLE_SID xxx
setenv ORACLE_HOME /oracle/${ORACLE_SID}/102_64
${ORACLE_HOME}/bin/sqlplus ..... rest is ok
Volker
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP