SQL Plus Instant Client

As a functional consultant you’re often asked to run a SQL*Plus script from Oracle Support however these scripts does not always behave well with SQL Developer.

So instead you can use a little tool called SQL Plus Instant Client.

Installation

You need to download:

  • Instant Client Package – Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
  • Instant Client Package – SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client

Unpack the two zip files in same directory like: C:\instantclient

By experience do not use a directory and path with spaces as this may cause problems.

Connection Names

Create a file called "tnsnames.ora" in same directory as "sqlplus.exe" looking like this:

VIS=
    (DESCRIPTION=
        (ADDRESS=
            (PROTOCOL=tcp)
            (HOST=hpserverdb.kentw.com)
            (PORT=1521)
        )
        (CONNECT_DATA=
            (SERVICE_NAME=VIS)
            (INSTANCE_NAME=VIS)
        )
    )

You can have multiple entries in this file if you have more than one instance.

If you do not have a dnsserver or a hosts file then you can use the ip address instead of the hostname like:

HOST=192.168.1.110

Using

Double click on sqlplus.exe and enter your username/password@instance like this:

image

Running SQL Scripts

To run a script you need to put the script(s) in the same directory as sqlplus.exe and if the script is called "test.sql" type this:

image

This entry was written by Kent Willumsen , posted on Friday February 01 2013at 03:02 pm , filed under SQL, Technical Knowledge and tagged . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Comments are closed.