10 Replies Latest reply: Nov 18, 2012 12:38 AM by Shivananda Rao RSS

    backup full

    R. Royal
      Hi,
      I create this rman shell script for Oracle 8i version for backup full (database+controlfile+archivelog):
      rman nocatalog <<EOF >> $LOG 2>&1
      connect target sys/password@sid
      run {
      allocate channel c1 type disk format '/backup_full/backup%d_DB_%u_%s_%p';
      backup database;
       sql 'alter system archive log current';
      backup format 'backup%d_CL_%u_%s_%p' current controlfile;
      backup format 'backup%d_AR_%u_%s_%p' archivelog all delete input;
      release channel c1;
          }
      Now I need rman script for Oracle 10.2.0.5 for backup full (database+controlfile+archivelog).

      Is It correct? What must I change?


      Thanks in advance!
        • 1. Re: backup full
          sb92075
          Raf Royal wrote:
          Hi,
          I create this rman shell script for Oracle 8i version for backup full (database+controlfile+archivelog):
          rman nocatalog <<EOF >> $LOG 2>&1
          connect target sys/password@sid
          run {
          allocate channel c1 type disk format '/backup_full/backup%d_DB_%u_%s_%p';
          backup database;
          sql 'alter system archive log current';
          backup format 'backup%d_CL_%u_%s_%p' current controlfile;
          backup format 'backup%d_AR_%u_%s_%p' archivelog all delete input;
          release channel c1;
          }
          Now I need rman script for Oracle 10.2.0.5 for backup full (database+controlfile+archivelog).

          Is It correct? What must I change?


          Thanks in advance!
          what happens when you run it on V10?
          why upgrade from 1 unsupported version to another?
          • 2. Re: backup full
            R. Royal
            I can't try it now on Oracle 10g.
            I need create a script rman backup full (database+controlfile+archivelog) without catalog for another oracle database version 10g.

            I'd like to know if this script is correct or not.

            Thanks!
            • 3. Re: backup full
              Osama_Mustafa
              you have to create two files :
              1-backup.sh
              2-backup.rman


              in backup.sh
              export ORACLE_BASE=/oracle/app/product/10.2.0
              export ORACLE_HOME=$ORACLE_BASE/db_1
              export PATH=$ORACLE_HOME/bin:$PATH
              export ORACLE_SID=<SID>
              
              
              rman target / cmdfile=<PATH>/backup.rman log=<PATH>/rman.log
              in backup.rman
              run
              {
              allocate channel c1 type disk format '<PATH>/rman_db_%T_%U.rman';
              backup as compressed backupset full database include current controlfile;
              release channel c1;
              allocate channel c1 type disk format '<PATH>/rman_arc_%T_%U.rman';
              sql "alter system archive log current";
              delete noprompt archivelog all backed up 2 times to device type disk;
              backup as compressed backupset archivelog all;
              sql "alter database backup controlfile  to ''/oracle/backup/rman_control.rman'' reuse";
              release channel c1;
              }
              For Backup Script check
              http://www.dbsnaps.com/oracle/rman-backup-script/
              • 4. Re: backup full
                EdStevens
                Osama_mustafa wrote:
                you have to create two files :
                1-backup.sh
                2-backup.rman
                No, he doesn't have to create two files. His current technique of using input redirection in a shell script is just fine. He just needs to look at the new features of 10g and proceed accordingly.
                <snip>
                • 5. Re: backup full
                  EdStevens
                  Raf Royal wrote:
                  I can't try it now on Oracle 10g.
                  Why not?

                  Why haven't you already installed either Virtual Box or VMplayer or VMworkstation on your personal computer and created your own private virtual test server?

                  http://edstevensdba.wordpress.com/category/opinion/

                  There are simply no excuses for not having a test system to test stuff like this.

                  I need create a script rman backup full (database+controlfile+archivelog) without catalog for another oracle database version 10g.

                  I'd like to know if this script is correct or not.

                  Thanks!
                  • 6. Re: backup full
                    R. Royal
                    I'm sorry, I'm a little confused!

                    my script is correct in version 10g for compress backup full?
                    • 7. Re: backup full
                      sb92075
                      Raf Royal wrote:
                      I'm sorry, I'm a little confused!

                      my script is correct in version 10g for compress backup full?
                      yes, it correct; unless or until it throws error(s).
                      • 8. Re: backup full
                        Shivananda Rao
                        Raf Royal wrote:
                        Hi,
                        I create this rman shell script for Oracle 8i version for backup full (database+controlfile+archivelog):
                        rman nocatalog <<EOF >> $LOG 2>&1
                        connect target sys/password@sid
                        run {
                        allocate channel c1 type disk format '/backup_full/backup%d_DB_%u_%s_%p';
                        backup database;
                        sql 'alter system archive log current';
                        backup format 'backup%d_CL_%u_%s_%p' current controlfile;
                        backup format 'backup%d_AR_%u_%s_%p' archivelog all delete input;
                        release channel c1;
                        }
                        Now I need rman script for Oracle 10.2.0.5 for backup full (database+controlfile+archivelog).

                        Is It correct? What must I change?


                        Thanks in advance!
                        Hello,

                        The below code has to work.
                        rman nocatalog <<EOF >> $LOG 2>&1
                        connect target sys/password@sid
                        run {
                        allocate channel c1 device type disk format '/backup_full/backup%d_DB_%u_%s_%p';
                        backup database;
                         sql 'alter system archive log current';
                        backup current controlfile;
                        backup archivelog all delete input;
                        release channel c1;
                            }
                        • 9. Re: backup full
                          R. Royal
                          I create this shell script:
                          MY_PATH="/backup_rman_full/"
                          export MY_PATH
                          
                          rman nocatalog <<EOF >> $LOG 2>&1
                          connect target
                          run {
                          allocate channel c1 type disk format '${MY_PATH}back%d_%u_%s_%p';
                            backup database;
                          sql 'alter system archive log current';
                          backup format '${MY_PATH}back%d_C_%u_%s_%p' current controlfile;
                          backup format '${MY_PATH}back%d_A_%u_%s_%p' archivelog all delete input;
                          release channel c1;
                          }
                          exit
                          EOF
                          Is correct the sintax?
                          • 10. Re: backup full
                            Shivananda Rao
                            Raf Royal wrote:
                            I create this shell script:
                            MY_PATH="/backup_rman_full/"
                            export MY_PATH
                            
                            rman nocatalog <<EOF >> $LOG 2>&1
                            connect target
                            run {
                            allocate channel c1 type disk format '${MY_PATH}back%d_%u_%s_%p';
                            backup database;
                            sql 'alter system archive log current';
                            backup format '${MY_PATH}back%d_C_%u_%s_%p' current controlfile;
                            backup format '${MY_PATH}back%d_A_%u_%s_%p' archivelog all delete input;
                            release channel c1;
                            }
                            exit
                            EOF
                            Is correct the sintax?
                            Hello,

                            Your above script looks perfect except for "$LOG" which is not defined. But I prefer to add ORACLE_HOME and ORACLE_SID in your script and also change the format specifier "%u" to "%U" so that RMAN generates uniqueness in the backup files. Here is the updated script for you.
                            ORACLE_HOME=<Your_DB_HOME_PATH>
                            export ORACLE_HOME
                            ORACLE_SID=<Your_Database_SID>
                            export ORACLE_SID
                            MY_PATH="/backup_rman_full/"
                            export MY_PATH
                             
                            rman nocatalog <<EOF 
                            connect target
                            run {
                            allocate channel c1 type disk format '${MY_PATH}back%d_%U_%s_%p';
                              backup database;
                            sql 'alter system archive log current';
                            backup format '${MY_PATH}back%d_C_%U_%s_%p' current controlfile;
                            backup format '${MY_PATH}back%d_A_%U_%s_%p' archivelog all delete input;
                            release channel c1;
                            }
                            exit
                            EOF
                            Please consider closing your threads by providing appropriate points if you feel that they have been answered. Please keep the forum clean.