Database Reference
In-Depth Information
SQL> SELECT * FROM v$db_pipes;
OWNERID NAME TYPE PIPE_SIZE
---------- ---------------------- ------- ----------
0 ORA$RMAN_PIPE_OUT PRIVATE 354
0 ORA$RMAN_PIPE_IN PRIVATE 353
RMAN_PIPE_IF Package
In the source code depot, I provide a PL/SQL package that shields a lot of the intricacies of
using DBMS_PIPE and interpreting the messages RMAN sends. The name of the package is
RMAN_PIPE_IF (IF for interface). Writing the package, I learned the following lessons:
￿
RMAN normally sends one line of output per pipe message.
RMAN error stacks consist of several lines ( VARCHAR2 items) in a single message.
￿
￿
Commands sent to RMAN may consist of one item per pipe message and may
contain newlines.
￿
In pipe mode, RMAN does not echo the commands it received to a log file as it does
when executing a script. The backup utility controlling RMAN in pipe mode should
compensate for this, by first writing the command it is about to send to RMAN to a log
file, and then sending the command to RMAN through DBMS_PIPE .
￿
When RMAN is ready to process the next command, it sends “RMAN-00572: waiting for
dbms_pipe input” as the single item of a pipe message.
￿
RMAN does not terminate on error; instead it keeps running and signals through
RMAN-00572 that it is ready to receive the next command.
Except handling all of the aspects mentioned above, the package RMAN_PIPE_IF also probes
the pipe messages sent by RMAN and provides the following additional functionality:
￿
It indicates when RMAN is ready to receive the next command by detecting
“RMAN-00572: waiting for dbms_pipe input”.
￿
It concatenates RMAN error stack messages consisting of multiple VARCHAR2 items in a
single message into a single VARCHAR2 string and returns it to the caller.
￿
It returns the RMAN error code (RMAN- nnnnn ) and error message from the top of the
error stack in case of a command failure.
￿
It returns the ORACLE DBMS error code (ORA- nnnnn ) and error message from the top
of the error stack in case of a command failure and the presence of an ORACLE DBMS error.
￿
When called to receive a message, after a time-out period of one second, the package
returns an empty message and a line count of 0, if no message could be retrieved from
the RMAN output pipe.
 
Search WWH ::




Custom Search