ITPub博客

首页 > 数据库 > Oracle > [20161230]rman checksyntax2.txt

[20161230]rman checksyntax2.txt

原创 Oracle 作者:lfree 时间:2016-12-30 10:23:58 0 删除 编辑

[20161230]rman checksyntax2.txt

--曾经写过一篇rman checksyntax的问题,这个问题存在10g:
http://blog.itpub.net/267265/viewspace-2130511/

--今天看了一个链接重复测试:https://jhdba.wordpress.com/2016/12/29/rman-checksyntax-function/#comment-11009

1.环境:
SYS@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

$ cat -n r.rman
     1
     2  run
     3  {
     4    allocate channel c1 device type DISK
     5    allocate channel c2 device type DISK;
     6
     7    release channel c1;
     8    release channel c2;
     9  }

--//注意开头1行空行,第4行我少写一个分号,测试看看.

2.测试:
$ rlrman checksyntax
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 30 10:23:10 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: BOOK (DBID=1337401710)

RMAN> @ r.rman

RMAN>
RMAN> run
2> {
3>   allocate channel c1 device type DISK
4>   allocate
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "allocate": expecting one of: "auxiliary, connect, format, maxopenfiles, maxpiecesize, parms, rate, send, to, ;"
RMAN-01007: at line 5 column 3 file: r.rman

--//如果你看命令输出前面4>,而应该看r.rman文件.实际上错误指向r.rman第5行第3列.如果我修改如下:
$ cat -n r.rman
     1
     2  run
     3  {
     4    allocate channel c1 device type DISK;
     5    allocate channel c2 device type DISK
     6
     7    release channel c1;
     8    release channel c2;
     9  }

RMAN> @ r.rman

RMAN>
RMAN> run
2> {
3>   allocate channel c1 device type DISK;
4>   allocate channel c2 device type DISK
5>
6>   release
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "release": expecting one of: "auxiliary, connect, format, maxopenfiles, maxpiecesize, parms, rate, send, to, ;"
RMAN-01007: at line 7 column 3 file: r.rman

--//总之要看这类错误,应该正确的看脚本文件,而不是输出的行号.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2131645/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969378