UNSOLVED

Vamsi_P

updated

12 years ago

V

Vamsi_P

1 Rookie

•

52 Posts

1

16251

October 17th, 2014 09:00

Oracle Backup Configuration - Avamar

Hello Team,

I got a request to configure Server file system level & Oracle Database backups. Oracle Databases are running in Cluster environment , I went through EMC Avamar 7.0 for Oracle user guide.

But Now my doubt is What are the details I need ask to Database Team & What is the best practice to proceed with configuration, I bit confused after reading the document as well.

Scheduling Oracle database backups & Backup and Restore with Oracle RMAN

We are using Avamar 7

  • Vamsi_P

    1 Rookie

    •

    52 Posts

    7939

    0

    Posted October 17th, 2014 09:00

    Oracle Database are running on Cluster environment..

  • rob3000

    10 Posts

    7939

    1

    Posted October 22nd, 2014 06:00

    We are also using Avamar v7 to backup up the Linux file systems and the Oracle databases w/the RMAN plugin. I spent a few weeks with one of our DBAs thoroughly documenting the following processes:

    Backup database & logs

    Restore to same instance

    Restore (DUPLICATE) to another (DEV/TEST) instance.

    First, on each server, you'll need to make the avtar-flags.txt file. If you are backing up large databases (> 500GB), you'll want to utilize multiple RMAN channels to speed things up. Depending on the size of your database(s) and the number of channels, set the avtar-flags.txt "--hashcachemax=" directive appropriately (see EMC/Avamar docs for details). Also, if you are targeting a Data Domain unit, set these directives in the avtar-flags.txt file:

    --ddr

    --ddr-index=1

    Here's a copy of my avtar-flags.txt file from a Linux (RHEL 5) server; note that this is targeting a Data Domain (using dd-boost, hence the --ddr line), and the databases being backed up are around 4TB (4,000 GB) and we use 4 RMAN channels, hence the --hashcachemax=2000:

    --pidname=Oracle

    --pidnum=1002

    --logfile=/usr/local/avamar/var/clientlogs/avtar.log

    --vardir=/var/avamar

    --id=AVAMAR_BACKUP_USERNAME

    --ap=AVAMAR_BACKUP_PASSWORD

    --path=/linux_clients/HOSTNAME.EXAMPLE.COM

    --expires=10

    --ddr

    --ddr-index=1

    --enable-filecache=false

    --hashcachemax=2000

    IMPORTANT: make sure that the "oracle" user that runs the RMAN process has permission to read the avtar-flags.txt file, and also can write log and cache files into the "vardir" (/var/avamar in my case).

    SETTING UP YOUR ENVIRONMENT:

    "su - " to the oracle user that will execute RMAN; set your environment like so: (you may need to adjust the paths depending on your install):

    # su - oracle-user

    # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/avamar/lib

    We can now execute RMAN. (connect to target and catalog)

    # rman

    RMAN> connect target sys/SYS_PASSWORD

    RMAN> connect catalog CAT_USER/CAT_PASSWORD@CATALOG

    # -------------------------- TEST instance backup script - 4 channels ---------------------------

    run{

    allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    allocate channel c2 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    allocate channel c3 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    allocate channel c4 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c1_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"

    "--cacheprefix=c1_TEST"';

    send channel='c2' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c2_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"

    "--cacheprefix=c2_TEST"';

    send channel='c3' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c3_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"

    "--cacheprefix=c3_TEST"';

    send channel='c4' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c4_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"

    "--cacheprefix=c4_TEST"';

    crosscheck backup;

    backup database;

    crosscheck archivelog all;

    backup archivelog all not backed up 1 times;

    ## Cleanup old backups and files:

    ## DELETE NOPROMPT ARCHIVELOG ALL;

    ## DO NOT DELETE ARCHIVELOG

    DELETE NOPROMPT EXPIRED BACKUP;

    DELETE NOPROMPT OBSOLETE;

    release channel c1;

    release channel c2;

    release channel c3;

    release channel c4;

    }

    exit;

    # -------------------------- END OF TEST instance backup script - 4 channels ---------------------------

    BE CAREFUL WITH QUOTES/DOUBLE QUOTES; IF YOU MISS ONE, RMAN WILL ERROR, BUT IT WILL NOT BE APPARENT WHAT THE ERROR WAS!!!

    I'll post the recovery and clone instructions in another reply.

  • rob3000

    10 Posts

    7939

    1

    Posted October 22nd, 2014 07:00

    CLONE AN INSTANCE - RESTORING A BACKUP TO A DIFFERENT INSTANCE:

    This example is an instance clone/refresh of a backup taken on the same host.

    We are restoring to instance "NEW" from backup of instance "TEST".

    We are using ASM for our datafiles, and 2 RMAN channels.

    So we'll connect to "NEW" using sqlplus, drop the database, and put it in "startup nomount", ready for a clone/restore.

    "su - " to oracle user that has access to instance "NEW" and prepare the instance:

    # Drop, Startup database:

    sqlplus / as sysdba <

    shutdown abort

    startup mount restrict

    REM drop database ;

    shutdown abort

    startup nomount

    EOF

    Set up your environment (see 1st reply), execute RMAN, connecting to target (TEST), aux (NEW) and catalog:

    # rman target sys/SYS_PASSWORD@TEMP auxiliary / catalog CAT_USER/CAT_PASSWORD@CATALOG

    DUPLICATE the backed up TEMP instance to NEW, renaming the files/paths (ASM in this example) appropriately.

    ----------------START RMAN DUPLICATE SCRIPT----------------

    RUN {

    ALLOCATE auxiliary channel x1 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'

    SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x1_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';

    ALLOCATE auxiliary channel x2 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'

    SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x2_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';

    DUPLICATE TARGET DATABASE TO NEW db_file_name_convert=('+ASMDISKGROUP/TEMP','+ASMDISKGROUP/NEW')

    logfile group 1 ('+ASMDISKGROUP') size 1g,

            group 2 ('+ASMDISKGROUP') size 1g,

            group 3 ('+ASMDISKGROUP') size 1g,

            group 4 ('+ASMDISKGROUP') size 1g;

    }

    ----------------END RMAN DUPLICATE SCRIPT----------------

    Note: Merged SEND cmd into ALLOCATE cmd in the above example.

    Note: The spfile must exist, and the db_name and db_unique_name and ORACLE_SID should all match.

    Note: The avtar-flags file must be from the server where the source db was backed up from.

  • rob3000

    10 Posts

    7939

    1

    Posted October 22nd, 2014 07:00

    RESTORE TO SAME INSTANCE


    Get the "dbid" of the database you are going to restore; your DBA will know how to do this. Setup your environment (see previous post) and execute RMAN, connecting to target & catalog; here is an example set of scripts to recover a dropped database that we had backed up; this uses 1 RMAN channel.

    The idea is to 1st restore the controlfile, then restore the database, then recover it. Here's the example for an instance called "TEST" with a fictional "dbid" of 1234:

    Single channel RMAN restore; instance name TEST, dbid=1234*.

    *Note: 1234 is not an actual/valid DBID

    ---------------------------START RMAN TEST INSTANCE RECOVER SCRIPT-------------------

    # Restore controlfile:

    set dbid=1234;

    run{

    allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c1_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"’;

    restore controlfile;

    startup mount;

    release channel c1;

    }

    # list backup;

    # exit;

    # Restore & Recover database; single channel:

    run{

    allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)";

    send channel='c1' '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt"

    "--logfile=/var/avamar/c1_TEST_avoracle.log" "--bindir=/usr/local/avamar/bin"’;

    restore database;

    recover database;

    release channel c1;

    }

    alter database open resetlogs;

    exit;

    ---------------------------END RMAN TEST INSTANCE RECOVER SCRIPT-------------------

    See next post for cloning/duplicating an instance w/RMAN & Avamar using RMAN DUPLICATE syntax.

  • rob3000

    10 Posts

    7939

    0

    Posted October 22nd, 2014 11:00

    We run single instance and RAC environments and back them up without any special configurations, using the same methodology. We did NOT use the rac_config script for our RAC instances. For those, we always just backup/restore from 1 node, just like we would on a single instance host. Works fine.

    For example, a 3 node RAC database consisting of node1.example.com, node2.example.com, and node3.example.com.

    We install the Avamar client on all 3 servers and register them with the Avamar system for file system backups. Then on node1, we also install the AvamarRMAN plugin, and do the Oracle RMAN backups/restores from there.

    Note that we schedule, initiate/control all backups/restores using RMAN on the Oracle servers; this way the DBAs control/schedule all backups & restores & and feel comfortable with this arrangement.

  • Vamsi_P

    1 Rookie

    •

    52 Posts

    7939

    0

    Posted October 22nd, 2014 11:00

    Thank you for the detailed information Rob.


    Can we configure the backups for the Linux Cluster servers?