您的位置:首页 > 科技 > IT业 > 升级Oracle SQLcl

升级Oracle SQLcl

2024/12/22 23:33:50 来源:https://blog.csdn.net/stevensxiao/article/details/139627895  浏览:    关键词:升级Oracle SQLcl

当前版本为19.1,这是安装数据库19.3时自带的:

[oracle@oracle-19c-vagrant ~]$ sql -V
SQLcl: Release 19.1.0.0 Production[oracle@oracle-19c-vagrant ~]$ which sql
/opt/oracle/product/19c/dbhome_1/bin/sql

从官网 可知最新版本为:24.1 。

文件大小65M:

[oracle@oracle-19c-vagrant ~]$ ls -lh sqlcl-latest.zip
-rwxr-xr-x. 1 oracle oinstall 65M Jun 12 15:25 sqlcl-latest.zip[oracle@oracle-19c-vagrant ~]$ unzip -l sqlcl-latest.zip
Archive:  sqlcl-latest.zipLength      Date    Time    Name
---------  ---------- -----   ----0  03-27-2024 09:30   sqlcl/0  03-27-2024 09:29   sqlcl/bin/0  03-27-2024 09:31   sqlcl/lib/0  03-27-2024 09:31   sqlcl/lib/ext/192  03-27-2024 09:31   sqlcl/NOTICES.txt210835  03-27-2024 09:29   sqlcl/lib/osdt_cert.jar216  03-27-2024 09:31   sqlcl/LICENSE.txt387421  03-27-2024 09:30   sqlcl/lib/jdbcrest.jar348  03-27-2024 09:31   sqlcl/THIRD-PARTY-LICENSES.txt307824  03-27-2024 09:29   sqlcl/lib/oraclepki.jar44  03-27-2024 09:30   sqlcl/24.1.0.087.0929312754  03-27-2024 09:29   sqlcl/lib/osdt_core.jar152  03-27-2024 09:30   sqlcl/bin/version.txt1664684  03-27-2024 09:29   sqlcl/lib/orai18n.jar3198  03-27-2024 09:30   sqlcl/bin/dependencies.txt507645  03-27-2024 09:29   sqlcl/lib/orai18n-utility.jar29816  03-27-2024 09:29   sqlcl/bin/sql51573  03-27-2024 09:30   sqlcl/lib/sshd-contrib.jar180288  03-27-2024 09:30   sqlcl/bin/sql.exe10011  03-27-2024 09:29   sqlcl/lib/pom.xml90454  03-27-2024 09:29   sqlcl/lib/orai18n-mapping.jar195968  03-27-2024 09:31   sqlcl/lib/ext/dbtools-cpat.jar737786  03-27-2024 09:31   sqlcl/lib/ext/cpat.jar93226  03-27-2024 09:31   sqlcl/lib/ext/dbtools-apex.jar632267  03-27-2024 09:31   sqlcl/lib/ext/commons-lang3-3.13.0.jar240285  03-27-2024 09:31   sqlcl/lib/ext/opencsv-5.9.jar334130  03-27-2024 09:31   sqlcl/lib/ext/snakeyaml-2.0.jar565904  03-27-2024 09:31   sqlcl/lib/ext/dbtools-liquibase.jar2758206  03-27-2024 09:31   sqlcl/lib/ext/liquibase-core.jar84408  03-27-2024 09:31   sqlcl/lib/ext/dbtools-dg.jar148050  03-27-2024 09:31   sqlcl/lib/ext/dbtools-aq.jar57826  03-27-2024 09:31   sqlcl/lib/ext/dbtools-blockchain.jar45249  03-27-2024 09:31   sqlcl/lib/ext/dbtools-modeler-cli-ext.jar28961  03-27-2024 09:30   sqlcl/lib/sshd-putty.jar6300296  03-27-2024 09:31   sqlcl/lib/ext/dbtools-modeler-common.jar43329  03-27-2024 09:30   sqlcl/lib/ext/dbtools-jobs.jar45041  03-27-2024 09:31   sqlcl/lib/ext/dbtools-copy.jar859077  03-27-2024 09:30   sqlcl/lib/dbtools-sqlcl.jar1948954  03-27-2024 09:29   sqlcl/lib/xmlparserv2_sans_jaxp_services.jar173630  03-27-2024 09:30   sqlcl/lib/antlr-runtime.jar326305  03-27-2024 09:30   sqlcl/lib/antlr4-runtime.jar48710  03-27-2024 09:30   sqlcl/lib/jakarta.json-api.jar123995  03-27-2024 09:30   sqlcl/lib/parsson.jar189214  03-27-2024 09:29   sqlcl/lib/dbtools-core.jar5248167  03-27-2024 09:29   sqlcl/lib/ojdbc11.jar265864  03-27-2024 09:29   sqlcl/lib/xdb.jar109319  03-27-2024 09:30   sqlcl/lib/sqlcl-jline.jar994664  03-27-2024 09:30   sqlcl/lib/jline.jar258307  03-27-2024 09:30   sqlcl/lib/jansi.jar345398  03-27-2024 09:30   sqlcl/lib/dbtools-net.jar52328  03-27-2024 09:30   sqlcl/lib/dbtools-oci.jar94290  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-common-httpclient-jersey3.jar56430  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-common-httpclient.jar63108  03-27-2024 09:29   sqlcl/lib/slf4j-api.jar138565  03-27-2024 09:29   sqlcl/lib/jakarta.ws.rs-api.jar26141  03-27-2024 09:29   sqlcl/lib/jakarta.annotation-api.jar1204842  03-27-2024 09:29   sqlcl/lib/jersey-common.jar10760  03-27-2024 09:29   sqlcl/lib/jakarta.inject-api.jar19465  03-27-2024 09:29   sqlcl/lib/osgi-resource-locator.jar267454  03-27-2024 09:29   sqlcl/lib/jersey-client.jar80130  03-27-2024 09:29   sqlcl/lib/jersey-media-json-jackson.jar84046  03-27-2024 09:29   sqlcl/lib/jersey-entity-filtering.jar31649  03-27-2024 09:29   sqlcl/lib/jackson-module-jakarta-xmlbind-annotations.jar62154  03-27-2024 09:29   sqlcl/lib/jakarta.activation.jar128943  03-27-2024 09:29   sqlcl/lib/jakarta.xml.bind-api.jar78984  03-27-2024 09:29   sqlcl/lib/jersey-hk2.jar203950  03-27-2024 09:29   sqlcl/lib/hk2-locator.jar27129  03-27-2024 09:29   sqlcl/lib/aopalliance-repackaged.jar201467  03-27-2024 09:29   sqlcl/lib/hk2-api.jar131796  03-27-2024 09:29   sqlcl/lib/hk2-utils.jar783517  03-27-2024 09:29   sqlcl/lib/javassist.jar46515  03-27-2024 09:29   sqlcl/lib/jersey-apache-connector.jar782072  03-27-2024 09:29   sqlcl/lib/httpclient.jar328842  03-27-2024 09:29   sqlcl/lib/httpcore.jar125238  03-27-2024 09:29   sqlcl/lib/jackson-datatype-jsr310.jar441459  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-common.jar78455  03-27-2024 09:29   sqlcl/lib/jackson-annotations.jar1691474  03-27-2024 09:29   sqlcl/lib/jackson-databind.jar1120300  03-27-2024 09:29   sqlcl/lib/bcpkix-jdk15to18.jar6532993  03-27-2024 09:29   sqlcl/lib/bcprov-jdk15to18.jar682154  03-27-2024 09:29   sqlcl/lib/bcutil-jdk15to18.jar58110  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-circuitbreaker.jar75861  03-27-2024 09:29   sqlcl/lib/resilience4j-circuitbreaker.jar897876  03-27-2024 09:29   sqlcl/lib/vavr.jar3039  03-27-2024 09:29   sqlcl/lib/vavr-match.jar65754  03-27-2024 09:29   sqlcl/lib/resilience4j-core.jar106188  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-secrets.jar1962775  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-identity.jar5874528  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-database.jar134013  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-workrequests.jar308437  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-bastion.jar787445  03-27-2024 09:29   sqlcl/lib/oci-java-sdk-databasetools.jar1815021  03-27-2024 09:29   sqlcl/lib/sshd-osgi.jar63138  03-27-2024 09:29   sqlcl/lib/eddsa.jar10345  03-27-2024 09:29   sqlcl/lib/slf4j-jdk14.jar21141  03-27-2024 09:29   sqlcl/lib/jcl-over-slf4j.jar10048041  03-27-2024 09:30   sqlcl/lib/dbtools-common.jar3042100  03-27-2024 09:30   sqlcl/lib/guava-with-lf.jar253919  03-27-2024 09:30   sqlcl/lib/ST4.jar1340629  03-27-2024 09:30   sqlcl/lib/assertj-core.jar577585  03-27-2024 09:30   sqlcl/lib/jackson-core.jar98604  03-27-2024 09:30   sqlcl/lib/jackson-jr-objects.jar29062  03-27-2024 09:30   sqlcl/lib/jackson-jr-stree.jar559773  03-27-2024 09:30   sqlcl/lib/orajsoda.jar84166  03-27-2024 09:30   sqlcl/lib/dbtools-http.jar861741  03-27-2024 09:30   sqlcl/lib/httpclient5.jar855013  03-27-2024 09:30   sqlcl/lib/httpcore5.jar237145  03-27-2024 09:30   sqlcl/lib/httpcore5-h2.jar511572  03-27-2024 09:30   sqlcl/lib/low-level-api.jar375634  03-27-2024 09:30   sqlcl/lib/sshd-sftp.jar117908  03-27-2024 09:30   sqlcl/lib/sshd-scp.jar501728  03-27-2024 09:30   sqlcl/lib/dbtools-data.jar248032  03-27-2024 09:30   sqlcl/lib/dbtools-datapump.jar43329  03-27-2024 09:30   sqlcl/lib/dbtools-jobs.jar
---------                     -------74506293                     114 files

