SQLcl on OTN | Getting Started Video | Downloads | FAQ | Forum |
New Features in 24.1.0
- SQLcl users now have the ability to run tasks in the background.
- There are three new commands related to this:
- background | bg {OPTIONS} <commandspec>
- Run a SQLcl command in the background as a task.
- Ex. background -taskname generate-emps ddl employees
- jobs | jb {SUBCOMMAND} {OPTIONS}
- List and manage the background tasks running.
- Ex. jobs
- 0: [ Running ] generate-em (C:\Users\ztalke\.sqlcl\jobslogs\generateemps.log)
- Ex. jobs logs -id 0
- CREATE TABLE "HR"."EMPLOYEES"
- ( "EMPLOYEE_ID" NUMBER(6,0),
- …
- wait4 | w4 {OPTIONS} {PARAMETERS}
- Wait for one or more background tasks to finish before continuing with processing.
- Ex. wait4 generate-emps -delay 5000
- Color highlighting for keywords and errors in SQLcl are now enabled by default (controlled by set highlighting command).
- Liquibase Functionality in SQLcl
- -overwrite-files parameter added to the Liquibase generate commands. This allows existing files with the same name to be replaced when generating changelogs. Beneficial for automation pipelines.
- -show-summary parameter added to the Liquibase update commands. This produces a list of any changes not applied during an update and why they were skipped.
- There are three levels of detail with this parameter: OFF -> SUMMARY -> VERBOSE
- For Liquibase commands, all parameters that take Boolean values must now be explicitly stated as either true or false if they are referenced in a command. Under the hood, this allows us to better stay in sync with open-source Liquibase parameter changes moving forward.
- Ex. 23.4 Command: liquibase update -output-default-schema
- Ex. 24.1 Command: liquibase update -output-default-schema true
- Listed parameters have been adjusted back to 23.3 definitions to better suit long term consistency (23.3 -> 23.4 -> 24.1).
- -secure-parsing -> -no-secure-parsing -> -secure-parsing
- -runonchange -> -dontrunonchange -> -runonchange
- -runalways -> -dontrunalways -> -runalways
- -skipexportdate -> -keepexportdate -> -skipexportdate
- -exporiginalids -> -dontexporiginalids -> -exporiginalids
- The parameter -fail-on-error now defaults as false.
- The parameter -verbose now defaults as true.
Important Update With Liquibase Files
- For cross-schema use, changelog files generated before SQLcl 23.4 may require regeneration or manual updates. The need for these alterations are only necessary if you are changing schema names between your export and import with these pre 23.4 changelogs.
- If you don’t regenerate your changelogs or make the manual adjustments described below:
- Changelogs containing schema names will only be able to be applied to the schema named in them regardless of provided parameters.
- Changelogs not containing schema names will only be able to be applied to the schema you are currently connected to with SQLcl regardless of provided parameters.
- 23.4 introduced a %USER_NAME% replacement for schema name stored in changesets.
- To manually update your changelogs with the proper %USER_NAME% substitution, there are two types of changes:
- For changelogs with the <SCHEMA></SCHEMA> XML element, replace the content inside with %USER_NAME%
- Example: <SCHEMA>%USER_NAME%</SCHEMA>
- For changelogs that utilize SQL within the CDATA field, attach "%USER_NAME%". to the front of all database object references. If a schema name is in these locations, replace it with "%USER_NAME%".
- Example: <n0:source><![CDATA[CREATE OR REPLACE EDITIONABLE PROCEDURE "%USER_NAME%"."P_SQLCLERROR_PROCEDURE" ...
- Example: <n0:source><![CDATA[ALTER TABLE "%USER_NAME%"."EMPLOYEES" ADD CONSTRAINT "EMP_JOB_FK" FOREIGN KEY ("JOB_ID") REFERENCES "%USER_NAME%"."JOBS" ("JOB_ID") ENABLE;]]></n0:source>
Issues Fixed in 24.1.0
The main bugs of note this release are:
- Can’t connect to database with SQLcl using both -name and @[script] parameters.
- DESCRIBE packages command running slow on larger packages.
- SQLcl ignores JAVA_HOME if JAVA is found in path.
- Liquibase Functionality in SQLcl
- Global parameters not being properly applied to all Liquibase commands.
- Liquibase changelogs cancelled with a substitution error still result with changelog marked as ran in databasechangelog table.
- Liquibase unable to generate tables with foreign key constraints.
- liquibase data command giving data definition language (DDL) XML content instead of data XML.
- Specific supporting objects for Liquibase are not being generated when liquibase update command is ran for the first time in a schema under certain circumstances.
- DATABASECHANGELOG_ACTIONS_PK INDEX
- DATABASECHANGELOG_ACTIONS TABLE
- DATABASECHANGELOG_ACTIONS_TRG TRIGGER
- DATABASECHANGELOG_DETAILS VIEW
- Liquibase error messaging and the output for -debug and -log parameters lacking enough detail in certain circumstances.
- Only one -search-path parameter can be used at a time with Liquibase.
- Index changes not being deployed to target with Liquibase.
- Folders names created with the -split parameter using liquibase generate-schema generated as uppercase instead of lowercase.
- liquibase generate-schema failing at times with error JAVA.SQL.SQL.EXPECTION: ORA-12899: VALUE TOO LARGE FOR COLUMN.
- Liquibase failing with JAVA.SQL.SQLEXCEPTION: ORA-31604: INVALID NAME PARAMETER when using -grants parameter with liquibase generate-schema.
- Liquibase consistency issues with runOracleScript/runApexScript changes of sourceType=File and realtiveToChangelogFile=true.
- Liquibase issue where SQL errors in runoraclescript changesets do not stop liquibase update execution.
- SQLcl Liquibase not outputting open-source Liquibase version info when running.
If your bug fix isn’t listed above, please refer to My Oracle Support to check its status.
Support
You are supported by Oracle Support under your current Oracle Database Support license.
Log Oracle SQLcl bugs and issues using My Oracle Support.
To determine the version of SQLcl run this command: sql -version
Documentation
Documentation on using SQLcl is provided on the oracle.com website here.
Requirements
- Supported Java Version
- Oracle SQLcl requires Java 11 or 17. The supported Java Runtime Environments are:
- Oracle Java 11
- Oracle Java 17
- Oracle GraalVM Enterprise Edition for Java 11
- Oracle GraalVM Enterprise Edition for Java 17
- JavaScript support requires Oracle Java 11 or GraalVM for Java 17 with the JavaScript Runtime Plugin
Restrictions
This section describes the restrictions on use.
ORACLE_HOME usage
When using SQLcl in an ORACLE_HOME, it must be a minimum version of 21c.
Liquibase usage with APEX
Liquibase support for APEX requires APEX version 18 and above.
Feedback
In the forum, you can discuss topics with the SQLcl community around the world and leave feedback for the development team.
Be sure to use clear subject lines to initiate a thread. Provide a complete and clear description of the issue, including steps to reproduce the issue.
Try to avoid using old, unrelated threads for a new issue.