How to check syntax of rman commands/script?

One can check syntax for RMAN commands without running the RMAN.

Example: Checking syntax of commands on the command line.
$ rman checksyntax

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> backup database;

The command has no syntax errors

RMAN> exit

Example: Checking syntax of commands on the command script.
$ cat backup.txt
connect target /
connect catalog rmancatalog/rmancatlog@catalog

run {
backup database;
}

$ rman checksyntax @backup.txt

Recovery Manager: Release 10.2.0.1.0 – Production on Sun Nov 30 09:31:51 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target *
2> connect catalog *
3>
4> run {
5> backup database;
6> }
7>
The cmdfile has no syntax errors

Recovery Manager complete.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.