可以通过解压以上的包安装,也可以使用yum安装:

[oracle@oracle-19c-vagrant ~]$ yum search sqlcl
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
========================================================= N/S matched: sqlcl ==========================================================
sqlcl.noarch : Oracle SQL Developer Command Line (SQLcl)Name and summary matches only, use "search all" for everything.
[oracle@oracle-19c-vagrant ~]$ sudo yum install sqlcl
ol7_UEKR6                                                                                                       | 3.0 kB  00:00:00
ol7_addons                                                                                                      | 3.0 kB  00:00:00
ol7_developer                                                                                                   | 3.0 kB  00:00:00
ol7_developer_EPEL                                                                                              | 3.6 kB  00:00:00
ol7_latest                                                                                                      | 3.6 kB  00:00:00
ol7_optional_latest                                                                                             | 3.0 kB  00:00:00
ol7_software_collections                                                                                        | 3.0 kB  00:00:00
yum.oracle.com_repo_OracleLinux_OL7_oracle_software_x86_64                                                      | 2.9 kB  00:00:00
(1/14): ol7_addons/x86_64/primary_db                                                                            | 281 kB  00:00:00
(2/14): ol7_developer/x86_64/updateinfo                                                                         | 338 kB  00:00:00
(3/14): ol7_addons/x86_64/updateinfo                                                                            | 171 kB  00:00:00
(4/14): ol7_developer_EPEL/x86_64/updateinfo                                                                    | 1.3 MB  00:00:00
(5/14): ol7_developer/x86_64/primary_db                                                                         | 1.3 MB  00:00:00
(6/14): ol7_UEKR6/x86_64/updateinfo                                                                             | 1.2 MB  00:00:01
(7/14): ol7_latest/x86_64/updateinfo                                                                            | 3.6 MB  00:00:00
(8/14): ol7_optional_latest/x86_64/updateinfo                                                                   | 1.5 MB  00:00:00
(9/14): ol7_software_collections/x86_64/updateinfo                                                              | 8.9 kB  00:00:00
(10/14): ol7_optional_latest/x86_64/primary_db                                                                  | 6.4 MB  00:00:00
(11/14): ol7_software_collections/x86_64/primary_db                                                             | 6.2 MB  00:00:00
(12/14): ol7_developer_EPEL/x86_64/primary_db                                                                   |  18 MB  00:00:03
(13/14): ol7_latest/x86_64/primary_db                                                                           |  52 MB  00:00:06
(14/14): ol7_UEKR6/x86_64/primary_db                                                                            |  75 MB  00:00:11
Resolving Dependencies
--> Running transaction check
---> Package sqlcl.noarch 0:24.1.0-1.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved=======================================================================================================================================Package         Arch             Version                   Repository                                                            Size
=======================================================================================================================================
Installing:sqlcl           noarch           24.1.0-1.el7              yum.oracle.com_repo_OracleLinux_OL7_oracle_software_x86_64            63 MTransaction Summary
=======================================================================================================================================
Install  1 PackageTotal download size: 63 M
Installed size: 70 M
Is this ok [y/d/N]: y
Downloading packages:
sqlcl-24.1.0-1.el7.noarch.rpm                                                                                   |  63 MB  00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : sqlcl-24.1.0-1.el7.noarch                                                                                           1/1Verifying  : sqlcl-24.1.0-1.el7.noarch                                                                                           1/1Installed:sqlcl.noarch 0:24.1.0-1.el7Complete!

