Db2 On Premise and Cloud

  • 1.  DMC 3.1.5.1

    Posted 12 days ago
    In this latest release, shell scripts were added to the types of jobs that can be submitted by the job manager

    In Data server manager, the variable ${DSWEB_DATABASE_PROFILENAME} provided the name of the DB2 connection that activated a particular shell script, so that script could determine the calling server, DB2 instance and database name.

    This Variable does not appear to be provided in DMC 3.1.5.1

    Below is a cut down shell script job that was run in Data Server Manager with 2 input connections attached to the job and the resulting log file output

    #!/usr/bin/ksh

    DATE=$(date +"%Y-%m-%d-%H.%M.%S")

    CONNECTION_NAME=${DSWEB_DATABASE_PROFILENAME}

    LOGFILE_DIR=/home/dasusr/logs/

    if [[ ! -e $LOGFILE_DIR ]]
    then
    mkdir $LOGFILE_DIR
    fi

    LOGFILE=${LOGFILE_DIR}${CONNECTION_NAME}.${DATE}

    echo ${CONNECTION_NAME} > ${LOGFILE}

    exit 0

    root@rhlinux1.settersnest.com:/home/dasusr/logs $ cat RHLINUX1_DB2INST1_DB2INST1.2021-10-14-11.20.59
    RHLINUX1_DB2INST1_DB2INST1
    root@rhlinux1.settersnest.com:/home/dasusr/logs $ cat RHLINUX1_DB2INST2_DB2INST2.2021-10-14-11.21.14
    RHLINUX1_DB2INST2_DB2INST2
    root@rhlinux1.settersnest.com:/home/dasusr/logs $

    ------------------------------
    Andrew Finlaison
    ------------------------------