[20160214]rman執行指令碼註解問題.txt

lfree發表於2016-02-14

[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         TAG20160214T145228

RMAN> # 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:40

BS 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_2nqttmmn

  List 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:03

BS 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_2oqttmpc

  List 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個記錄!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1988542/,如需轉載,請註明出處,否則將追究法律責任。

相關文章