Oracle 7.3 - Oracle 23ai 20+ years of experience Version (Released: )

Oracle initialization script

07 Feb 2017

KeepTool 12.1.3 introduced the ability to determine an Oracle initialization script to run immediately after logging on to Hora. For each database connection, an initialization script can be assiged in the expanded section of the Connect dialog window:

Although you may already have some ideas in mind for using this feature, we’d like to mention two situations in which it might be useful:

  • When connecting using Oracle*Net, national language support variables are set automatically according to Windows environment variables and registry settings of your local machine. When using a direct TCP/IP connection, it’s up to you to initialize variables such as NLS_LANGUAGE or NLS_TERRITORY.
    For your convenience, this can now be automated by placing the initialization in a script.
  • PL/SQL coded business logic or fine grained access rules (virtual private database) may require some initialization that would normally be done by the (web) application after login. To allow testing from within Hora, you need a similar initialization that can be done now by the initialization script.

The following sample script performs an Oracle initialization of some NLS session variables. After that, a PL/SQL block is used to query the logged-in OS user name and pass it to your business logic:

The login script may contain input parameters such as :PARAMETER. Hora queries them before executing the script. If the paramter name equals PASSWORD or starts with ‘_’ the input is hidden as usual for password input.

See how it works!

Explore possibilities of KeepTool.