HomeHelp

Configuration Help

Configuring PuTTY

When this icon appears next to a server name, it can be clicked to connect to that server via ssh. Assuming you already have PuTTY on your computer and have configured it to use SSH keys to automatically log you in, these are the steps needed to hand off the "ssh://" URL to PuTTY when you click on it.

Download KiTTY

KiTTY is a PuTTY fork with the ability to take SSH URLs on the command line. It can be downloaded from http://www.9bis.net/kitty/?page=Download. Save the kitty.exe file in whatever permanent location you think is best. In the example below, we will use "C:\Program Files\KiTTY\kitty.exe"

Registry changes

Download the KiTTY registry file from http://www.9bis.net/kitty/?file=kitty_ssh_handler.reg or save the following into a plain text file. Edit the KiTTY path to match your path if different from the one in this example. Remove any blank lines from the top of the file and any spaces to the left of each line.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"EditFlags"=dword:00000002
"FriendlyTypeName"="@ieframe.dll,-907"
"URL Protocol"=""
"BrowserFlags"=dword:00000008

[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="C:\\Program Files\\KiTTY\\kitty.exe,0"

[HKEY_CLASSES_ROOT\ssh\shell]
@=""

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="\"C:\\Program Files\\KiTTY\\kitty.exe\" %1"

Once the file has been edited, double-click on it to add the entries to your registry. If Windows complains of it not being a valid reg file, your text editor probably did not save it as an ANSI text file.

Restart your browser. When you click on an ssh link for the first time, you may be prompted to confirm that KiTTY is the handler for ssh links.

Configuring SQL*Plus

When this icon appears next to an Oracle database name, it can be clicked to connect to that database via SQL*Plus. The steps for configuring this capability are similar to the steps above, but more extensive depending on how you are accustomed to using SQL*Plus currently. Assuming you have already downloaded and installed an Oracle client and know the path to the SQL*Plus executable, these are the steps to follow.

Eliminate your dependency on "tnsnames.ora"

Your Oracle client needs to be able to connect a database when given a host, port and SID even if the database is not in the tnsnames.ora file. Locate "network/admin/sqlnet.ora" in your ORACLE_HOME and make sure it includes "EZCONNECT" in the NAMES.DIRECTORY_PATH. For example, it may include this line: "NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)".

Make all your Oracle passwords the same

If you want to be able to log in automatically, you will need a script that can be passed an Oracle database identifier and can look up the username and password it needs for that database. The easiest way to do that is to use the same password for every database and to change them all before any one of them is due to expire.

Store all your SQL*Plus scripts in a single directory

When SQL*Plus starts, you will want to have immediate access to your scripts. The directory path in this example is "C:\Home\sql"

Create "conn.sql" in your SQL*Plus script directory

"conn.sql" is a login script which takes the database as a parameter ("&1"). In place of "xy1234/mypassword" below, type your own ID and password.

set define on
set echo off
connect xy1234/mypassword@&1

Optionally, you can add other commands or references to other scripts to be executed every time you log in:

@login
select global_name from global_name;

Create a batch file to read the "orcl" URL and hand off to SQL*Plus

"orcl.bat" takes the URL clicked in the browser, parses it, formats a command window, and hands off the database ID in host:port/SID format to the "conn.sql" script to be run by sqlplus.exe on startup. In this example "orcl.bat" will be stored in "C:\Home". Edit the text below if your sql script path is different from the one in this example. You can also edit the "cols" and "lines" values to change the size of your command window. For help on choosing window colors, type "color /?" at the Windows command line.

set arg=%1
set url=%arg:~7%
cd c:\home\sql
color F1
mode con: cols=140 lines=60
Title "SQL*Plus"
sqlplus.exe /nolog @conn %url%

Registry changes

The final step is to tell Windows to hand off any "orcl://" URL to your batch file. Save the following into a plain text file. Edit the "orcl.bat" path to match your path if different from the one in this example. Remove any blank lines from the top of the file and any spaces to the left of each line.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\orcl]
@="URL:orcl Protocol"
"EditFlags"=dword:00000002
"FriendlyTypeName"="@ieframe.dll,-907"
"URL Protocol"=""
"BrowserFlags"=dword:00000008

[HKEY_CLASSES_ROOT\orcl\shell]
@=""

[HKEY_CLASSES_ROOT\orcl\shell\open]

[HKEY_CLASSES_ROOT\orcl\shell\open\command]
@="\"C:\\Home\\orcl.bat\" %1"

Once the file has been edited, double-click on it to add the entries to your registry. If Windows complains of it not being a valid reg file, your text editor probably did not save it as an ANSI text file.

Restart your browser. When you click on an "orcl://" link for the first time, you may be prompted to confirm that your batch file is the handler for the links.

To enable highlighting of text in the command window for purposes of copying/pasting, see this article: How to Enable Quick Edit Mode in the Command Prompt by Default