- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- CSH script for Oracle job
Operating System - HP-UX
1745853
Members
4455
Online
108723
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
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
тАО05-24-2002 08:10 AM
тАО05-24-2002 08:10 AM
CSH script for Oracle job
Running a cron job. However I need to figure out how to change it so that it detects any Oracle errors and exits the script or goes to a certain part if an Oracle error occur. The file included shows the part of the script I need modified. The problem is when the sqlplus script "test" runs(which actually just executes a procedure), and fails with an Oracle error because the database was down for instance, the script continues on instead of echoing "ERROR - Could not run test process". I'd like the script to do this just like it works when the return_cd($status) is not 0. What do I need to add to the if statement to check for the results of sqlplus statement?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2002 04:45 PM
тАО05-24-2002 04:45 PM
Re: CSH script for Oracle job
sqlplus will have to run the entire file, unless you define exit statments in your code to terminate.
Something like the following would probably work at the top of your "test.sql", and then enclose your program with a "if dbdown = 'N' then" statement.
declare
numcount varchar2(5);
dbdown varchar2(5);
begin
dbdown:='N';
select count(*) into numcount from dba_data_files;
exception
when others then
dbdown:='Y';
end;
Although, the only way you can login to the database when it is down from sqlplus is using "internal" or a "sysdba" account. You might not want to do this under most circumstances.
Brian
Something like the following would probably work at the top of your "test.sql", and then enclose your program with a "if dbdown = 'N' then" statement.
declare
numcount varchar2(5);
dbdown varchar2(5);
begin
dbdown:='N';
select count(*) into numcount from dba_data_files;
exception
when others then
dbdown:='Y';
end;
Although, the only way you can login to the database when it is down from sqlplus is using "internal" or a "sysdba" account. You might not want to do this under most circumstances.
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2002 06:02 AM
тАО05-28-2002 06:02 AM
Re: CSH script for Oracle job
Not totally sure I understand. Are you saying to put the following in the SQL Plus script? How do I feed back the status to the shell script?
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