自訂 RMAN 顯示的日期時間格式

來源:互聯網
上載者:User

預設情況下,使用RMAN備份與恢複介面僅僅顯示的是日期,而沒有具體的時間。有時候需要查看具體的時間,如查看當天多個Incarnation的情形。對於這個問題,主要是設定環境變數參數NLS_DATE_FORMAT即可,如下文所描述。
 
1、RMAN日期及時間的預設格式
        robin@SZDB:~> rman target /

        Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 1 13:54:49 2013

        Copyright (c) 1982, 2005, Oracle.  All rights reserved.

        connected to target database: GOBO1 (DBID=733951103)

        RMAN> list incarnation;

        using target database control file instead of recovery catalog

        List of Database Incarnations
        DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
        ------- ------- -------- ---------------- --- ---------- ----------
        1      1      GOBO1    733951103        PARENT  1          18-FEB-09
        2      2      GOBO1    733951103        PARENT  79915248  20-SEP-12
        3      3      GOBO1    733951103        PARENT  80298787  31-MAY-13
        4      4      GOBO1    733951103        CURRENT 80307144  31-MAY-13

        RMAN> exit

        Recovery Manager complete. 

2、修改環境變數對RMAN日期及時間格式進行自訂
        robin@SZDB:~> export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss';
        robin@SZDB:~> rman target /

        Recovery Manager: Release 10.2.0.3.0 - Production on Sat Jun 1 13:55:30 2013

        Copyright (c) 1982, 2005, Oracle.  All rights reserved.

        connected to target database: GOBO1 (DBID=733951103)

        RMAN> list incarnation;

        using target database control file instead of recovery catalog

        List of Database Incarnations
        DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
        ------- ------- -------- ---------------- --- ---------- ----------
        1      1      GOBO1    733951103        PARENT  1          20090218 16:43:43
        2      2      GOBO1    733951103        PARENT  79915248  20120920 15:00:44
        3      3      GOBO1    733951103        PARENT  80298787  20130531 21:03:41
        4      4      GOBO1    733951103        CURRENT 80307144  20130531 22:28:05

        --Author : 

3、永久修改RMAN日期及時間格式
        最佳的辦法是將該參書直接添加到.bash_profile
        robin@SZDB:~> echo "export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss'" >> ~/.bash_profile

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.