dbsheng :
在三思笔记的一步一步学习rman中是这样写的:
启 动 r m a n 还 有 一 点 各 位 新 友 也 了 解 一 下 , 对 于 以 后 写rman批处理会有帮助, 如 果 我 们 以 后 写 了 一 堆 超 长 的 , 就 将 执 行 结 果 直 接 打 印 到 屏 幕 了 r m a n , 之 前 的 示 例 中 均 没 有 指 定 , 出 批 处 理 放 在 后 台 执 行 , 可 能 会 希 望 能 够 把 执 行 日 志 记 录 下 来 备 查 , 这 个 时 候 日 志 输 出 功 能 就 用 上 了 。 这 个 功 能 也 非 常 简 单 , 如 下
![](https://i-blog.csdnimg.cn/blog_migrate/266beede78c2281188a74853404bff01.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e382b05f110294f8cf986d661e7dee55.png)
测试如下
[oracle@dbrac1 swq]$ rman target / log rman_log.txt
RMAN> backup database;
RMAN>
RMAN> list backup summary
2> ;
RMAN>
RMAN> exit;
[oracle@dbrac1 swq]$ cat rman_log.txt
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Nov 21 12:44:09 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=322796954)
RMAN>
RMAN>
RMAN>
RMAN>
Starting backup at 21-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=57 instance=PROD1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/prod/datafile/system.259.910958653
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.672.928500295 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/prod/datafile/sysaux.260.910958703
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.673.928500339 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/opt/sheng/sheng01.dbf
input datafile file number=00007 name=/opt/sheng/sheng02.dbf
input datafile file number=00005 name=+DATA/prod/datafile/users.264.910958799
input datafile file number=00008 name=+DATA/prod/datafile/undotbs1.2.dbf
input datafile file number=00009 name=+DATA/prod/datafile/undotbs1
input datafile file number=00010 name=+DATA/prod/datafile/undotbs1.270.922320309
input datafile file number=00003 name=+DATA/prod/datafile/undotbs1.261.910958737
input datafile file number=00004 name=+DATA/prod/datafile/undotbs2.263.910958779
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.674.928500383 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 21-NOV-16
Starting Control File and SPFILE Autobackup at 21-NOV-16
piece handle=+BACKUPDG/prod/autobackup/2016_11_21/s_928500409.675.928500413 comment=NONE
Finished Control File and SPFILE Autobackup at 21-NOV-16
RMAN> 2>
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
17 B F A DISK 13-NOV-16 1 1 NO TAG20161113T172310
18 B F A DISK 13-NOV-16 1 1 NO TAG20161113T172311
19 B F A DISK 13-NOV-16 1 1 NO TAG20161113T235541
20 B F A DISK 13-NOV-16 1 1 NO TAG20161113T235833
21 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
22 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
23 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
24 B F A DISK 14-NOV-16 1 1 NO TAG20161114T000222
25 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
26 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
27 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
28 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124649
RMAN>
Recovery Manager complete.
[oracle@dbrac1 swq]$
结论:屏幕不再输出,信息被记录在了rman_log.txt 文件中
在三思笔记的一步一步学习rman中是这样写的:
启 动 r m a n 还 有 一 点 各 位 新 友 也 了 解 一 下 , 对 于 以 后 写rman批处理会有帮助, 如 果 我 们 以 后 写 了 一 堆 超 长 的 , 就 将 执 行 结 果 直 接 打 印 到 屏 幕 了 r m a n , 之 前 的 示 例 中 均 没 有 指 定 , 出 批 处 理 放 在 后 台 执 行 , 可 能 会 希 望 能 够 把 执 行 日 志 记 录 下 来 备 查 , 这 个 时 候 日 志 输 出 功 能 就 用 上 了 。 这 个 功 能 也 非 常 简 单 , 如 下
![](https://i-blog.csdnimg.cn/blog_migrate/266beede78c2281188a74853404bff01.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e382b05f110294f8cf986d661e7dee55.png)
测试如下
[oracle@dbrac1 swq]$ rman target / log rman_log.txt
RMAN> backup database;
RMAN>
RMAN> list backup summary
2> ;
RMAN>
RMAN> exit;
[oracle@dbrac1 swq]$ cat rman_log.txt
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Nov 21 12:44:09 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=322796954)
RMAN>
RMAN>
RMAN>
RMAN>
Starting backup at 21-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=57 instance=PROD1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/prod/datafile/system.259.910958653
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.672.928500295 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/prod/datafile/sysaux.260.910958703
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.673.928500339 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/opt/sheng/sheng01.dbf
input datafile file number=00007 name=/opt/sheng/sheng02.dbf
input datafile file number=00005 name=+DATA/prod/datafile/users.264.910958799
input datafile file number=00008 name=+DATA/prod/datafile/undotbs1.2.dbf
input datafile file number=00009 name=+DATA/prod/datafile/undotbs1
input datafile file number=00010 name=+DATA/prod/datafile/undotbs1.270.922320309
input datafile file number=00003 name=+DATA/prod/datafile/undotbs1.261.910958737
input datafile file number=00004 name=+DATA/prod/datafile/undotbs2.263.910958779
channel ORA_DISK_1: starting piece 1 at 21-NOV-16
channel ORA_DISK_1: finished piece 1 at 21-NOV-16
piece handle=+BACKUPDG/prod/backupset/2016_11_21/nnndf0_tag20161121t124450_0.674.928500383 tag=TAG20161121T124450 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 21-NOV-16
Starting Control File and SPFILE Autobackup at 21-NOV-16
piece handle=+BACKUPDG/prod/autobackup/2016_11_21/s_928500409.675.928500413 comment=NONE
Finished Control File and SPFILE Autobackup at 21-NOV-16
RMAN> 2>
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
17 B F A DISK 13-NOV-16 1 1 NO TAG20161113T172310
18 B F A DISK 13-NOV-16 1 1 NO TAG20161113T172311
19 B F A DISK 13-NOV-16 1 1 NO TAG20161113T235541
20 B F A DISK 13-NOV-16 1 1 NO TAG20161113T235833
21 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
22 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
23 B F A DISK 14-NOV-16 1 1 NO TAG20161113T235833
24 B F A DISK 14-NOV-16 1 1 NO TAG20161114T000222
25 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
26 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
27 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124450
28 B F A DISK 21-NOV-16 1 1 NO TAG20161121T124649
RMAN>
Recovery Manager complete.
[oracle@dbrac1 swq]$
结论:屏幕不再输出,信息被记录在了rman_log.txt 文件中
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29674916/viewspace-2128799/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29674916/viewspace-2128799/