Tag Rman
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Tag Rman

  1. #1
    Join Date
    Apr 2007
    Posts
    13

    Tag Rman

    Is it possible to concat values in the rman command lines?
    I am using the following statement to back up the database.

    RMAN> run {
    2> backup as compressed backupset database tag 'BACKUP_FULL_ORCL%';
    3> backup archivelog all delete all input tag 'BACKUP_FULL_ARCHIVELOG%';
    4> }

    I would like to know how I do to concat a value like sysdate on the TAG.
    For example:
    backup as compressed backupset database tag 'BACKUP_FULL_ORCL'||sysdate
    I tried and it is not worked.

  2. #2
    Join Date
    Apr 2003
    Location
    Pune,Maharashtra. India.
    Posts
    245
    I am not sure on which environment you are. If you are on UNIX you can use following.

    export this at very start of your unix script

    export TAG_0 =LEVEL0_`date`

    you can see man date and can use option like `date +%d or +%m`

    and in run block give follwing

    RMAN> run {
    2> backup as compressed backupset database tag '$TAG_0';
    3> backup archivelog all delete all input tag ''$TAG_0';
    4> }
    Rgds
    Parag

  3. #3
    Join Date
    Apr 2007
    Posts
    13
    So, I am linux environment.
    Look how I did.

    [flavio@xflavio ~]$ export TAG_0=BACKUP_FULL_ORCL_$(date +%d_%m_%y)
    [flavio@xflavio ~]$ rman target /
    RMAN> backup as compressed backupset database tag '$TAG_0';

    But there was an error

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/30/2007 18:13:51
    ORA-01264: Unable to create backup piece file name
    ORA-07217: sltln: environment variable cannot be evaluated.

    Did I do anything wrong?

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,027
    You can specify it as "${TAG_0}".
    this space intentionally left blank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width