How To Check Rman Syntax

In the following example we will see how to check the syntax of an Rman script. The example is correct so must not return any error.

 racsolnode-2@:/orarac11/anr> rman checksyntax @todo

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Nov 12 19:04:43 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target *
2> connect rcvcat *
3>
4>
5> run {
6>
7>
8>   sql 'alter system checkpoint';
9>
10>   sql 'alter system switch logfile';
11>
12>   shutdown abort;
13>
14>   startup;
15>
16>   shutdown immediate;
17>
18>   startup mount;
19>
20>   resync catalog;
21>
22>          allocate channel t1 type 'SBT_TAPE'
23>          parms 'ENV=(NSR_DATA_VOLUME_POOL=Historic,
24>                                      NSR_CLIENT=racsol.windsort.com,
25>                                      NSR_SERVER=serverbck.yellow.int)';
26>          allocate channel t2 type 'SBT_TAPE'
27>          parms 'ENV=(NSR_DATA_VOLUME_POOL=Historic,
28>                                      NSR_CLIENT=racsol.windsort.com,
29>                                      NSR_SERVER=serverbck.yellow.int)';
30>          allocate channel t3 type 'SBT_TAPE'
31>          parms 'ENV=(NSR_DATA_VOLUME_POOL=Historic,
32>                                      NSR_CLIENT=racsol.windsort.com,
33>                                      NSR_SERVER=serverbck.yellow.int)';
34>          allocate channel t4 type 'SBT_TAPE'
35>          parms 'ENV=(NSR_DATA_VOLUME_POOL=Historic,
36>                                      NSR_CLIENT=racsol.windsort.com,
37>                                      NSR_SERVER=serverbck.yellow.int)';
38>
39>          backup as backupset database format 'dbracsol_%U' TAG=BCK_END_RACSOL keep forever;
40>          backup current controlfile format 'ctracsol_%U' TAG=BCK_END_RACSOL keep forever;
41>
42>
43>
44>          release channel t1;
45>          release channel t2;
46>          release channel t3;
47>          release channel t4;
48>
49>     }
50>
51>
The cmdfile has no syntax errors

Recovery Manager complete.

 
It will return errors like below if the script have any error. We change the line “release channel t2” to “channel t2 relase”. It need a “e” character.

 

 34>          release channel t1;
35>          relase
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": 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-01008: the bad identifier was: relase
RMAN-01007: at line 35 column 10 file: todo

 
HTH – Antonio NAVARRO

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s