Database Reference
In-Depth Information
Grid Control includes a web-based interface for both. Enterprise Manager Database Control
has a web-based interface for the database scheduler.
In a high availability environment, such as a failover cluster or Real Application Clusters,
the scheduler solves the issue that jobs need to run in spite of a node or instance failure. Since
high availability solutions ensure that at least one instance in a cluster is up (exactly one instance
per database in a failover cluster), this instance is available to execute jobs. Thus, for the sake
of scheduling, it is unnecessary to protect an Enterprise Manager agent (and its job system) or
a third-party scheduling solution by clustering software.
Certain undocumented aspects of the database scheduler apply to both Windows and UNIX,
whereas others are platform specific. Generic aspects are covered in the next two sections.
Platform-specific scheduler features are addressed in separate sections that pertain to UNIX
and Windows. An interesting generic feature of the scheduler, which is documented in the Oracle
Database Administrator's Guide , is that it captures and saves up to 200 bytes of standard error
output in the column ADDITIONAL_INFO of the dictionary view DBA_SCHEDULER_JOB_RUN_DETAILS .
Exit Code Handling
On UNIX systems as well as Windows, programs signal success or failure by returning an exit
code to the parent process. The exit code zero signals successful execution, whereas an exit
code between 1 and 255 indicates a failure or at least a warning. In the Bourne, Korn, and Bash
shells, the 8-bit exit code is available in the variable $? . If a program is terminated by a signal,
the exit code is 128+ n , where n is the number of the signal that terminated the program. On
UNIX, signal numbers are defined in the C programming language include file /usr/include/
sys/signal.h . Here's an example. Start the UNIX program sleep and while sleep is still running
interrupt the process with Ctrl+C.
$ sleep 10
$ echo $?
130
The echo statement retrieves the exit code from sleep . Since 130 - 128 is 2, we need to look
for signal 2 in signal.h .
#define SIGINT 2 /* interrupt */
Signal 2 is the interrupt signal, which may also be sent to a process with kill -INT pid ,
where pid is the process identifier.
In Perl $? provides information on which signal, if any, had a role in ending the child process
as well as whether or not a core dump was generated in addition to the exit code. Thus $? is a
16-bit value in Perl. How does the database scheduler fare in this respect? It is undocumented
how the scheduler decides whether an external job succeeded or failed.
On Windows, %ERRORLEVEL% has the same purpose as $? on UNIX systems. Following is an
example that calls the programs true.exe and false.exe shipped with Cygwin, a highly recom-
mended, free, UNIX-like environment for Windows systems, which provides all the UNIX utilities,
such as bash , find , awk , grep , vim (Vi iMproved), and even X11 to redirect the output of X11
clients on UNIX systems (such as the Oracle Universal Installer) to a bitmapped display on a
Windows machine.
 
Search WWH ::




Custom Search