A better date format in Oracle RMAN (Recovery Manager)

One frustration I have with Oracle RMAN is that they display the date in “date only” format with the month abbreviation. I like to see my dates in a format that includes the time and in a format that I find more useable. You’re probably reading this because you have the same issue.

Here is an example of the way RMAN will look out of the box:

->rman
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 6 16:37:17 2011
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target
connected to target database: DATEPRD (DBID=123456789)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
8       B  F  A DISK        05-OCT-11       1       1       NO         TAG20111005T181525
9       B  A  A DISK        05-OCT-11       1       1       NO         TAG20111005T181558
10      B  F  A DISK        05-OCT-11       1       1       NO         TAG20111005T181600
11      B  A  A DISK        05-OCT-11       1       1       NO         TAG20111005T182015
12      B  F  A DISK        05-OCT-11       1       1       NO         TAG20111005T182017
13      B  A  A DISK        05-OCT-11       1       1       NO         TAG20111005T182047
14      B  F  A DISK        05-OCT-11       1       1       NO         TAG20111005T182049
RMAN> exit

Changing the date format is simple – just set the NLS_DATE_FORMAT parameter in your UNIX/linux session. You can also do this in your profile so you don’t have to repeat the work.

Here is what you do:

->export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss';
->rman
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 6 16:37:39 2011
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target
connected to target database: DATEPRD (DBID=123456789)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
8       B  F  A DISK        2011/10/05 18:15:43 1       1       NO         TAG20111005T181525
9       B  A  A DISK        2011/10/05 18:15:59 1       1       NO         TAG20111005T181558
10      B  F  A DISK        2011/10/05 18:16:01 1       1       NO         TAG20111005T181600
11      B  A  A DISK        2011/10/05 18:20:16 1       1       NO         TAG20111005T182015
12      B  F  A DISK        2011/10/05 18:20:35 1       1       NO         TAG20111005T182017
13      B  A  A DISK        2011/10/05 18:20:48 1       1       NO         TAG20111005T182047
14      B  F  A DISK        2011/10/05 18:20:50 1       1       NO         TAG20111005T182049
RMAN> exit
Recovery Manager complete.
Advertisements

One response to “A better date format in Oracle RMAN (Recovery Manager)

  1. Pingback: A better date format in Oracle RMAN (Recovery Manager) | Jed's

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s