This blog contains experience gained over the years of implementing (and de-implementing) large scale IT applications/software.

Script Korn Shell to use Bold Output

Here’s how you can use a normal Korn shell script to put out bold text on the screen providing the emulator you are using supports it:

#!/bin/ksh
$ bold=`tput smso`
$ regular=`tput rmso`

$ echo "${bold}Please type in your name: c"
$ echo "${regular}OK"

See the man page for tput for a wild array of other capabilities.
It’s possible you can even use tput to draw in different parts of the screen.
This could be used to create a drop-down box or a menu select box in KSH.
It can be done!  Honest!

Windows Batch File to Install Windows Task

@cls
@rem ######################################################################
@rem # Script:  install_task.bat
@rem # Params:  none.
@rem # Desc:    This script installs the task that will run the
@rem #           start.bat on the required schedule.  WinXP or Win2k3
@rem # Author:  D.Griffiths
@rem # Version: 1.0
@rem # History:
@rem #          09-June-2008 – DMG – Created.
@rem #
@rem ######################################################################

@set TN=My_TaskName
@set DAYS=MON,TUE,WED,THU,FRI,SAT
@set TR=C:start.bat
@set ST=05:50:00

@set /P conf=Press return to install task “%TN%”:

@echo Tasks currently scheduled…
@schtasks /Query /FO TABLE

@echo.
@echo Removing existing task if already present…
@schtasks /Delete /TN %TN% /F

@echo.
@echo Installing new task “%TN%”…
@schtasks /Create /RU SYSTEM /SC WEEKLY /D %DAYS% /TN %TN% /TR %TR% /ST %ST%
@IF ERRORLEVEL 1 goto invalid_task

@echo.
@echo Task “%TN%” now scheduled.
@echo.
@echo Tasks currently scheduled…
@schtasks /Query /FO TABLE
@echo.
@echo.
@set /P conf=Press return to exit.
@exit

:invalid_task
@echo.
@echo.
@echo ERROR: There was a problem installing the task.
@echo ERROR: Please try again or check the command syntax.
@set /P conf=Press return to exit.

Flushing Cursor SQL Plan Out of Library Cache

I can never remember how to do this.

I wanted to flush a specific SQL execution plan out of the Oracle 11g SQL Library Cache so that I could try and compare a before and after SQL execution scenario using SQL trace and then tkprof’ing it.
Here’s the link to the blog that helped me remember again:

https://prutser.wordpress.com/2009/04/19/flushing-a-cursor-out-of-the-library-cache/


Thanks.