本文共 5320 字,大约阅读时间需要 17 分钟。
[20160214]rman执行脚本注解问题.txt
--节前的问题,写的脚本有问题,当时并没有解决,就一直放到现在,实际上问题不大,主要想给脚本加一些注解。
--今天研究一下,实际上就是使用#号。$ cat cc.rman
# list backup summary;
run
{ allocate channel c1 device type DISK; allocate channel c2 device type DISK; # list backup summary; release channel c1; release channel c2; }$ rlrman checksyntax @cc.rman
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Feb 14 16:28:11 2016 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: BOOK (DBID=1337401710)RMAN> # list backup summary;
2> 3> run 4> { 5> allocate channel c1 device type DISK; 6> allocate channel c2 device type DISK; 7> # list backup summary; 8> release channel c1; 9> release channel c2; 10> } 11> The cmdfile has no syntax errors Recovery Manager complete.--另外还发现在run块内不能使用list命令。
$ rlrman checksyntax @cc.rman
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Feb 14 16:28:49 2016 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: BOOK (DBID=1337401710) RMAN> # list backup summary; 2> 3> run 4> { 5> allocate channel c1 device type DISK; 6> allocate channel c2 device type DISK; 7> list RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found "list": expecting one of: "advise, allocate, alter, backup, @, catalog, change, configure, convert, copy, crosscheck, delete, duplicate, execute, flashback, host, mount, open, recover, release, repair, report, restore, resync, send, set, show, shutdown, sql, startup, switch, transport, validate, }" RMAN-01007: at line 7 column 3 file: cc.rman--另外就是奇怪的是在rman 的手工模式下输入:
RMAN> # list backup summary
2> 3>RMAN> # list backup summary
2> list backup summary ;List of Backups
=============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- ------------------- ------- ------- ---------- --- 47 B F A DISK 2016-02-14 14:50:33 1 1 NO TAG20160214T145025 48 B F A DISK 2016-02-14 14:50:41 1 1 NO TAG20160214T145025 49 B A A DISK 2016-02-14 14:51:04 1 1 NO TAG20160214T145103 50 B A A DISK 2016-02-14 14:52:29 1 1 NO TAG20160214T145228RMAN> # list backup summary
2> 3> list backup ;List of Backup Sets ===================
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 47 Full 1.65G DISK 00:00:08 2016-02-14 14:50:33 BP Key: 48 Status: AVAILABLE Compressed: NO Tag: TAG20160214T145025 Piece Name: /home/oracle/backup/full1_2lqttmlh List of Datafiles in backup set 47 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- ------------------- ---- 1 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/system01.dbf 2 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/sysaux01.dbf 3 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/undotbs01.dbf 4 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/users01.dbf 5 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/example01.dbf 6 Full 13223007759 2016-02-14 14:50:25 /mnt/ramdisk/book/sugar01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ------------------- 48 Full 9.58M DISK 00:00:01 2016-02-14 14:50:41 BP Key: 49 Status: AVAILABLE Compressed: NO Tag: TAG20160214T145025 Piece Name: /home/oracle/backup/full1_2mqttmm0 SPFILE Included: Modification time: 2016-02-14 09:40:31 SPFILE db_unique_name: BOOK Control File Included: Ckp SCN: 13223007765 Ckp time: 2016-02-14 14:50:40BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ------------------- 49 123.09M DISK 00:00:01 2016-02-14 14:51:04 BP Key: 50 Status: AVAILABLE Compressed: NO Tag: TAG20160214T145103 Piece Name: /home/oracle/backup/archive_2nqttmmnList of Archived Logs in backup set 49
Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ------------------- ---------- --------- 1 346 13222947957 2016-02-13 10:08:22 13222971396 2016-02-13 22:08:38 1 347 13222971396 2016-02-13 22:08:38 13222990745 2016-02-14 08:28:54 1 348 13222990745 2016-02-14 08:28:54 13223006508 2016-02-14 14:09:09 1 349 13223006508 2016-02-14 14:09:09 13223007788 2016-02-14 14:51:03BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ------------------- 50 123.14M DISK 00:00:01 2016-02-14 14:52:29 BP Key: 51 Status: AVAILABLE Compressed: NO Tag: TAG20160214T145228 Piece Name: /home/oracle/backup/archivenew_2oqttmpcList of Archived Logs in backup set 50
Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ------------------- ---------- --------- 1 346 13222947957 2016-02-13 10:08:22 13222971396 2016-02-13 22:08:38 1 347 13222971396 2016-02-13 22:08:38 13222990745 2016-02-14 08:28:54 1 348 13222990745 2016-02-14 08:28:54 13223006508 2016-02-14 14:09:09 1 349 13223006508 2016-02-14 14:09:09 13223007788 2016-02-14 14:51:03 1 350 13223007788 2016-02-14 14:51:03 13223007904 2016-02-14 14:52:11 1 351 13223007904 2016-02-14 14:52:11 13223007917 2016-02-14 14:52:28-- 做1个记录!!
转载地址:http://kelum.baihongyu.com/