Tuesday, April 12, 2016

"list backup" command can not be in a RUN command block

Ha, just learned.

RCATT:/software/orarman/ops/exec> cat t.rman
run {
list backup summary;
}


RMAN> @t.rman

RMAN> run {
2> 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, analyze, associate statistics, audit, backup, begin, @, call, catalog, change, comment, commit, configure, convert, copy, create, crosscheck, declare, delete, delete from, describe, describe catalog, disassociate statistics, drop, drop database, duplicate, execute, explain plan, flashback, flashback table, grant, host, insert, lock, merge, mount, noaudit, open, purge, recover, release, rename, repair, report, restore, resync, revoke, rollback, savepoint, select, send, set, set constraint, set role, set transaction, show, shutdown, sql, startup, switch, transport, "
RMAN-01007: at line 2 column 1 file: t.rman

RMAN> exit


Recovery Manager complete.



Remove it out of {}



RCATT:/software/orarman/ops/exec> cat t.rman
list backup summary;

RCATT:/software/orarman/ops/exec> rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Apr 12 15:27:52 2016

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

connected to target database: RCATT (DBID=4101766741)

RMAN> @t.rman

RMAN> list backup summary;
using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
133     B  F  A DISK        2016-APR-12 10:06:04 1       1       YES        TAG20160412T100602
134     B  F  A DISK        2016-APR-12 10:07:02 1       1       YES        TAG20160412T100602
135     B  F  A DISK        2016-APR-12 10:07:10 1       1       YES        TAG20160412T100602
136     B  F  A DISK        2016-APR-12 10:07:45 1       1       YES        TAG20160412T100602
137     B  F  A DISK        2016-APR-12 10:07:48 1       1       YES        TAG20160412T100602
138     B  F  A DISK        2016-APR-12 10:08:02 1       1       YES        TAG20160412T100602