Database Reference
In-Depth Information
First, RMAN needs to be started with the pipe interface option. Note that the double quotes
around the word “PIPE” prevent RMAN from interpreting this string as a keyword. The single
quotes make sure that the shell does not remove the double quotes around the string “PIPE”.
$ rman TARGET / PIPE '"PIPE"' LOG rman.log
After initialization, RMAN indicates that it is ready to receive commands. Let's receive the
messages it sends after startup. Calling the package RMAN_PIPE_IF requires a number of SQL*Plus
bind variables. Most of them correspond to arguments of functions in the RMAN_PIPE_IF package,
so they should be self-explanatory. The variable msg is used for messages received, whereas cmd
holds the text of a command or script sent to RMAN. The variable rv holds return values from
calls to RMAN_PIPE_IF .
SQL> VARIABLE rv NUMBER
SQL> VARIABLE msg VARCHAR2(4000)
SQL> VARIABLE cmd VARCHAR2(4000)
SQL> VARIABLE rman_error NUMBER
SQL> VARIABLE ora_error NUMBER
SQL> VARIABLE rman_msg VARCHAR2(4000)
SQL> VARIABLE ora_msg VARCHAR2(4000)
SQL> VARIABLE pipe_arg VARCHAR2(1000)
SQL> VARIABLE wait_for_input NUMBER
Next, we need to set the identifier that was used as the argument to the PIPE option when
RMAN was started. It will be incorporated into the names of the private pipes. As in the previous
example, the word “PIPE” is used.
SQL> SET NULL <NULL>
SQL> BEGIN
SQL> :pipe_arg:='PIPE';
SQL> END;
SQL> /
Now we may attempt to receive a message from the private pipe called “ORA$RMAN_
PIPE_OUT”:
SQL> EXEC :rv:=site_sys.rman_pipe_if.receive(:pipe_arg, :msg, :wait_for_input, -
> :rman_error, :rman_msg, :ora_error, :ora_msg)
PL/SQL procedure successfully completed.
SQL> COL msg FORMAT a90
SQL> COL rv FORMAT 99
SQL> SET LINESIZE 130
SQL> COL wait_for_input HEADING "Wait|for|input" FORMAT 99999
SQL> COL rman_error HEADING "RMAN|Error" FORMAT 99999
SQL> COL ora_error HEADING "ORA|Error" FORMAT 99999
SQL> SELECT :rv rv, :msg msg, :wait_for_input wait_for_input FROM dual;
RV MSG Wait for input
--- --------------------------------------------------- --------------
1 connected to target database: TEN (DBID=2848896501) 0
Search WWH ::




Custom Search