I have been trying to implement .sh file which opens the RMAN promt and shows the backup summary of last database backups.
Script
[apex@idmhost ~]$ cat b1.sh
ls
rman target / catalog rman/rman123@apexdb
list backup summary;
Output
sh b1.sh
0 db.rsp Music script_bkp.sh Templates
apache.env Desktop Pictures scripts test
apexdb.env Documents Public sendattatch.py Videos
b1.sh Downloads rman_backup.sh Softwares
Recovery Manager: Release 12.1.0.2.0 - Production on Thu Feb 7 12:50:06 2019
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: APEXDB (DBID=2757487913)
connected to recovery catalog database
RMAN>
As you can see It's executing that linux command & connecting to RMAN as well. But the third one is not getting executed. Where is it stuck?
ORACLE_BASE=/opt/ora/app/oracle; export ORACLE_BASE;
ORACLE_HOME=/opt/ora/app/oracle/product/11.2.0/dbhome_1; export ORACLE_HOME;
NLS_LANG=american_america.cl8mswin1251; export NLS_LANG;
ORACLE_OWNER=oracle; export ORACLE_OWNER;
ORACLE_SID=elbrus; export ORACLE_SID;
$ORACLE_HOME/bin/rman target / nocatalog <<EOF
list backup summary;
EOF
oracle@krw-sql-elbrus-2 scripts]$ ./list_backups.sh
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Feb 7 11:16:10 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ELBRUS (DBID=1050971541)
using target database control file instead of recovery catalog
RMAN>
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
3931 B A A DISK 2019-02-07 07:31:29 1 1 NO FULL_ARCHIVELOGS_BACKUP
3932 B F A DISK 2019-02-07 07:36:38 1 1 NO FULL_DATABASE_BACKUP
3933 B F A DISK 2019-02-07 07:36:45 1 1 NO FULL_DATABASE_BACKUP
3934 B A A DISK 2019-02-07 07:36:47 1 1 NO FULL_ARCHIVELOGS_BACKUP
RMAN>
Recovery Manager complete.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.