前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >自定义 RMAN 显示的日期时间格式

自定义 RMAN 显示的日期时间格式

作者头像
Leshami
发布2018-08-14 09:57:15
1.9K0
发布2018-08-14 09:57:15
举报
文章被收录于专栏:乐沙弥的世界乐沙弥的世界

      缺省情况下,使用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 : Robinson        --Blog   : http://blog.csdn.net/robinson_0612

3、永久修改RMAN日期及时间格式         最佳的办法是将该参书直接添加到.bash_profile robin@SZDB:~> echo "export NLS_DATE_FORMAT='yyyymmdd hh24:mi:ss'" >> ~/.bash_profile

        补充@20141123:对于windows环境下RMAN下日期时间格式可以在Win命令行提示符下使用 set NLS_DATE_FORMAT=yyyymmdd hh24:mi:ss

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2013年06月03日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档