本帖最后由 郑全 于 2022-7-8 18:41 编辑
一学员说,SQL /nolog 报错:类似下面这样:
问问SQLPLUS能否执行:
看得出,版本原来是19.14。奇怪了,我19.15都没有这个问题,马上看看我的19.14的环境,原来确实存在这个问题。
查看MOS上,看到改问题再19.14上存在,具体见:SQLcl fails with java.util.ServiceConfigurationError after applying Database Release Update 19.14(Patch 33515361) (Doc ID 2852276.1)
APPLIES TO:Oracle SQLcl - Version 19.1 and later
Information in this document applies to any platform.
SYMPTOMSAfter applying Database Release Update 19.14(Patch 33515361), SQLcl fails with java.util.ServiceConfigurationError : $ sql
Exception in thread "main" java.util.ServiceConfigurationError: oracle.dbtools.extension.SQLCLService: Provider
oracle.dbtools.raptor.scriptrunner.commands.liquibase.liquibaseCommand could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at oracle.dbtools.extension.SQLCLServices.registerServices(SQLCLServices.java:48)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.(SqlCli.java:220)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:441)
Caused by: java.lang.NoClassDefFoundError: liquibase/exception/DatabaseException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
... 5 more
Caused by: java.lang.ClassNotFoundException: liquibase.exception.DatabaseException
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 10 more
Additional information if only jackson-databind.jar is missing, SQLcl fails with the following error: Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
at oracle.dbtools.versions.CheckForUpdates.<clinit>(CheckForUpdates.java:215)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.handleUpdates(SqlCli.java:508)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:464)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ObjectMapper
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 3 more
CHANGES After applying Database Release Update 19.14(Patch 33515361) CAUSERDBMS RU19.14(Patch 33515361) removes the following jar files. $ORACLE_HOME/sqldeveloper/sqldeveloper/lib/ext/liquibase-core.jar
$ORACLE_HOME/sqldeveloper/sqldeveloper/lib/jackson-databind.jar
SOLUTIONPlease restore liquibase-core.jar and jackson-databind.jar files from $ORACLE_HOME/.patch_storage backup files: $ORACLE_HOME/.patch_storage/33515361_Jan_13_2022_06_14_07/files/sqldeveloper/sqldeveloper/lib/ext/liquibase-core.jar $ORACLE_HOME/.patch_storage/33515361_Jan_13_2022_06_14_07/files/sqldeveloper/sqldeveloper/lib/jackson-databind.jar
Restore liquibase-core.jar: $ cd $ORACLE_HOME/.patch_storage/33515361_Jan_13_2022_06_14_07/files/sqldeveloper/sqldeveloper/lib/ext
$ cp liquibase-core.jar $ORACLE_HOME/sqldeveloper/sqldeveloper/lib/ext
Restore jackson-databind.jar: $ cd $ORACLE_HOME/.patch_storage/33515361_Jan_13_2022_06_14_07/files/sqldeveloper/sqldeveloper/lib
$ cp jackson-databind.jar $ORACLE_HOME/sqldeveloper/sqldeveloper/lib
Bug 33872630 has been fixed in SQLcl version 22.1.0.84.1111
看来是19.14 ru把这两个文件拿掉了,解决办法,从其他版本把这两个文件拿回来即可,测试从19.15上拷回这两个文件,可以解决。
[oracle@dbserver][oracle@dbserver]-rw-r--r-- 1 oracle oinstall 4204927 Jul 8 18:20 /u01/app/oracle/product/19.14.0/db_1/sqldeveloper/sqldeveloper/lib/ext/liquibase-core.jar [oracle@dbserver][oracle@dbserver][oracle@dbserver ext]$ [oracle@dbserver][oracle@dbserver]-rw-r--r-- 1 oracle oinstall 369 Jul 8 18:24 /u01/app/oracle/product/19.14.0/db_1/sqldeveloper/sqldeveloper/lib/jackson-databind.jar
[oracle@dbserver ext]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 8 18:27:00 2022
Version 19.14.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
SQL> exit
[oracle@dbserver ext]$
[oracle@dbserver ext]$
[oracle@dbserver ext]$ sql /nolog
SQLcl: Release 19.1 Production on Fri Jul 08 18:27:04 2022
Copyright (c) 1982, 2022, Oracle. All rights reserved.
SQL>
SQL>
SQL> conn / as sysdba
Connected to an idle instance.
|