9 Replies Latest reply: Jan 29, 2013 3:43 PM by chijar RSS

    CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function

    chijar
      Dear all,
      I have a problem with a backup.
      Facts:
      OS: SunOS hod 5.10 Generic_142901-03 i86pc i386 i86pc
      Oracle 11.2.0.1 with RAC

      So, Although i put in rman parameters section the CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/rman/backups/%U'; the backup was done but in FRA that is located in

      BS Key  Type LV   Size       Device Type  Elapsed Time  Completion Time
      36 Incr 0 210.82G DISK 10:32:57 24-JAN-13

      BP Key: 36 Status: AVAILABLE Compressed: YES Tag: TAG20130123T210005
      *Piece Name: +DATA/db_name/backupset/2013_01_23/nnndn0_tag20130123t210005_0.442.805496407*
      List of Datafiles in backup set 36...

      ANd my question is:
      How, although i configure that the backups would be in /rman/backups/%U this was located in +DATA (fRA) ??

      what im doing wrong ??
      Thanks for your help.
        • 1. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
          AJ
          Please post your backup script.
          • 2. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
            chijar
            thanks for your answer: here is my rman script. We invoked the script like this: rman_db_script.sh SID 0

            #!/bin/ksh
            function email_dba
            {
            if [ -s $email_file ]
            then
            subj="$prog: FAILED on $sid@$box at `date`"
            while read dba_id
            do
            mailx -s "$subj" $dba_id < $email_file
            echo "mailx -s "$subj" $dba_id "
            done < /oracle/app/oracle/dba/util/motifylist.txt
            fi
            }
            #############################################################################
            # set and check
            #############################################################################
            function set_and_check
            {
            ps -ef | grep ora_pmon_$sid | grep -v grep > /dev/null
            rc=$?
            if [ $rc != 0 ]
            then
            echo "$prog: database $ORACLE_SID is not online" >> $log_file
            echo "$prog: database $ORACLE_SID is not online" >> $email_file
            # email_dba
            exit 1
            fi

            rtime=`date '+%Y%m%d_%H%M'`
            ORACLE_BASE=/opt/app/oracle
            ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
            export ORACLE_HOME
            PATH=$ORACLE_HOME/bin:$PATH
            export PATH
            logdir=/opt/oracle/logs
            log_file=$logdir/$prog.$sid.level${bk_level}.log.$rtime
            email_file="$logdir/$prog.email.$sid"
            cat /dev/null > $email_file
            box=`hostname`
            orauser=oracle
            bk_dir=/rman/backups/$sid

            echo "===== `date '+%Y%m%d %H:%M:%S'` $prog: Started =====" > $log_file
            backup_type="INCREMENTAL LEVEL $bk_level"

            # find $logdir -name $prog.*.log.* -type f -mtime +10 -exec /bin/rm -f {} \;

            # find $bk_dir -name ctl.* -type f -mtime +10 -exec /bin/rm -f {} \;

            echo "ORACLE_SID=$ORACLE_SID" >> $log_file
            echo "ORACLE_USER=$orauser" >> $log_file
            echo "ORACLE_HOME=$ORACLE_HOME" >> $log_file
            echo "BACKUP TYPE=$backup_type" >> $log_file
            return
            }
            #############################################################################
            # backup database and archive logs to disk
            #############################################################################
            function backup_dbs_to_disk
            {
            echo "===== Backup $sid to FRA Started At `date` =====" >> $log_file
            $ORACLE_HOME/bin/rman nocatalog << rman_cmd >> $log_file 2>&1
            connect target
                 # se haran en el directorio sgte no en el FRA
                 CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/rman/backups/%U';
            #CONFIGURE CONTROLFILE AUTOBACKUP ON;
            run
            {
            ALLOCATE CHANNEL ch1 TYPE disk ;
            BACKUP $backup_type
            filesperset 10
            DATABASE;

            sql 'alter system archive log current';
            BACKUP filesperset 10 ARCHIVELOG ALL DELETE ALL INPUT;
            sql "alter database backup controlfile to trace as ''$bk_dir/ctl.trc.$rtime''";
            sql "alter database backup controlfile to ''$bk_dir/ctl.$rtime'' reuse";
            RELEASE CHANNEL ch1;
            }
            #CONFIGURE CONTROLFILE AUTOBACKUP OFF;
            rman_cmd
            rc=$?
            if [ $rc != 0 ]
            then
            echo "Backup $sid to Disk Failed At `date`" >> $log_file
            echo "Backup $sid to Disk Failed At `date`" >> $email_file
            email_dba
            exit 1
            else
            echo "===== Backup $sid to Disk Completed At `date` =====" >> $log_file
            fi
            return
            }
            #############################################################################
            # delete obsolete backups
            #############################################################################
            function del_obsolete_bk
            {
            echo "===== Delete Obsolete Backups Started At `date` =====" >> $log_file
            $ORACLE_HOME/bin/rman nocatalog << rman_cmd >> $log_file 2>&1
            connect target

            ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;

            Report obsolete;
            delete force noprompt obsolete;

            rman_cmd
            rc=$?
            if [ $rc != 0 ]
            then
            echo "Delete Obsolete Backups Failed At `date`" >> $log_file
            echo "Delete Obsolete Backups Failed At `date`" >> $email_file
            email_dba
            exit 1
            else
            echo "===== Delete Obsolete Backups Completed At `date` =====" >> $log_file
            fi
            return
            }
            #############################################################################
            #############################################################################
            # main program
            #############################################################################
            if [ $# -ne 2 ]
            then
            clear
            echo "\nIncorrect argument, ORACLE_SID Backup_Level needed\n"
            echo "\nUsage: $0 ORACLE_SID BACKUP_LEVEL(0/1)\n"
            return 1
            fi

            sid=$1
            bk_level=$2
            diff_cum=$3

            # prog=`basename $0`
            prog=rman_backup_dbs.sh
            export debug='N'
            if [[ $debug = 'Y' ]];then set -x;fi

            unset ORACLE_SID
            unset ORACLE_HOME
            unset SQLPATH
            ORACLE_SID=$sid
            export ORACLE_SID

            set_and_check
            backup_dbs_to_disk
            del_obsolete_bk
            echo "===== `date '+%Y%m%d %H:%M:%S'` $prog: Completed =====" >> $log_file
            subj="$sid@$box backup completed successfully at `date`"
            # while read dba_id
            # do
            # mailx -s "$subj" $dba_id < $log_file
            # done < /oracle/app/oracle/dba/util/backup/scripts/email_dba.list
            return 0
            #############################################################################
            # end program
            #############################################################################
            • 3. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
              AJ
              Hi,

              Seems that this explicit allocate channel overrides the channel you have configured.
              run
              {
              ALLOCATE CHANNEL ch1 TYPE disk ;
              BACKUP $backup_type
              filesperset 10 
              DATABASE;
              My advice would be to either remove the "allocate channel" from the script or reconfigure it as follows:

              run
              {
              ALLOCATE CHANNEL ch1 TYPE disk format '/rman/backups/%U';
              BACKUP $backup_type
              filesperset 10 
              DATABASE;
              • 4. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                chijar
                Thanks for you reply AJ,
                i modified to ALLOCATE CHANNEL ch1 TYPE disk format '/rman/backups/%U';
                So, the task will executed in 8 hours aprox.
                i will checking with the task end.
                I will keep u update

                thanks
                • 5. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                  chijar
                  Dear all,
                  The backup was redirected to /rman/backups like AJ said, but i have a problem. From 17 hours ago the rman process still running and when i executed: ps -efa | grep rman it shows the following:

                  oracle 19580 19576 0 20:00:01 ? 0:00 /bin/ksh /opt/oracle/scripts/rman_backup_dbs.sh SID_NAME 0
                  oracle 19576 468 0 20:00:01 ? 0:00 sh -c /opt/oracle/scripts/rman_backup_dbs.sh SID_NAME 0
                  root 12982 2219 0 Jan 16 ? 0:09 sam-sharefsd rman
                  oracle 19706 19580 0 20:00:01 ? 0:02 /opt/app/oracle/product/11.2.0/dbhome_1/bin/rman nocatalog

                  So, what is happening?
                  The RMAN log doesn't show any kind of RMAN or ORA- error. this is my RMAN LOG:
                  ---------------------------------------------------------------------------------------------------------------
                  BACKUP TYPE=INCREMENTAL LEVEL 0
                  ===== Backup name_server1 to disk Started At Fri Jan 25 20:00:00 CST 2013 =====

                  Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jan 25 20:00:00 2013

                  Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

                  RMAN>
                  connected to target database: name_server (DBID=724238326)
                  using target database control file instead of recovery catalog

                  RMAN> 2>
                  old RMAN configuration parameters:
                  CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/rman/backups/%U';
                  new RMAN configuration parameters:
                  CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/rman/backups/%U';
                  new RMAN configuration parameters are successfully stored

                  RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14>
                  allocated channel: ch1
                  channel ch1: SID=582 instance=name_server1 device type=DISK

                  Starting backup at 25-JAN-13
                  channel ch1: starting compressed incremental level 0 datafile backup set
                  channel ch1: specifying datafile(s) in backup set
                  input datafile file number=00046 name=+DATA/name_server/datafile/exp_data.327.714941353
                  input datafile file number=00053 name=+DATA/name_server/datafile/exp_data.320.714943063
                  input datafile file number=00062 name=+DATA/name_server/datafile/exp_data.311.714945141
                  input datafile file number=00071 name=+DATA/name_server/datafile/exp_data.302.714947211
                  input datafile file number=00080 name=+DATA/name_server/datafile/exp_data.292.714949309
                  input datafile file number=00084 name=+DATA/name_server/datafile/exp_data.288.714950247
                  input datafile file number=00092 name=+DATA/name_server/datafile/exp_data.280.714950547
                  input datafile file number=00085 name=+DATA/name_server/datafile/exp_data.287.714950283
                  input datafile file number=00187 name=+DATA/name_server/datafile/bpr_2012.433.796149755
                  input datafile file number=00023 name=+MAIN/name_server/datafile/bpr_i_2007.272.714940709
                  channel ch1: starting piece 1 at 25-JAN-13
                  channel ch1: finished piece 1 at 26-JAN-13
                  piece handle=/rman/backups/7lo0auq6_1_1 tag=TAG20130125T200005 comment=NONE
                  channel ch1: backup set complete, elapsed time: 10:44:40
                  channel ch1: starting compressed incremental level 0 datafile backup set
                  channel ch1: specifying datafile(s) in backup set
                  input datafile file number=00051 name=+DATA/name_server/datafile/exp_data.322.714942605
                  input datafile file number=00058 name=+DATA/name_server/datafile/exp_data.315.714944219
                  input datafile file number=00067 name=+DATA/name_server/datafile/exp_data.306.714946281
                  input datafile file number=00076 name=+DATA/name_server/datafile/exp_data.296.714948373
                  input datafile file number=00044 name=+IDX/name_server/datafile/temp_index.256.714941353
                  input datafile file number=00181 name=+MAIN/name_server/datafile/bpr_data.313.784822445
                  input datafile file number=00097 name=+DATA/name_server/datafile/exp_data.275.714950733
                  input datafile file number=00105 name=+DATA/name_server/datafile/exp_data.268.714951033
                  input datafile file number=00043 name=+IDX/name_server/datafile/temp_index.257.714941277
                  input datafile file number=00024 name=+MAIN/name_server/datafile/bpr_i_2008.265.714940759
                  channel ch1: starting piece 1 at 26-JAN-13



                  so, what is happening ?? why the rman process is still running? is possible ??
                  thanks for your help
                  • 6. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                    Hemant K Chitale
                    You can monitor the number of files and sizes of files in /rman/backups to see if they are "growing" -- i.e. the backup is actually running.

                    You can query V$SESSION_WAIT and V$SESSION_EVENT for the RMAN sessions in the database to see if they are waiting on any events.


                    Hemant K Chitale
                    • 7. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                      chijar
                      Thanks for your answer.
                      I looked for the files that would be in /rman/backups and there are 7 files that was created from JAN-25 and they have different created date.
                      The size of the files are: 226190262272 bytes, more less.

                      When i put: LIST BACKUP; it shows the same name that it shows in /rman/backups. So the backups was completed (i guess)

                      the process is still running, and when i executed:

                      SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
                      ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
                      FROM V$SESSION_LONGOPS
                      WHERE OPNAME LIKE 'RMAN%'
                      AND OPNAME NOT LIKE '%aggregate%'
                      AND TOTALWORK != 0
                      AND SOFAR <> TOTALWORK:


                      SQL> /

                      SID SERIAL# CONTEXT SOFAR TOTALWORK %_COMPLETE
                      ---------- ---------- ---------- ---------- ---------- ----------
                      582 22269 1 8433840 14795776 57

                      that view shows that the backup still running.

                      My rman backup is backing to the disk (filesystem) not in FRA. Im testing in order to put implement when it executes ok.

                      But, why my rman backup is still running ??
                      thanks
                      • 8. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                        Hemant K Chitale
                        You probably have some serious I/O constraint -- maybe a SAN cable or connector fault or a failed or failing disk. Measure the write throughput you get over 10minutes and 30minutes and then raise a ticket with your Server and Storage teams.


                        Hemant K Chitale
                        • 9. Re: CONFIGURE CHANNEL DEVICE TYPE DISK  doesn't function
                          chijar
                          thanks for your answers.
                          First i will create a debug file in order to know deeply what is going on. If i won´t get anything i will create an SR.
                          regards