Hello experts,
These days I need export a large amount of pure data via CSV by SPOOL command on my Oracle DB 11.2.0.4.0 for Linux x86_64.
Afterwards I heard of this cool tool SQLcl can easily export CSV data, thus I download it from Oracle official website here, SQLcl Downloads (the latest version is 18.1.1 now)
By the way I've preinstalled the JDK 1.8.0_172.
When I deployed it successfully on my database server, nevertheless I didn't connect to Oracle DB via SQLcl 18.1.1.
The following are my some operation steps,
[oracle@oracle-test01 ~]$ sql -V
SQLcl: Release 18.1.1.0 Production
[oracle@oracle-test01 ~]$ java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
[oracle@oracle-test01 ~]$ which java
/usr/java/jdk1.8.0_172-amd64/bin/java
[oracle@oracle-test01 ~]$ sql -H
SQLcl: Release 18.1.1.0 Production
Oracle SQL Developer Command-Line (SQLcl) help
Usage 1: sql -H | -V
-H Displays the SQLcl version and the
usage help.
-V Displays the SQLcl version.
Usage 2: sql [<option>] [{ <logon> | /nolog}] [<start>]
<option> is: [-R <level>] [-S] [-verbose] [-oci] [-L[OGON] ]
-R <level> Sets restricted mode to disable SQLcl commands
that interact with the file system. The level can
be 1, 2, 3 or 4. The most restrictive is -R 4 which
disables all user commands interacting with the
file system.
-S Sets silent mode which suppresses the display of
the SQLcl banner, prompts, and echoing of
commands.
-verbose Set this to show logging messages inline.
By default these messages are suppressed.
-nohistory Switch off history logging.
-noupdates Do not check update site for newer versions available.
-oci Set this to use an Oracle Instant Client installation.
If this option is set, then SQLcl will use the drivers
from the first Installation on the path.
-L[OGON] Specifies not to reprompt for username or password
if the initial connection does not succeed.
<logon> is: {<username>[/<password>][@<connect_identifier>] | / }
[AS {SYSDBA | SYSOPER | SYSASM}]
Specifies the database account username, password and connect
identifier for the database connection. Without a connect
identifier, SQLcl connects to the default database.
The AS SYSDBA, AS SYSOPER and AS SYSASM options are database
administration privileges.
<connect_identifier> can be in the form of Net Service Name
or Easy Connect.
@[<net_service_name> | [//]Host[:Port]/<service_name>]
<net_service_name> is a simple name for a service that resolves
to a connect descriptor.
Example: Connect to database using Net Service Name and the
database net service name is ORCL.
sql myusername/mypassword@ORCL
Host specifies the host name or IP address of the database
server computer.
Port specifies the listening port on the database server.
<service_name> specifies the service name of the database you
want to access.
Example: Connect to database using Easy Connect and the
Service name is ORCL.
sql myusername/mypassword@Host/ORCL
The /NOLOG option starts SQLcl without connecting to a
database.
<start> is: @<URL>|<filename>[.<ext>] [<parameter> ...]
Runs the specified SQLcl script from a web server (URL) or the
local file system (filename.ext) with specified parameters that
will be assigned to substitution variables in the script.
When SQLcl starts, and after CONNECT commands, the site profile
(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
(e.g. login.sql in the working directory) are run. The files may
contain SQLcl commands.
Refer to the SQLDeveloper User's Guide and Reference for more information.
[oracle@oracle-test01 ~]$ sql /nolog
SQLcl: Release 18.1.1 Production on Fri Jun 01 17:32:14 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved.
@> conn test
Password? (**********?) ********
USER = test
URL = jdbc:oracle:oci8:@
Error Message = Could not initialize class oracle.jdbc.OracleDriver
USER = test
URL = jdbc:oracle:thin:@127.0.0.1:1521:test
Error Message = Could not initialize class oracle.jdbc.OracleDriver
USER = test
URL = jdbc:oracle:thin:@localhost:1521/test
Error Message = Could not initialize class oracle.jdbc.OracleDriver
USER = test
URL = jdbc:oracle:thin:@localhost:1521/xe
Error Message = Could not initialize class oracle.jdbc.OracleDriver
Jun 01, 2018 5:32:26 PM oracle.dbtools.raptor.newscriptrunner.ScriptExecutor run
SEVERE: oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.setLanguage(NLSLANGListener.java:86)
java.lang.NullPointerException
at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.setLanguage(NLSLANGListener.java:86)
at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.runOnConnect(NLSLANGListener.java:52)
at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.endEvent(NLSLANGListener.java:102)
at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireEndListeners(CommandRegistry.java:564)
at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:297)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:342)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:225)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.process(SqlCli.java:398)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:409)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.startSQLPlus(SqlCli.java:1235)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:485)
@>
Could you help me solve this issue? Thanks a lot hope to hear from you.
Best Regards
Quanwen Zhao