1 Practice: calculate diff of DB time column in shell script 1.1 Practice: check_diff_time.sh oracle@oraclevm01: /monitoring/bin % : more check_diff_time.sh #!/bin/bash lag=$(sqlplus -s TESTUSER/oracle@pstg <<END set pagesize 0 feedback off verify off heading off echo off; select ROUND(TO_NUMBER(cast(target_commit as date)-cast(source_commit as date))*24*60) as lag_time from TESTUSER.HEARTBEAT exit; END ) echo $lag https://unix.stackexchange.com/questions/85180/assigning-the-output-of-a-sql-query-to-variable https://stackoverflow.com/questions/17774405/bash-sql-query-outputs-to-variable […]