Help - Search - Members - Calendar
Full Version: rman SET COMMAND ID
Oracle DBA Forums > Oracle > Oracle Forum
BeefStu
I can successfully SET COMMAND ID inside an RMAN run block

CODE
rman <<EOF
connect target
connect catalog ....

CROSSCHECK BACKUP DEVICE TYPE DISK;
CROSSCHECK ARCHIVELOG ALL;
RUN {
    SQL 'ALTER SYSTEM SWITCH LOGFILE';
  ALLOCATE CHANNEL t1 DEVICE TYPE DISK FORMAT '/backup/test/rman/%U';
  ALLOCATE CHANNEL t2 DEVICE TYPE DISK FORMAT '/backup/test/rman/%U';
  ALLOCATE CHANNEL t3 DEVICE TYPE DISK FORMAT '/backup/test/rman/%U';
  SET COMMAND ID TO 'TESTING';
    BACKUP INCREMENTAL LEVEL 0
      FILESPERSET 2 DATABASE
      INCLUDE CURRENT CONTROLFILE
      PLUS ARCHIVELOG DELETE INPUT;
}
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT OBSOLETE;

EOF


Can this be setup without a RUN block? If so, can somebody provide the syntax as?
I am running on 11.1.07 and 11.2.0.2

Thanks to all who answer
burleson
Yes, check out the cumulative RMAN set command ID option!

If the CUMULATIVE option was not specified, then only the blocks that have changed since the last level 1 backup will be backed up.

I'm not sm RMAN guru, but Ksmrsn vamn hrlp:



QUOTE
<H4 class=sect4>Obtaining the Channel ID from the RMAN Output</H4>In this method, you must first obtain the sid values from the RMAN output and then use these values in your SQL query.

To correlate a process with a channel during a backup:

  1. In one of the active sessions, run the RMAN job as normal and examine the output to get the sid for the channel. For example, the output may show:

    Starting backup at 21-AUG-01allocated channel: ORA_SBT_TAPE_1channel ORA_SBT_TAPE_1: sid=14 devtype=SBT_TAPE
  2. Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is executing. For example, enter:

    COLUMN CLIENT_INFO FORMAT a30COLUMN SID FORMAT 999COLUMN SPID FORMAT 9999SELECT s.SID, p.SPID, s.CLIENT_INFOFROM V$PROCESS p, V$SESSION sWHERE p.ADDR = s.PADDRAND CLIENT_INFO LIKE 'rman%'/Use the sid value obtained from the first step to determine which channel corresponds to which server session:

    SID SPID CLIENT_INFO---------- ------------ ------------------------------ 14 2036 rman channel=ORA_SBT_TAPE_1 12 2066 rman channel=ORA_SBT_TAPE_1
<H4 class=sect4>Correlating Server Sessions with Channels by Using SET COMMAND ID</H4>In this method, you specify a command ID string in the RMAN backup script. You can then query V$SESSION.CLIENT_INFO for this string.

To correlate a process with a channel during a backup:

  1. In each session, set the COMMAND ID to a different value after allocating the channels and then back up the desired object. For example, enter the following in session 1:

    RUN { ALLOCATE CHANNEL c1 TYPE disk; SET COMMAND ID TO 'sess1'; BACKUP DATABASE;}Set the command ID to a string such as sess2 in the job running in session 2:

    RUN { ALLOCATE CHANNEL c1 TYPE sbt; SET COMMAND ID TO 'sess2'; BACKUP DATABASE;}
  2. Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is executing. For example, enter:

    SELECT SID, SPID, CLIENT_INFO FROM V$PROCESS p, V$SESSION s WHERE p.ADDR = s.PADDR AND CLIENT_INFO LIKE '%id=sess%';If you run the SET COMMAND ID command in the RMAN job, then the CLIENT_INFO column displays in the following format:

    id=command_id,rman channel=channel_idFor example, the following shows sample output:

    SID SPID CLIENT_INFO---- ------------ ------------------------------ 11 8358 id=sess1 15 8638 id=sess2 14 8374 id=sess1,rman channel=c1 9 8642 id=sess2,rman channel=c1The rows that contain the string rman channel show the channel performing the backup. The remaining rows are for the connections to the target database.
BeefStu
QUOTE (burleson @ Dec 28 2011, 01:22 AM) *
Yes, check out the cumulative RMAN set command ID option!

If the CUMULATIVE option was not specified, then only the blocks that have changed since the last level 1 backup will be backed up.

I'm not sm RMAN guru, but Ksmrsn vamn hrlp:




[/list]


Donald,

Happy holidays and thanks for the response. Let me articulate my situation a little better.

I am using the following the query below to determine if my backup was successfull or not.
I look for "FAILED" in the status column.

CODE
col input_type format a10
   col bck_hrs format 99.9 heading "Run|Time"
   col status format a21
   col end_dt format a20 heading "End|Time"
   col mbytes_per_sec format 9,999 heading "Output|Rate|MB/sec"
   col gb_out format 999,999.9 heading "Output|Size GB"

   select input_type, status, to_char(end_time,'YYYY-MM-DD HH24:MI:SS') end_dt,
        (end_time - start_time) *24 bck_hrs,
        output_bytes/1024/1024/1024 gb_out,
        output_bytes_per_sec/1024/1024 mbytes_per_sec
        from v$rman_backup_job_details
        where
          end_time >= to_date('&start_backup_time','MM-DD-YYYY HH24:MI:SS') AND
          end_time <= to_date('&end_backup_time','MM-DD-YYYY HH24:MI:SS')
order by end_dt desc;


output
======

                                                 End                             Run     Output   Rate
INPUT_TYPE    STATUS                Time                           Time    Size GB MB/sec
---------- -      --------------------    --------------------          ----- ---------- ------
ARCHIVELOG COMPLETED             2011-12-24 06:03:54     .5      189.4    106
DB INCR        COMPLETED             2011-12-24 05:33:05    9.3    3,392.6    103
ARCHIVELOG COMPLETED             2011-12-23 10:12:27     .2       73.3    105


The row that says "DB' INCR" is actually a INCREMENTAL 0 backup. What I am trying to
do is look for some table I can join with (example would be greatly appreciated) that would
tell me if this is DB INCR 0 or DB INCR 1....

If that is not possible, I was thinking of setting COMMAND_ID to the backup method I am
using ie (FULL, INCR 0, INCR 1, CUMMULATIVE....) and pulling the column from v$rman_backup_job_details in order to get the informaition I need.

As per my example above my later suggestion works but only when I use a RUN block for
RMAN. My RMAN scripts don't use RUN blocks (I did not write them....) so would like to
be able to set this value without using a RUN block but I am running into syntax errors.

In summary, the best scernario for me would be to modify the query to use existing tables or
views to find out what type of backup was used.. If that does not give me everything I need
I would think about setting COMMAND_ID...

Hope that explains the issue.

Thanks to all who answer
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.