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.
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.
Create a file called "tnsnames.ora" in same directory as "sqlplus.exe" looking like this:
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:
Double click on sqlplus.exe and enter your username/password@instance like this:
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: