1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Complete Backup Script of your Oracle production server.

Discussion in 'Server Administration and Options' started by Arju, Oct 17, 2008.

  1. Arju

    Arju Forum Expert

    Messages:
    107
    Likes Received:
    5
    Trophy Points:
    240
    Location:
    Bangladesh
    Backup Script for your production server.

    Assume that your database was in noarchivelog mode and you want to use recovery catalog in order to use database.

    Step 01: Connect to source database as sysdba.
    oracle@neptune ~$ sqlplus / as sysdba

    Step 02: See the log mode of database.
    SQL> select log_mode from v$database;

    Step 03: Shutdown database.
    SQL> shut immediate;

    Step 04: Start the database in mount state.
    SQL> startup mount

    Step 05: Enable archive log.
    SQL> alter database archivelog;

    Step 06: Open the database.
    SQL> alter database open;

    Step 07: Check the archived destination and flash recovery area size and location.
    SQL> archive log list
    SQL> show parameter db_recovery_file_dest

    Step 08: Connect to rman of source database.
    SQL> host rman target /

    Step 09: Change some configuration settings of source database.

    RMAN> configure controlfile autobackup on;

    RMAN> configure backup optimization on;

    RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;

    Step 10: Connect to the recovery catalog database.
    oracle@neptune ~$ sqlplus / as sysdba

    Step 11: Create recovery catalog user and tablespace and assign permission.
    SQL> create user rman identified by rman;

    SQL> create tablespace catalog_tbs datafile '/orad/catalog.dbf' size 10M autoextend on maxsize unlimited;

    SQL> alter user rman default tablespace catalog_tbs temporary tablespace temp quota unlimited on catalog_spc;

    SQL> grant recovery_catalog_owner to rman;

    Step 12: Connect to recovery catalog database.
    bash-3.00$ rman catalog rman/rman

    Step 13: Create recovery catalog schema objects.
    RMAN> create catalog tablespace catalog_spc;

    Step 14: Be sure whether recovery catalog objects successfully created.
    SQL> select table_name from tabs;

    Step 15: Connect to rman on source and recovery catalog database.
    bash-3.00$ rman target / catalog rman/rman@something_as_you_wish

    Step 16: Register database with recovery catalog.
    RMAN> register database;

    Step 17: Check whether registration was successful.
    RMAN> report schema;

    Step 18: Run these scripts and take backups.
    Weekly run,

    RUN
    {
    BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG;
    DELETE OBSOLETE;
    }
    this script.
    Daily run
    this script.
    RUN
    {
    BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE PLUS ARCHIVELOG;
    DELETE OBSOLETE;
    }