Command shortcuts for getting Caché database details
Hi all,
I see command shortcuts for getting journal details, like Status^JOURNAL for displaying the journal status.
And, I'm using the shortcuts in my shell scripts.
I'm not seeing/finding command shortcuts for getting database details.
If anyone have those details, please share with me.
Thanks,
Bharath Nunepalli.
Hi Bharath,
I'm not sure what exactly you're trying to do but trying to invoke a CHUI in a script feels a bit clunky. Perhaps the Config.Journal and Config.Databases APIs would be useful to you.
Also see SYS.Database, which in addition to that class reference link is documented in brief here:
Databases
(Caché & Ensemble 2018.1.3 — 2018.1.4 > Caché Development References > InterSystems Programming Tools Index > Tools Index > Databases)
I use Status^JOURNAL in a shell script like this, to check the journaling status and generate an alert.
#!/bin/ksh
ccontrol list | grep -i running > $DB_STATUS_DET4
if [[ -s $DB_STATUS_DET4 ]] then
csession cache "Status^JOURNAL" > $DB_JRN_DET
cat $DB_JRN_DET | grep -i enabled > $DB_JRN_DET1
if [[ -s $DB_JRN_DET1 ]] then RC=0
else RC=1
fi
else exit
fi
if (( $RC > 0 )) then
echo "Artiva alert: JOURNALING is disabled at $(date +%x_%r)" >> $DB_JRN_MSG
exit $RC
else
exit $RC
fi
I want run a shell script for updating database max size, but not seeing any command shortcuts like Status^JOURNAL for getting database details.