- 论坛徽章:
- 0
|
本帖最后由 南极雨 于 2011-07-06 10:27 编辑
回复 7# ly5066113
这个是我的执行的结果(哈哈,oracle好像也挺人性化的,只要有ERROR就会返回1):- [oracle@rhel5-10g ~]$ rman target / <<EOF
- > crosscheck archivelog all;
- > crosscheck aaaa;
- > exit;
- > EOF
- echo $?
- Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jul 6 17:47:09 2011
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
- connected to target database: WNBUS (DBID=1948819613)
- RMAN>
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: sid=138 devtype=DISK
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_02_28/thread_1_seq_2.260.744326287 recid=1 stamp=744326300
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_03_09/thread_1_seq_3.261.745308421 recid=2 stamp=745308433
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_03_15/thread_1_seq_4.264.745884549 recid=3 stamp=745884550
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_03_15/thread_1_seq_5.265.745885039 recid=4 stamp=745885040
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_03_15/thread_1_seq_6.266.745885089 recid=5 stamp=745885089
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_03_21/thread_1_seq_7.267.746392411 recid=6 stamp=746392412
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_01/thread_1_seq_8.268.747336983 recid=7 stamp=747336990
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_02/thread_1_seq_9.269.747423655 recid=8 stamp=747423669
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_11/thread_1_seq_10.270.748151263 recid=9 stamp=748151275
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_11/thread_1_seq_11.271.748220487 recid=10 stamp=748220488
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_12/thread_1_seq_12.272.748288347 recid=11 stamp=748288354
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_13/thread_1_seq_13.273.748370181 recid=12 stamp=748370191
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_18/thread_1_seq_14.274.748802407 recid=13 stamp=748802407
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_04_25/thread_1_seq_15.275.749422207 recid=14 stamp=749422213
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_06_08/thread_1_seq_16.276.753297211 recid=15 stamp=753297222
- validation succeeded for archived log
- archive log filename=+DG2/wnbus/archivelog/2011_07_06/thread_1_seq_17.277.755804785 recid=16 stamp=755804797
- Crosschecked 16 objects
- RMAN>
- 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: "archivelog, backup, backuppiece, backupset, copy, controlfilecopy, datafilecopy, proxy"
- RMAN-01008: the bad identifier was: aaaa
- RMAN-01007: at line 1 column 12 file: standard input
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-00558: error encountered while parsing input commands
- RMAN-01009: syntax error: found ";": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
- RMAN-01007: at line 1 column 16 file: standard input
- RMAN>
- Recovery Manager complete.
- [oracle@rhel5-10g ~]$ echo $?
- 1
- [oracle@rhel5-10g ~]$
复制代码- $Bsstest2/oracle>rman target /
- Recovery Manager: Release 10.2.0.4.0 - Production on Wed Jul 6 10:10:48 2011
- Copyright (c) 1982, 2007, Oracle. All rights reserved.
- connected to target database: TEST (DBID=2048592585)
- RMAN>
- RMAN>
- RMAN>
- RMAN>
- RMAN> crosscheck archivelog all;
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: sid=49 devtype=DISK
- specification does not match any archive log in the recovery catalog
- RMAN> crosscheck aaaa;
- 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: "archivelog, backup, backuppiece, backupset, copy, controlfilecopy, datafilecopy, proxy"
- RMAN-01008: the bad identifier was: aaaa
- RMAN-01007: at line 1 column 12 file: standard input
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-00558: error encountered while parsing input commands
- RMAN-01009: syntax error: found ";": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
- RMAN-01007: at line 1 column 16 file: standard input
- RMAN>
- RMAN>
- RMAN> exit
- Recovery Manager complete.
- $Bsstest2/oracle>echo $?
- 1
复制代码- $Bsstest2/oracle>
- $Bsstest2/oracle>rman target / <<EOF
- > crosscheck archivelog all;
- > exit;
- > EOF
- Recovery Manager: Release 10.2.0.4.0 - Production on Wed Jul 6 10:12:08 2011
- Copyright (c) 1982, 2007, Oracle. All rights reserved.
- connected to target database: TEST (DBID=2048592585)
- RMAN>
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: sid=49 devtype=DISK
- specification does not match any archive log in the recovery catalog
- RMAN>
- Recovery Manager complete.
- $Bsstest2/oracle>echo $?
- 0
- $Bsstest2/oracle>
复制代码 |
|