Skip to content

Commit d94f529

Browse files
committed
use BASE_PATH from start; fix backup size report
1. One bug was introduced recently - did not use BASE_PATH for including subscripts (may not find subscripts if wasn't run from the main script's dir) 2. Another bug fixed - did not report backup size if piece handle size for more than 32 characters.
1 parent 9f4214b commit d94f529

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

rman_backup.ksh

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
# - RMAN catalog and non-cataloged backups are supported.
1313
#
1414

15+
#logs will be in $BASE_PATH/log, generated script in $BASE_PATH/scripts
16+
BASE_PATH=$( cd "$( dirname "$0" )" && pwd )
17+
1518
#Process server-specific parameters first from rman_backup.ksh.vars
1619
#If you need to update any type of the script's behaviour - look there first.
17-
. rman_backup_vars.ksh
20+
. $BASE_PATH/rman_backup_vars.ksh
1821

1922

2023
#------------------------------------------------------------------
@@ -49,7 +52,7 @@ fi
4952
# ******** Functions: ***************
5053

5154
#Load low-level and utility functions rman_backup.ksh.subs:
52-
. rman_backup_subs.ksh
55+
. $BASE_PATH/rman_backup_subs.ksh
5356

5457

5558
#------------------------------------------------------------------

rman_backup_subs.ksh

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function report_backup_size
8888
fi
8989

9090
#2. Query parent (session/rman) row from $RMAN_STATUS for the total backup size.
91-
dosql used_mb "variable handle VARCHAR2(32);
91+
dosql used_mb "variable handle VARCHAR2(120);
9292
begin :handle := '$handle';
9393
end;
9494
/
@@ -114,7 +114,7 @@ end;
114114
function check_best_practices {
115115
dosql ctlf_record_keep_time "select value from v\$parameter where name='control_file_record_keep_time'"
116116
if [ "$ctlf_record_keep_time" -lt $(( $RECOVERY_WINDOW +10 )) ] ; then
117-
echo "WARN: CONTROL_FILE_RECORD_KEEP_TIME init parameter is $ctlf_record_keep_time is too low."
117+
echo "WARN: CONTROL_FILE_RECORD_KEEP_TIME init parameter is $ctlf_record_keep_time. It is too low."
118118
echo "WARN: Recommended value is $(( $RECOVERY_WINDOW +10 )) based on your recovery window and Oracle Note 829755.1."
119119
if [ "$FIX_BEST_PRACTICES" -eq "1" ] ; then
120120
dosql noreturn "ALTER SYSTEM SET CONTROL_FILE_RECORD_KEEP_TIME=$(( $RECOVERY_WINDOW +10 )) scope=BOTH"

rman_backup_vars.ksh

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ BACKUP_DEBUG=0 #one of: 0 or 1 (backup script debug)
2121
ONDISK_LOCATION="/u03/backup" #if BACKUP_TYPE="DISK" then this is used as a backup location
2222
# (only if FRA isn't available; ignored for FRA-enabled databases)
2323

24-
#logs will be in $BASE_PATH/log, generated script in $BASE_PATH/scripts
25-
BASE_PATH=$( cd "$( dirname "$0" )" && pwd )
26-
2724
RETENTION="CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF $RECOVERY_WINDOW DAYS"
2825

2926
if [ $USE_CATALOG = 1 ]; then

0 commit comments

Comments
 (0)