Skip to content

Commit

Permalink
Merge pull request #1180 from ministryofjustice/DBA-826
Browse files Browse the repository at this point in the history
Handle standby database
  • Loading branch information
bill-buchan authored Dec 18, 2024
2 parents 3019b57 + 0662923 commit c24f41b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<TargetCollectionExt EXT_NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" EXT_VERSION="2" TARGET_TYPE="host"><CollectionItem NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" UPLOAD="YES">
<TargetCollectionExt EXT_NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" EXT_VERSION="3" TARGET_TYPE="host"><CollectionItem NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" UPLOAD="YES">
<Schedule>
<IntervalSchedule INTERVAL="15" TIME_UNIT="Min"/>
</Schedule>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<MetricExtensionArchive name="MEAME$MATERIALIZED_VIEW_REFRESH_TIME">
<MetricExtension name="ME$MATERIALIZED_VIEW_REFRESH_TIME" type="host" version="2" is_repos="FALSE" display_name="Time Since Oldest Materialized View Refresh" description="Calculated in Minutes" version_comment=" " metadata_digest="7fdba0582d18a1f457a28e5e55fe306e" coll_digest="e512a32d93873389d91fe9ba77450e53" attach_digest="049b8ec6eeb5c26d4bf997b8524925c5">
<MetricExtension name="ME$MATERIALIZED_VIEW_REFRESH_TIME" type="host" version="3" is_repos="FALSE" display_name="Time Since Oldest Materialized View Refresh" description="Calculated in Minutes" version_comment=" " metadata_digest="7fdba0582d18a1f457a28e5e55fe306e" coll_digest="e512a32d93873389d91fe9ba77450e53" attach_digest="dd076a9f5d3844dd7ead88e125ebe129">
<scripts name="time_since_oldest_mv_refresh.sh">
</scripts>
</MetricExtension>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<TargetMetadataExt EXT_NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" EXT_VERSION="2" TARGET_TYPE="host"><Metric NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" TYPE="TABLE">
<TargetMetadataExt EXT_NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" EXT_VERSION="3" TARGET_TYPE="host"><Metric NAME="ME$MATERIALIZED_VIEW_REFRESH_TIME" TYPE="TABLE">
<Display>
<Label NLSID="NLS_METRIC_hostME$MATERIALIZED_VIEW_REFRESH_TIME">Time Since Oldest Materialized View Refresh</Label>
<Description NLSID="NLS_DESCRIPTION_hostME$MATERIALIZED_VIEW_REFRESH_TIME">Calculated in Minutes</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# Exit without failure if database is not up
srvctl status database -d $ORACLE_SID >/dev/null || exit 0

# Exit without failure if the database is mounted and not open (probably a standby database)
(srvctl status database -d $ORACLE_SID -v | grep -q Mounted) && exit 0

sqlplus -s / as sysdba <<EOSQL
SET ECHO OFF
SET FEEDBACK OFF
Expand Down

0 comments on commit c24f41b

Please sign in to comment.