- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- batch command and oracle jobs
Operating System - HP-UX
1753265
Members
5445
Online
108792
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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-05-2001 01:17 PM
тАО02-05-2001 01:17 PM
Does anyone use the batch command with Oracle jobs? Our Financial folks would like some sort of a queue system. Any suggestions
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2001 10:43 PM
тАО02-05-2001 10:43 PM
Re: batch command and oracle jobs
Hi Eileen.
We have a lot of jobs running in background.
We use to start these jobs from the cron as root with a shell script. For sample doing a report we use report.sh and within this script we use lines like su - orace -c .......
One problem : if you run these jobs you may show usernames and passwords. Try to hide them in parameter files.
Hope i could help you.
Rgds
Alexander M. Ermes
We have a lot of jobs running in background.
We use to start these jobs from the cron as root with a shell script. For sample doing a report we use report.sh and within this script we use lines like su - orace -c .......
One problem : if you run these jobs you may show usernames and passwords. Try to hide them in parameter files.
Hope i could help you.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:51 AM
тАО02-06-2001 03:51 AM
Re: batch command and oracle jobs
Hi Eileen,
As Alexander mentioned, you can run batch processes as a cron job (and of course you may want to hide the password from appearing in the process list or hardcoding it in your scripts).
One thing you will want to do if you are planning to run processes using a SQL-Plus session is to use the "-s" option until end-of-file as shown in my example below.
===============================
#!/bin/ksh
#
# example SQL-Plus script for batch processing
PSWD=`cat /ora0/oracle/passwd/sys`;
SIDFILE='/ora0/oracle/scripts/all_sids'
ORACLE_HOME='/ora0/oracle/app/oracle/product/8.1.6'
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:
export PATH
cat $SIDFILE | while read SID
do
ORACLE_SID=$SID
export ORACLE_SID
sqlplus -s sys/$PSWD@$SID <
set linesize 120
@/ora0/oracle/scripts/user_info.sql
@/ora0/oracle/scripts/tblsp_info.sql
@/ora0/oracle/scripts/high_water.sql
!/ora0/oracle/scripts/archive_stats
EOF
done
#========= end of script ==========
In the above example, I am reading the name of the database from a file called "all_sids" which allows me to run a loop and process the same scripts for all databases listed in the file..
Next, in order to avoid hardcoding the password in the script, I am reading the password from a file on the operating system that I have set to read only by Oracle.
Finally, when I run the sqlplus command, I am feeding in the variables for the password and oracle_sid explained above, then simply executing my scripts as in a normal sqlplus session.
Last, I am running an OS command to archive my output files generated from the sql scripts.
Hope this helps.
Best regards,
jim wolff
As Alexander mentioned, you can run batch processes as a cron job (and of course you may want to hide the password from appearing in the process list or hardcoding it in your scripts).
One thing you will want to do if you are planning to run processes using a SQL-Plus session is to use the "-s" option until end-of-file as shown in my example below.
===============================
#!/bin/ksh
#
# example SQL-Plus script for batch processing
PSWD=`cat /ora0/oracle/passwd/sys`;
SIDFILE='/ora0/oracle/scripts/all_sids'
ORACLE_HOME='/ora0/oracle/app/oracle/product/8.1.6'
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:
export PATH
cat $SIDFILE | while read SID
do
ORACLE_SID=$SID
export ORACLE_SID
sqlplus -s sys/$PSWD@$SID <
set linesize 120
@/ora0/oracle/scripts/user_info.sql
@/ora0/oracle/scripts/tblsp_info.sql
@/ora0/oracle/scripts/high_water.sql
!/ora0/oracle/scripts/archive_stats
EOF
done
#========= end of script ==========
In the above example, I am reading the name of the database from a file called "all_sids" which allows me to run a loop and process the same scripts for all databases listed in the file..
Next, in order to avoid hardcoding the password in the script, I am reading the password from a file on the operating system that I have set to read only by Oracle.
Finally, when I run the sqlplus command, I am feeding in the variables for the password and oracle_sid explained above, then simply executing my scripts as in a normal sqlplus session.
Last, I am running an OS command to archive my output files generated from the sql scripts.
Hope this helps.
Best regards,
jim wolff
Sr. Oracle DBA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2001 08:23 AM
тАО03-16-2001 08:23 AM
Solution
Hi,
Also we have some hundreds of batch jobs for our Oracle environments. Because there are so much jobs we decided to use the Enterprise Management module from Computer Associates (www.ca.com).
Probably this would help you a bit:
create a unix script that calls some SQL or PL/SQL scripts. Test it and put it in the crontab. Use man crontab for information about use. Sometimes it is great to use the logger command into your unix scripts. Then you can create another script that does a tail -f of /var/adm/syslog/syslog.log and mails all your messages to your email address. Anyhow, this is what we do and it seems to be working for a long time.
Regards,
Dieter Degrendele
Also we have some hundreds of batch jobs for our Oracle environments. Because there are so much jobs we decided to use the Enterprise Management module from Computer Associates (www.ca.com).
Probably this would help you a bit:
create a unix script that calls some SQL or PL/SQL scripts. Test it and put it in the crontab. Use man crontab for information about use. Sometimes it is great to use the logger command into your unix scripts. Then you can create another script that does a tail -f of /var/adm/syslog/syslog.log and mails all your messages to your email address. Anyhow, this is what we do and it seems to be working for a long time.
Regards,
Dieter Degrendele
The possible we did, the unpossible we're doing but for a miracle you have to wait some time.
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP