NLS_DATE_FORMAT for RMAN
After you set RMAN log location, the next problem that you want to solve is the format of timestamp in the log, which was too coarse to judge the actual time like this:
In this post, we introduce 2 ways to set correct datetime in RMAN.
If you are using sqlplus, you can use ALTER SESSION SET NLS_DATE_FORMAT to modify the date format, but in RMAN, there's no such command to run. As a matter of fact, NLS_DATE_FORMAT can also be an environment variable on OS-level for RMAN to use.
Linux or Unix
$ export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
$ rman target /
> set NLS_DATE_FORMAT=yyyy-mm-dd hh24:mi:ss
> rman target /
Please notice that, you cannot use any quotes to set the environment variable in Windows platform, otherwise, you will see errors in RMAN.
From 12c, it's somewhat improved, we can run SQL statement ALTER SESSION to set the date time format during the session in RMAN. For example:
RMAN> alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
Another environment variable that you may need to set is NLS_LANG in order to notify database to set correct NLS conventions.
To know more ways to use NLS_DATE_FORMAT, you may follow the link to know it.