不过新的sqlcl提示需要JDK或以上:

[oracle@oracle-19c-vagrant ~]$ sql -VWarning: Found incompatible $ORACLE_HOME for database version 19Thick driver unavailable for use.Error: SQLcl requires Java 11 and above to run.Found Java version 8.Please set JAVA_HOME to appropriate version.

好在之前装了一个open JDK 11,设置JAVA_HOME就可以了:

[oracle@oracle-19c-vagrant ~]$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.23.0.9-2.0.1.el7_9.x86_64/[oracle@oracle-19c-vagrant ~]$ sql -VWarning: Found incompatible $ORACLE_HOME for database version 19Thick driver unavailable for use.SQLcl: Release 24.1.0.0 Production Build: 24.1.0.087.0929

下面这个警告每次都会出现,以后再处理,目前看不影响:

Warning: Found incompatible $ORACLE_HOME for database version 19Thick driver unavailable for use.

新版本功能更多,特别是在自动完成方面:

SQL> show version
Oracle SQLDeveloper Command-Line (SQLcl) version: 24.1.0.0 build: 24.1.0.087.0929
SQL> help
For help on a topic type help <topic>
List of Help topics available:
/                  @                  @@                 ACCEPT             ALIAS              APEX               APPEND
AQ                 ARBORI             ARCHIVE_LOG        ARGUMENT           BACKGROUND         BLOCKCHAIN_TABLE   BREAK
BRIDGE             BTITLE             CD                 CERTIFICATE        CHANGE             CLEAR              CLOUDSTORAGE
CODESCAN           COLUMN             COMPUTE            CONNECT            CONNMGR            COPY               CS
CTAS               DATAPUMP           DBCCRED            DDL                DEFINE             DEL                DESCRIBE
DG                 DISCONNECT         EDIT               EXECUTE            EXIT               FILES              FIND
FORMAT             GET                HISTORY            HOST               IMMUTABLE_TABLE    INFORMATION        INPUT
JOBS               LIQUIBASE          LIST               LOAD               MIGRATEADVISOR     MODELER            NET
OCI                OCIDBMETRICS       OERR               ORAPKI             PASSWORD           PAUSE              PRINT
PROMPT             QUIT               REMARK             REPEAT             RESERVED_WORDS     REST               RUN
SAVE               SCRIPT             SECRET             SET                SHOW               SHUTDOWN           SODA
SPOOL              SSHTUNNEL          START              STARTUP            STORE              TIMING             TNSPING
TOSUB              TTITLE             UNDEFINE           UNLOAD             VARIABLE           VAULT              WAIT4
WHENEVER           WHICH              XQUERY

参考

  • https://stackoverflow.com/questions/69832026/sqlcl-fails-to-run-scripts-even-with-oracle-jdk-8-installed
  • https://docs.oracle.com/en/database/oracle/sql-developer-command-line/23.2/sqcug/working-sqlcl.html

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com