I know that the default of the RMAN is to add the date in the following format: TAGYYYYMMDDTHHMMSS, But if I wanted something like this: BKP_FULL_11112019. How I do this? I tried using %T but it does't work.

I want to do something like this:

backup as compressed backupset incremental level 0 database tag = 'BKP_FULL_current_date_here'

Which current_date_here must be the current date.

  • 2
    What exactly did you try doing, and how did it not work how you expected? Please edit your question accordingly. – Philᵀᴹ Nov 11 at 12:05
  • I gave one example. – Danilo Neto Nov 11 at 12:17

Construct the tag in your script and pass it as a substitution variable. Example on Linux with bash:

$ cat BKP_FULL.rcv
  backup as compressed backupset incremental level 0 database tag '&1';
$ export MYTAG='BKP_FULL_'$(date +%Y%m%d%H%M%S)
$ echo $MYTAG
$ rman target / cmdfile=BKP_FULL.rcv using $MYTAG

Recovery Manager: Release - Production on Mon Nov 11 19:54:14 2019

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

connected to target database: MIN19 (DBID=2133113873, not open)

RMAN> run
2> {
3>   backup as compressed backupset incremental level 0 database tag 'BKP_FULL_20191111195400';
4> }
Starting backup at 11-NOV-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=169 device type=DISK
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/MIN19_O71/system01.dbf
input datafile file number=00002 name=/oradata/MIN19_O71/sysaux01.dbf
input datafile file number=00003 name=/oradata/MIN19_O71/undotbs01.dbf
input datafile file number=00004 name=/oradata/MIN19_O71/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-NOV-19
channel ORA_DISK_1: finished piece 1 at 11-NOV-19
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/03ugkif9_1_1 tag=BKP_FULL_20191111195400 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 11-NOV-19

Starting Control File and SPFILE Autobackup at 11-NOV-19
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-2133113873-20191111-01 comment=NONE
Finished Control File and SPFILE Autobackup at 11-NOV-19

Recovery Manager complete.

As you can see, the tag was set as tag=BKP_FULL_20191111195400.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.