oracle® sqlcl user's guide · generate the master control file3-32. capture and deploy a...

121
Oracle® SQLcl User's Guide Release 20.2 F31717-04 August 2020

Upload: others

Post on 16-Jul-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Oracle® SQLclUser's Guide

Release 20.2F31717-04August 2020

Page 2: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Oracle SQLcl User's Guide, Release 20.2

F31717-04

Copyright © 2019, 2020, Oracle and/or its affiliates.

Primary Author: Celin Cherian

Contributing Authors: Tulika Das

Contributors: Syme Kutz, Jeff D. Smith

This software and related documentation are provided under a license agreement containing restrictions onuse and disclosure and are protected by intellectual property laws. Except as expressly permitted in yourlicense agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverseengineering, disassembly, or decompilation of this software, unless required by law for interoperability, isprohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. Ifyou find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it onbehalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software,any programs embedded, installed or activated on delivered hardware, and modifications of such programs)and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Governmentend users are "commercial computer software" or "commercial computer software documentation" pursuantto the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such,the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works,and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programsembedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oraclecomputer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in thelicense contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloudservices are defined by the applicable contract for such services. No other rights are granted to the U.S.Government.

This software or hardware is developed for general use in a variety of information management applications.It is not developed or intended for use in any inherently dangerous applications, including applications thatmay create a risk of personal injury. If you use this software or hardware in dangerous applications, then youshall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure itssafe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of thissoftware or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks oftheir respective owners.

Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks areused under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc,and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registeredtrademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products,and services from third parties. Oracle Corporation and its affiliates are not responsible for and expresslydisclaim all warranties of any kind with respect to third-party content, products, and services unless otherwiseset forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will notbe responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,products, or services, except as set forth in an applicable agreement between you and Oracle.

Page 3: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Contents

Preface

Audience v

Documentation Accessibility v

Conventions v

Third-Party License Information v

1 Changes in Release 20.2 for Oracle SQLcl User's Guide

2 Using Oracle SQLcl

2.1 Alphabetic List of SQLcl Commands 2-1

2.2 List of Unsupported SQL*Plus Commands and Features 2-4

2.3 Starting and Leaving SQLcl 2-4

2.4 Starting Up and Shutting Down a Database 2-5

2.5 Entering and Executing Commands 2-6

2.6 Manipulating SQL, SQLcl, and PL/SQL Commands 2-7

2.7 Formatting Query Results 2-10

2.8 Accessing Databases 2-14

2.9 Miscellaneous Commands 2-15

2.9.1 REST 2-17

2.9.2 SODA 2-17

2.9.3 SET system_variable value 2-18

2.9.4 SHOW option 2-20

3 Liquibase Support in SQLcl

3.1 About Liquibase in SQLcl 3-1

3.2 Requirements for Using Liquibase 3-2

3.3 Supported Types 3-2

3.4 Supported Liquibase Commands in SQLcl 3-4

3.4.1 LB GENOBJECT 3-5

3.4.2 LB GENSCHEMA 3-9

iii

Page 4: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3.4.3 LB GENCONTROLFILE 3-11

3.4.4 LB UPDATE 3-11

3.4.5 LB UPDATESQL 3-12

3.4.6 LB ROLLBACK 3-15

3.4.7 LB ROLLBACKSQL 3-16

3.4.8 LB DIFF 3-18

3.4.9 LB DBDOC 3-22

3.4.10 LB CHANGELOGSYNC 3-23

3.4.11 LB CLEARCHECKSUMS 3-24

3.4.12 LB LISTLOCKS 3-24

3.4.13 LB RELEASELOCKS 3-25

3.4.14 LB STATUS 3-25

3.4.15 LB VALIDATE 3-26

3.4.16 LB VERSION 3-26

3.4.17 LB HELP 3-26

3.5 DATABASECHANGELOG_DETAILS VIEW 3-27

3.6 ChangeSets in Liquibase 3-28

3.7 Examples Using Liquibase 3-29

3.7.1 Capture and Deploy an Object 3-29

3.7.2 Capture and Deploy a Schema 3-30

3.7.3 Generate the Master Control File 3-32

3.7.4 Capture and Deploy a Schema and then Upgrade it and Redeploy 3-32

3.7.5 Execute Custom SQL with RunOracleScript 3-36

4 PGQL Plug-in for SQLcl

4.1 Downloading and Installing 4-1

4.2 About PGQL Commands 4-1

4.3 Examples 4-2

iv

Page 5: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Preface

This guide provides usage information about Oracle SQLcl (SQL Developer CommandLine), a Java-based command-line interface for Oracle Database.

AudienceThis guide is intended for those using Oracle SQLcl.

Documentation AccessibilityFor information about Oracle's commitment to accessibility, visit the OracleAccessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic supportthrough My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.

ConventionsThe following text conventions are used in this document:

Convention Meaning

boldface Boldface type indicates graphical user interface elements associatedwith an action, or terms defined in text or the glossary.

italic Italic type indicates book titles, emphasis, or placeholder variables forwhich you supply particular values.

monospace Monospace type indicates commands within a paragraph, URLs, codein examples, text that appears on the screen, or text that you enter.

Third-Party License InformationOracle SQLcl contains third-party code. Oracle is required to provide the followingnotices. Note, however, that the Oracle program license that accompanied this productdetermines your right to use the Oracle program, including the third-party software,and the terms contained in the following notices do not change those rights.

v

Page 6: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Apache Commons Codec 1.14Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

Preface

vi

Page 7: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be under

Preface

vii

Page 8: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

the terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

COPYRIGHT NOTICE =============

Apache Commons Codec Copyright 2002-2019 The Apache Software Foundation

Preface

viii

Page 9: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).

src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java containstest data from http://aspell.net/test/orig/batch0.tab. Copyright (C) 2002 Kevin Atkinson([email protected])

===============================================================================

The content of package org.apache.commons.codec.language.bm has beentranslated from the original php source code available at http://stevemorse.org/phoneticinfo.htm with permission from the original authors. Original source copyright:Copyright (c) 2008 Alexander Beider & Stephen P. Morse.

Apache Commons Logging 1.2Copyright 2003-2007

The Apache Software Foundation

This product includes software developed by The Apache Software Foundation (http://www.apache.org/).

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

Preface

ix

Page 10: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attribution

Preface

x

Page 11: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

notices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

Preface

xi

Page 12: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License.

Oracle must give recipients a copy of this license (doc)

Apache httpmimeApache HttpClient Mime

Copyright 1999-2019 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).

From the license file

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

Preface

xii

Page 13: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

Preface

xiii

Page 14: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all other

Preface

xiv

Page 15: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

commercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS

--------------------------4th-party dependencies------------------------ ApacheHttpComponents Client Copyright 1999-2018 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/)

Apache Mina SSHD 2.4.0========

Apache MINA SSHD

Copyright 2008-2019 The Apache Software Foundation

This product includes software developed at

The Apache Software Foundation (http://www.apache.org/).

Please refer to each LICENSE.

.txt file for the license terms of the components that Apache MINA depends on.

Message logging is provided by the SLF4J library package, which is open sourcesoftware, written by Ceki Gülcü, and copyright by SLF4J.ORG and QOS.ch. Theoriginal software is available from

http://www.slf4j.org/

**************************************

LICENSE.TXT

========

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

Preface

xv

Page 16: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaim

Preface

xvi

Page 17: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

in a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

Preface

xvii

Page 18: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License.

*******************************************************

Below are 4th party dependencies. (Some are optional)

@@@@@@@@@@@@@@@@@@@@@@@@

bouncycastle v1.60 (optional)

================

Copyright (c) 2000 - 2017 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)

Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal in theSoftware without restriction, including without limitation the rights to use, copy, modify,merge, publish, distribute, sublicense, and/or sell copies of the Software, and to

Preface

xviii

Page 19: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

permit persons to whom the Software is furnished to do so, subject to the followingconditions:

The above copyright notice and this permission notice shall be included in all copies orsubstantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANYKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THEWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSEAND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.

@@@@@@@@@@@@@@@@@@@@@@@@

slf4j, v1.7.25,

===========

Copyright (c) 2004-2017 QOS.ch All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal in theSoftware without restriction, including without limitation the rights to use, copy, modify,merge, publish, distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject to the followingconditions:

The above copyright notice and this permission notice shall be included in all copies orsubstantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANYKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THEWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSEAND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.

@@@@@@@@@@@@@@@@@@@@@@@

tomcat-apr, v5.5.23 (optional)

Apache Tomcat

Copyright 1999-2012 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License

Preface

xix

Page 20: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

HttpComponents Http Client 4.5.12Apache httpclient 4.5.10

COPYRIGHT: Copyright 1999-2019 The Apache Software Foundation

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excluding

Preface

xx

Page 21: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

communication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

Preface

xxi

Page 22: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

=========================================================================

This project includes Public Suffix List copied from /publicsuffix.org/list/effective_tld_names.dat> licensed under the terms of the Mozilla Public License, v.2.0

Full license text: /mozilla.org/MPL/2.0/>

Mozilla Public License Version 2.0

==================================

1. Definitions

--------------

Preface

xxii

Page 23: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

1.1. "Contributor" means each individual or legal entity that creates, contributes to thecreation of, or owns Covered Software.

1.2. "Contributor Version" means the combination of the Contributions of others (if any)used by a Contributor and that particular Contributor's Contribution.

1.3. "Contribution" means Covered Software of a particular Contributor.

1.4. "Covered Software" means Source Code Form to which the initial Contributor hasattached the notice in Exhibit A, the Executable Form of such Source Code Form, andModifications of such Source Code Form, in each case including portions thereof.

1.5. "Incompatible With Secondary Licenses" means

(a) that the initial Contributor has attached the notice described in Exhibit B to theCovered Software; or

(b) that the Covered Software was made available under the terms of version 1.1 orearlier of the License, but not also under the terms of a Secondary License.

1.6. "Executable Form" means any form of the work other than Source Code Form.

1.7. "Larger Work" means a work that combines Covered Software with other material,in a separate file or files, that is not Covered Software.

1.8. "License" means this document.

1.9. "Licensable" means having the right to grant, to the maximum extent possible,whether at the time of the initial grant or subsequently, any and all of the rightsconveyed by this License.

1.10. "Modifications" means any of the following: (a) any file in Source Code Formthat results from an addition to, deletion from, or modification of the contents ofCovered Software; or (b) any new file in Source Code Form that contains any CoveredSoftware.

1.11. "Patent Claims" of a Contributor means any patent claim(s), including withoutlimitation, method, process, and apparatus claims, in any patent Licensable bysuch Contributor that would be infringed, but for the grant of the License, by themaking, using, selling, offering for sale, having made, import, or transfer of either itsContributions or its Contributor Version.

1.12. "Secondary License" means either the GNU General Public License, Version 2.0,the GNU Lesser General Public License, Version 2.1, the GNU Affero General PublicLicense, Version 3.0, or any later versions of those licenses.

1.13. "Source Code Form" means the form of the work preferred for makingmodifications.

1.14. "You" (or "Your") means an individual or a legal entity exercising rights under thisLicense. For legal entities, "You" includes any entity that controls, is controlled by, or isunder common control with You. For purposes of this definition, "control" means

(a) the power, direct or indirect, to cause the direction or management of such entity,whether by contract or otherwise, or

(b) ownership of more than fifty percent (50%) of the outstanding shares or beneficialownership of such entity.

2. License Grants and Conditions

Preface

xxiii

Page 24: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

--------------------------------

2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:

(a) under intellectual property rights (other than patent or trademark) Licensableby such Contributor to use, reproduce, make available, modify, display, perform,distribute, and otherwise exploit its Contributions, either on an unmodified basis, withModifications, or as part of a Larger Work; and

(b) under Patent Claims of such Contributor to make, use, sell, offer for sale, havemade, import, and otherwise transfer either its Contributions or its Contributor Version.

2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contributionbecome effective for each Contribution on the date the Contributor first distributes suchContribution.

2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the onlyrights granted under this License. No additional rights or licenses will be implied fromthe distribution or licensing of Covered Software under this License. NotwithstandingSection 2.1(b) above, no patent license is granted by a Contributor: (a) for any codethat a Contributor has removed from Covered Software; or (b) for infringementscaused by: (i) Your and any other third party's modifications of Covered Software,or (ii) the combination of its Contributions with other software (except as part of itsContributor Version); or (c) under Patent Claims infringed by Covered Software in theabsence of its Contributions. This License does not grant any rights in the trademarks,service marks, or logos of any Contributor (except as may be necessary to complywith the notice requirements in Section 3.4).

2.4. Subsequent Licenses No Contributor makes additional grants as a result of Yourchoice to distribute the Covered Software under a subsequent version of this License(see Section 10.2) or under the terms of a Secondary License (if permitted under theterms of Section 3.3).

2.5. Representation Each Contributor represents that the Contributor believes itsContributions are its original creation(s) or it has sufficient rights to grant the rightsto its Contributions conveyed by this License.

2.6. Fair Use This License is not intended to limit any rights You have under applicablecopyright doctrines of fair use, fair dealing, or other equivalents.

2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted inSection 2.1.

3. Responsibilities

-------------------

3.1. Distribution of Source Form All distribution of Covered Software in Source CodeForm, including any Modifications that You create or to which You contribute, must beunder the terms of this License. You must inform recipients that the Source Code Formof the Covered Software is governed by the terms of this License, and how they canobtain a copy of this License. You may not attempt to alter or restrict the recipients'rights in the Source Code Form.

3.2. Distribution of Executable Form If You distribute Covered Software in ExecutableForm then:

(a) such Covered Software must also be made available in Source Code Form, asdescribed in Section 3.1, and You must inform recipients of the Executable Form how

Preface

xxiv

Page 25: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

they can obtain a copy of such Source Code Form by reasonable means in a timelymanner, at a charge no more than the cost of distribution to the recipient; and

(b) You may distribute such Executable Form under the terms of this License, orsublicense it under different terms, provided that the license for the Executable Formdoes not attempt to limit or alter the recipients' rights in the Source Code Form underthis License.

3.3. Distribution of a Larger Work You may create and distribute a Larger Workunder terms of Your choice, provided that You also comply with the requirementsof this License for the Covered Software. If the Larger Work is a combination ofCovered Software with a work governed by one or more Secondary Licenses, andthe Covered Software is not Incompatible With Secondary Licenses, this Licensepermits You to additionally distribute such Covered Software under the terms of suchSecondary License(s), so that the recipient of the Larger Work may, at their option,further distribute the Covered Software under the terms of either this License or suchSecondary License(s).

3.4. Notices You may not remove or alter the substance of any license notices(including copyright notices, patent notices, disclaimers of warranty, or limitations ofliability) contained within the Source Code Form of the Covered Software, except thatYou may alter any license notices to the extent required to remedy known factualinaccuracies.

3.5. Application of Additional Terms You may choose to offer, and to charge a feefor, warranty, support, indemnity or liability obligations to one or more recipients ofCovered Software. However, You may do so only on Your own behalf, and not onbehalf of any Contributor. You must make it absolutely clear that any such warranty,support, indemnity, or liability obligation is offered by You alone, and You hereby agreeto indemnify every Contributor for any liability incurred by such Contributor as a resultof warranty, support, indemnity or liability terms You offer. You may include additionaldisclaimers of warranty and limitations of liability specific to any jurisdiction.

4. Inability to Comply Due to Statute or Regulation

---------------------------------------------------

If it is impossible for You to comply with any of the terms of this License with respectto some or all of the Covered Software due to statute, judicial order, or regulation thenYou must: (a) comply with the terms of this License to the maximum extent possible;and (b) describe the limitations and the code they affect. Such description must beplaced in a text file included with all distributions of the Covered Software under thisLicense. Except to the extent prohibited by statute or regulation, such description mustbe sufficiently detailed for a recipient of ordinary skill to be able to understand it.

5. Termination

--------------

5.1. The rights granted under this License will terminate automatically if You fail tocomply with any of its terms. However, if You become compliant, then the rightsgranted under this License from a particular Contributor are reinstated

(a) provisionally, unless and until such Contributor explicitly and finally terminates Yourgrants, and

(b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance bysome reasonable means prior to 60 days after You have come back into compliance.Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis

Preface

xxv

Page 26: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

if such Contributor notifies You of the non-compliance by some reasonable means, thisis the first time You have received notice of non-compliance with this License fromsuch Contributor, and You become compliant prior to 30 days after Your receipt of thenotice.

5.2. If You initiate litigation against any entity by asserting a patent infringement claim(excluding declaratory judgment actions, counter-claims, and cross-claims) allegingthat a Contributor Version directly or indirectly infringes any patent, then the rightsgranted to You by any and all Contributors for the Covered Software under Section 2.1of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user licenseagreements (excluding distributors and resellers) which have been validly grantedby You or Your distributors under this License prior to termination shall survivetermination.

************************************************************************ * * *

6. Disclaimer of Warranty *

* ------------------------- * *

Covered Software is provided under this License on an "as is" * * basis, withoutwarranty of any kind, either expressed, implied, or * * statutory, including, withoutlimitation, warranties that the * * Covered Software is free of defects, merchantable, fitfor a * * particular purpose or non-infringing. The entire risk as to the * * quality andperformance of the Covered Software is with You. * * Should any Covered Softwareprove defective in any respect, You * * (not any Contributor) assume the cost of anynecessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an* * essential part of this License. No use of any Covered Software is * * authorizedunder this License except under this disclaimer.

* * * ************************************************************************************************************************************************ * * *

7. Limitation of Liability

* * -------------------------- * * * *

Under no circumstances and under no legal theory, whether tort (includingnegligence), contract, or otherwise, shall any Contributor, or anyone who distributesCovered Software as permitted above, be liable to You for any direct, indirect,special, incidental, or consequential damages of any character including, withoutlimitation, damages for lost profits, loss of goodwill, work stoppage, computer failureor malfunction, or any and all other commercial damages or losses, even if suchparty shall have been informed of the possibility of such damages. This limitation ofliability shall not apply to liability for death or personal injury resulting from such party'snegligence to the extent applicable law prohibits such limitation. Some jurisdictions donot allow the exclusion or limitation of incidental or consequential damages, so thisexclusion and limitation may not apply to You.

* * * ************************************************************************

8. Litigation

-------------

Any litigation relating to this License may be brought only in the courts of a jurisdictionwhere the defendant maintains its principal place of business and such litigationshall be governed by laws of that jurisdiction, without reference to its conflict-of-law

Preface

xxvi

Page 27: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

provisions. Nothing in this Section shall prevent a party's ability to bring cross-claimsor counter-claims.

9. Miscellaneous

----------------

This License represents the complete agreement concerning the subject matterhereof. If any provision of this License is held to be unenforceable, such provisionshall be reformed only to the extent necessary to make it enforceable. Any law orregulation which provides that the language of a contract shall be construed againstthe drafter shall not be used to construe this License against a Contributor.

10. Versions of the License

---------------------------

10.1. New Versions Mozilla Foundation is the license steward. Except as provided inSection 10.3, no one other than the license steward has the right to modify or publishnew versions of this License. Each version will be given a distinguishing versionnumber.

10.2. Effect of New Versions You may distribute the Covered Software under theterms of the version of the License under which You originally received the CoveredSoftware, or under the terms of any subsequent version published by the licensesteward.

10.3. Modified Versions If you create software not governed by this License, and youwant to create a new license for such software, you may create and use a modifiedversion of this License if you rename the license and remove any references to thename of the license steward (except to note that such modified license differs from thisLicense).

10.4. Distributing Source Code Form that is Incompatible With Secondary LicensesIf You choose to distribute Source Code Form that is Incompatible With SecondaryLicenses under the terms of this version of the License, the notice described in ExhibitB of this License must be attached.

Exhibit A - Source Code Form License Notice

-------------------------------------------

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular file, then You mayinclude the notice in a location (such as a LICENSE file in a relevant directory) wherea recipient would be likely to look for such a notice. You may add additional accuratenotices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice

---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as defined by theMozilla Public License, v. 2.0.

==============================================

4P Dependencies:

Preface

xxvii

Page 28: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

commons-codec » commons-codec 1.11

COPYRIGHT: Copyright 2002-2014

The Apache Software Foundation LICENSE: Apache 2.0 https://github.com/apache/commons-codec/blob/1.10/LICENSE.txt

---

commons-logging » commons-logging 1.2

COPYRIGHT: Copyright 2003-2014

The Apache Software Foundation LICENSE: Apache 2.0 https://github.com/apache/commons-logging/blob/LOGGING_1_2/LICENSE.txt

---

org.apache.httpcomponents » httpcore 4.4.11

COPYRIGHT: Copyright 2005-2019 The Apache Software Foundation

LICENSE: Apache 2.0 https://github.com/apache/httpcomponents-core/blob/4.4.11/LICENSE.txt

==============================================

Updated 4P Dependency:

commons-codec » commons-codec 1.11

COPYRIGHT: Copyright 2002-2014 The Apache Software Foundation

LICENSE: Apache 2.0 https://github.com/apache/commons-codec/blob/commons-codec-1.11/LICENSE.txt

HttpCore 4.4.13Apache HttpComponents Core 4.4.10

COPYRIGHT: Copyright 2005-2018 The Apache Software Foundation

LICENSE: Apache 2.0

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)

Preface

xxviii

Page 29: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

Preface

xxix

Page 30: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, or

Preface

xxx

Page 31: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

consequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

jackson-annotations 2.10.3Jackson Annotations

Copyright (c) 2019 Tatu Saloranta

LICENSE: Apache 2.0

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

Preface

xxxi

Page 32: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attribution

Preface

xxxii

Page 33: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

notices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

Preface

xxxiii

Page 34: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License

jackson-core 2.10.3Jackson Core

Copyright (c) 2019 Tatu Saloranta

LICENSE: Apache 2.0

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

Preface

xxxiv

Page 35: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

Preface

xxxv

Page 36: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

Preface

xxxvi

Page 37: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License

jackson-databind 2.10.3Jackson Databind

Copyright (c) 2019 Tatu Saloranta

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

Preface

xxxvii

Page 38: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

Preface

xxxviii

Page 39: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, or

Preface

xxxix

Page 40: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

consequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

COPYRIGHT NOTICE # Jackson JSON processor

Jackson is a high-performance, Free/Open Source JSON processing library. Itwas originally written by Tatu Saloranta ([email protected]), and has been indevelopment since 2007. It is currently developed by a community of developers, aswell as supported commercially by FasterXML.com.

-----------------jackson-core 2.10.0 ----------------------- COPYRIGHT: Copyright (c) 2007-Tatu Saloranta, [email protected] LICENSE: Apache 2.0

## Credits

A list of contributors may be found from CREDITS file, which is includedin some artifacts (usually source distributions); but is always available fromthe source code management (SCM) system project uses. -----------------jackson-annotations 2.10.0 ----------------------- COPYRIGHT: Copyright (c) 2007- Tatu Saloranta,[email protected] LICENSE: Apache 2.0

jackson-jr-objects 2.10.3This copy of Jackson JSON processor streaming parser/generator is licensed underthe Apache (Software) License, version 2.0 ("the License"). See the License for detailsabout distribution rights, and the specific rights regarding derivate works.

You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

jLine 2.14.6Copyright (c) 2002-2016, the original author or authors.

All rights reserved.

http://www.opensource.org/licenses/bsd-license.php

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.

Preface

xl

Page 41: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Redistributions in binary form must reproduce the above copyright notice, this list ofconditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.

Neither the name of JLine nor the names of its contributors may be used to endorse orpromote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.

jansi 1.12 Apache 2.0

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,

Preface

xli

Page 42: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within a

Preface

xlii

Page 43: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

NOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

Preface

xliii

Page 44: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License

Launch4j 3.12Launch4j (http://launch4j.sourceforge.net/) Cross-platform Java application wrapper forcreating Windows native executables.

Copyright (c) 2004, 2017 Grzegorz Kowal All rights reserved.

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this listof conditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may beused to endorse or promote products derived from this software without specific priorwritten permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.

=================== 4th party dependency ===================com.jgoodies, BSD license,

Copyright (c) 2009-2014 JGoodies Software GmbH. All rights reserved.

Preface

xliv

Page 45: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:

o Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.

o Redistributions in binary form must reproduce the above copyright notice, this listof conditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.

o Neither the name of JGoodies Software GmbH nor the names of its contributors maybe used to endorse or promote products derived from this software without specificprior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.

+++++++++++++++++++++ xstream, v1.4.8, BSD Copyright (c) 2003-2006, JoeWalnes Copyright (c) 2006-2015, XStream Committers All rights reserved.

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met: Redistributions of sourcecode must retain the above copyright notice, this list of conditions and the followingdisclaimer. Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentation and/or othermaterials provided with the distribution. Neither the name of XStream nor the namesof its contributors may be used to endorse or promote products derived from thissoftware without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.

++++++++++++++++ commons-beanutils, v1.7.0, Apache 2.0

Apache Commons BeanUtils

Preface

xlv

Page 46: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Copyright 2000-2016 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).

++++++++++++++++

commons-logging, v1.2, Apache 2.0

Apache Commons Logging

Copyright 2003-2014 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).

+++++++++++++++++

foxtrot, v2.0, BSD

LICENSE

Copyright 2014 Flipkart Internet Pvt. Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use thisfile except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

+++++++++++++++++++

Liquibase 3.8.9Liquidbase version 3.6.3 Copyright © 2016 Liquibase.org. All rights reserved. Licensedunder the Apache License v. 2.0

Apache License Version 2.0January 2004http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and distributionas defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright ownerthat is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities thatcontrol, are controlled by, or are under common control with that entity. For thepurposes of this definition, "control" means (i) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (ii)ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficialownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising permissionsgranted by this License.

"Source" form shall mean the preferred form for making modifications, including butnot limited to software source code, documentation source, and configuration files.

Preface

xlvi

Page 47: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

"Object" form shall mean any form resulting from mechanical transformation ortranslation of a Source form, including but not limited to compiled object code,generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, madeavailable under the License, as indicated by a copyright notice that is included in orattached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that isbased on (or derived from) the Work and for which the editorial revisions, annotations,elaborations, or other modifications represent, as a whole, an original work ofauthorship. For the purposes of this License, Derivative Works shall not include worksthat remain separable from, or merely link (or bind by name) to the interfaces of, theWork and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version of theWork and any modifications or additions to that Work or Derivative Works thereof,that is intentionally submitted to Licensor for inclusion in the Work by the copyrightowner or by an individual or Legal Entity authorized to submit on behalf of thecopyright owner. For the purposes of this definition, "submitted" means any form ofelectronic, verbal, or written communication sent to the Licensor or its representatives,including but not limited to communication on electronic mailing lists, source codecontrol systems, and issue tracking systems that are managed by, or on behalf of,the Licensor for the purpose of discussing and improving the Work, but excludingcommunication that is conspicuously marked or otherwise designated in writing by thecopyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whoma Contribution has been received by Licensor and subsequently incorporated withinthe Work.

2. Grant of Copyright License. Subject to the terms and conditions of this License,each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare DerivativeWorks of, publicly display, publicly perform, sublicense, and distribute the Work andsuch Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of this License, eachContributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,royalty-free, irrevocable (except as stated in this section) patent license to make,have made, use, offer to sell, sell, import, and otherwise transfer the Work, wheresuch license applies only to those patent claims licensable by such Contributor thatare necessarily infringed by their Contribution(s) alone or by combination of theirContribution(s) with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including a cross-claim or counterclaimin a lawsuit) alleging that the Work or a Contribution incorporated within the Workconstitutes direct or contributory patent infringement, then any patent licenses grantedto You under this License for that Work shall terminate as of the date such litigation isfiled.

4. Redistribution. You may reproduce and distribute copies of the Work or DerivativeWorks thereof in any medium, with or without modifications, and in Source or Objectform, provided that You meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works a copy of thisLicense; and

Preface

xlvii

Page 48: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

(b) You must cause any modified files to carry prominent notices stating that Youchanged the files; and

(c) You must retain, in the Source form of any Derivative Works that You distribute, allcopyright, patent, trademark, and attribution notices from the Source form of the Work,excluding those notices that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its distribution, then anyDerivative Works that You distribute must include a readable copy of the attributionnotices contained within such NOTICE file, excluding those notices that do not pertainto any part of the Derivative Works, in at least one of the following places: within aNOTICE text file distributed as part of the Derivative Works; within the Source formor documentation, if provided along with the Derivative Works; or, within a displaygenerated by the Derivative Works, if and wherever such third-party notices normallyappear. The contents of the NOTICE file are for informational purposes only and donot modify the License. You may add Your own attribution notices within DerivativeWorks that You distribute, alongside or as an addendum to the NOTICE text fromthe Work, provided that such additional attribution notices cannot be construed asmodifying the License.

You may add Your own copyright statement to Your modifications and may provideadditional or different license terms and conditions for use, reproduction, or distributionof Your modifications, or for any such Derivative Works as a whole, provided Youruse, reproduction, and distribution of the Work otherwise complies with the conditionsstated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise, any Contributionintentionally submitted for inclusion in the Work by You to the Licensor shall be underthe terms and conditions of this License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modify the terms of anyseparate license agreement you may have executed with Licensor regarding suchContributions.

6. Trademarks. This License does not grant permission to use the trade names,trademarks, service marks, or product names of the Licensor, except as required forreasonable and customary use in describing the origin of the Work and reproducingthe content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,Licensor provides the Work (and each Contributor provides its Contributions) on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied, including, without limitation, any warranties or conditions of TITLE,NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULARPURPOSE. You are solely responsible for determining the appropriateness of usingor redistributing the Work and assume any risks associated with Your exercise ofpermissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort(including negligence), contract, or otherwise, unless required by applicable law (suchas deliberate and grossly negligent acts) or agreed to in writing, shall any Contributorbe liable to You for damages, including any direct, indirect, special, incidental, orconsequential damages of any character arising as a result of this License or out ofthe use or inability to use the Work (including but not limited to damages for lossof goodwill, work stoppage, computer failure or malfunction, or any and all othercommercial damages or losses), even if such Contributor has been advised of thepossibility of such damages.

Preface

xlviii

Page 49: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

9. Accepting Warranty or Additional Liability. While redistributing the Work or DerivativeWorks thereof, You may choose to offer, and charge a fee for, acceptance of support,warranty, indemnity, or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act only on Your own behalfand on Your sole responsibility, not on behalf of any other Contributor, and only ifYou agree to indemnify, defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reason of your acceptingany such warranty or additional liability.

END OF TERMS AND CONDITIONS APPENDIX

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, withthe fields enclosed by brackets "[]" replaced with your own identifying information.(Don't include the brackets!) The text should be enclosed in the appropriate commentsyntax for the file format. We also recommend that a file or class name and descriptionof purpose be included on the same "printed page" as the copyright notice for easieridentification within third-party archives.

Copyright [yyyy] [name of copyright owner] Licensed under the Apache License,Version 2.0 (the "License"); you may not use this file except in compliance with theLicense. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed underthe License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License.

=====================================

LIST OF 30 FOURTH-PARTY DEPENDENCIES===========================================================================

Code Generation Library (cglib:cglib-nodep:2.2.2 - http://cglib.sourceforge.net/)

Commons CLI (commons-cli:commons-cli:1.2 - http://commons.apache.org/cli/)

Logging (commons-logging:commons-logging:1.1 - http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/)

ant-antunit (org.apache.ant:ant-antunit:1.3 - no url defined)

AssertJ fluent assertions (org.assertj:assertj-core:1.5.0 - http://nexus.sonatype.org/oss-repository-hosting.html/assertj-parent-pom/assertj-core)

Groovy (org.codehaus.groovy:groovy-all:2.3.10 - http://groovy.codehaus.org/)

Objenesis (org.objenesis:objenesis:1.2 - http://objenesis.googlecode.com/svn/docs/index.html)

osgi.core (org.osgi:org.osgi.core:4.3.1 - http://www.osgi.org)

powermock-api-mockito (org.powermock:powermock-api-mockito:1.5.6 - http://www.powermock.org/powermock-api/powermock-api-mockito)

powermock-api-support (org.powermock:powermock-api-support:1.5.6 - http://www.powermock.org/powermock-api/powermock-api-support)

Preface

xlix

Page 50: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

powermock-core (org.powermock:powermock-core:1.5.6 - http://www.powermock.org)

powermock-module-junit4 (org.powermock:powermock-module-junit4:1.5.6 - http://www.powermock.org)

powermock-module-junit4-common (org.powermock:powermock-module-junit4-common:1.5.6 - http://www.powermock.org/powermock-modules/powermock-module-junit4-common)

powermock-reflect (org.powermock:powermock-reflect:1.5.6 - http://www.powermock.org/powermock-reflect)

Spock Framework - Core Module (org.spockframework:spock-core:1.0-groovy-2.3 -http://spockframework.org)

Spring Framework (org.springframework:spring:2.0.6 - http://www.springframework.org)

SnakeYAML (org.yaml:snakeyaml:1.17 - http://www.snakeyaml.org)

avalon-framework (avalon-framework:avalon-framework:4.1.3 - no url defined)

log4j (log4j:log4j:1.2.12 - no url defined)

org.apache.tools.ant (org.apache.ant:ant:1.7.1 - http://ant.apache.org/ant/)

ant-launcher (org.apache.ant:ant-launcher:1.7.1 - http://ant.apache.org/ant-launcher/)

(Apache Software License Version 2.0) SEE FULL TEXT ABOVE

===========================================================================

servlet-api (javax.servlet:servlet-api:2.4 - no url defined)

(CDDL + GPLv2 with classpath exception)

----------------CDDL v1.1 + GPL v2.0 LICENSE FULL TEXT --------------------------

COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL - Version 1.1)

1. Definitions.

1.1. "Contributor" means each individual or entity that creates or contributes to thecreation of Modifications.

1.2. "Contributor Version" means the combination of the Original Software, priorModifications used by a Contributor (if any), and the Modifications made by thatparticular Contributor.

1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c)the combination of files containing Original Software with files containing Modifications,in each case including portions thereof.

1.4. "Executable" means the Covered Software in any form other than Source Code.

1.5. "Initial Developer" means the individual or entity that first makes Original Softwareavailable under this License.

1.6. "Larger Work" means a work which combines Covered Software or portionsthereof with code not governed by the terms of this License.

1.7. "License" means this document.

Preface

l

Page 51: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

1.8. "Licensable" means having the right to grant, to the maximum extent possible,whether at the time of the initial grant or subsequently acquired, any and all of therights conveyed herein.

1.9. "Modifications" means the Source Code and Executable form of any of thefollowing: A. Any file that results from an addition to, deletion from or modificationof the contents of a file containing Original Software or previous Modifications; B. Anynew file that contains any part of the Original Software or previous Modification; or C.Any new file that is contributed or otherwise made available under the terms of thisLicense.

1.10. "Original Software" means the Source Code and Executable form of computersoftware code that is originally released under this License.

1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired,including without limitation, method, process, and apparatus claims, in any patentLicensable by grantor.

1.12. "Source Code" means (a) the common form of computer software code in whichmodifications are made and (b) associated documentation included in or with suchcode.

1.13. "You" (or "Your") means an individual or a legal entity exercising rights under,and complying with all of the terms of, this License. For legal entities, "You" includesany entity which controls, is controlled by, or is under common control with You. Forpurposes of this definition, "control" means (a) the power, direct or indirect, to causethe direction or management of such entity, whether by contract or otherwise, or (b)ownership of more than fifty percent (50%) of the outstanding shares or beneficialownership of such entity.

2. License Grants.

2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section3.1 below and subject to third party intellectual property claims, the Initial Developerhereby grants You a world-wide, royalty-free, non-exclusive license:

(a) under intellectual property rights (other than patent or trademark) Licensable byInitial Developer, to use, reproduce, modify, display, perform, sublicense and distributethe Original Software (or portions thereof), with or without Modifications, and/or as partof a Larger Work; and

(b) under Patent Claims infringed by the making, using or selling of Original Software,to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose ofthe Original Software (or portions thereof).

(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date InitialDeveloper first distributes or otherwise makes the Original Software available to a thirdparty under the terms of this License.

(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for codethat You delete from the Original Software, or (2) for infringements caused by: (i) themodification of the Original Software, or (ii) the combination of the Original Softwarewith other software or devices.

2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1 below andsubject to third party intellectual property claims, each Contributor hereby grants You aworld-wide, royalty-free, non-exclusive license:

Preface

li

Page 52: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

(a) under intellectual property rights (other than patent or trademark) Licensable byContributor to use, reproduce, modify, display, perform, sublicense and distributethe Modifications created by such Contributor (or portions thereof), either on anunmodified basis, with other Modifications, as Covered Software and/or as part ofa Larger Work; and

(b) under Patent Claims infringed by the making, using, or selling of Modificationsmade by that Contributor either alone and/or in combination with its ContributorVersion (or portions of such combination), to make, use, sell, offer for sale, have made,and/or otherwise dispose of: (1) Modifications made by that Contributor (or portionsthereof); and (2) the combination of Modifications made by that Contributor with itsContributor Version (or portions of such combination).

(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the dateContributor first distributes or otherwise makes the Modifications available to a thirdparty.

(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for anycode that Contributor has deleted from the Contributor Version; (2) for infringementscaused by: (i) third party modifications of Contributor Version, or (ii) the combinationof Modifications made by that Contributor with other software (except as part of theContributor Version) or other devices; or (3) under Patent Claims infringed by CoveredSoftware in the absence of Modifications made by that Contributor.

3. Distribution Obligations.

3.1. Availability of Source Code. Any Covered Software that You distribute orotherwise make available in Executable form must also be made available in SourceCode form and that Source Code form must be distributed only under the terms of thisLicense. You must include a copy of this License with every copy of the Source Codeform of the Covered Software You distribute or otherwise make available. You mustinform recipients of any such Covered Software in Executable form as to how theycan obtain such Covered Software in Source Code form in a reasonable manner on orthrough a medium customarily used for software exchange.

3.2. Modifications. The Modifications that You create or to which You contributeare governed by the terms of this License. You represent that You believe YourModifications are Your original creation(s) and/or You have sufficient rights to grantthe rights conveyed by this License.

3.3. Required Notices. You must include a notice in each of Your Modifications thatidentifies You as the Contributor of the Modification. You may not remove or alter anycopyright, patent or trademark notices contained within the Covered Software, or anynotices of licensing or any descriptive text giving attribution to any Contributor or theInitial Developer.

3.4. Application of Additional Terms. You may not offer or impose any terms on anyCovered Software in Source Code form that alters or restricts the applicable version ofthis License or the recipients' rights hereunder. You may choose to offer, and to chargea fee for, warranty, support, indemnity or liability obligations to one or more recipientsof Covered Software. However, you may do so only on Your own behalf, and not onbehalf of the Initial Developer or any Contributor. You must make it absolutely clearthat any such warranty, support, indemnity or liability obligation is offered by You alone,and You hereby agree to indemnify the Initial Developer and every Contributor for anyliability incurred by the Initial Developer or such Contributor as a result of warranty,support, indemnity or liability terms You offer.

Preface

lii

Page 53: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3.5. Distribution of Executable Versions. You may distribute the Executable form of theCovered Software under the terms of this License or under the terms of a license ofYour choice, which may contain terms different from this License, provided that Youare in compliance with the terms of this License and that the license for the Executableform does not attempt to limit or alter the recipient's rights in the Source Code formfrom the rights set forth in this License. If You distribute the Covered Software inExecutable form under a different license, You must make it absolutely clear thatany terms which differ from this License are offered by You alone, not by the InitialDeveloper or Contributor. You hereby agree to indemnify the Initial Developer andevery Contributor for any liability incurred by the Initial Developer or such Contributoras a result of any such terms You offer.

3.6. Larger Works. You may create a Larger Work by combining Covered Softwarewith other code not governed by the terms of this License and distribute the LargerWork as a single product. In such a case, You must make sure the requirements of thisLicense are fulfilled for the Covered Software.

4. Versions of the License.

4.1. New Versions. Oracle is the initial license steward and may publish revisedand/or new versions of this License from time to time. Each version will be given adistinguishing version number. Except as provided in Section 4.3, no one other thanthe license steward has the right to modify this License.

4.2. Effect of New Versions. You may always continue to use, distribute or otherwisemake the Covered Software available under the terms of the version of the Licenseunder which You originally received the Covered Software. If the Initial Developerincludes a notice in the Original Software prohibiting it from being distributed orotherwise made available under any subsequent version of the License, You mustdistribute and make the Covered Software available under the terms of the version ofthe License under which You originally received the Covered Software. Otherwise, Youmay also choose to use, distribute or otherwise make the Covered Software availableunder the terms of any subsequent version of the License published by the licensesteward.

4.3. Modified Versions. When You are an Initial Developer and You want to create anew license for Your Original Software, You may create and use a modified version ofthis License if You: (a) rename the license and remove any references to the name ofthe license steward (except to note that the license differs from this License); and (b)otherwise make it clear that the license contains terms which differ from this License.

5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDERTHIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANYKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS,MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THEENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVEREDSOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVEDEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANYOTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES ANESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE ISAUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.

6. TERMINATION.

6.1. This License and the rights granted hereunder will terminate automatically ifYou fail to comply with terms herein and fail to cure such breach within 30 days of

Preface

liii

Page 54: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

becoming aware of the breach. Provisions which, by their nature, must remain in effectbeyond the termination of this License shall survive.

6.2. If You assert a patent infringement claim (excluding declaratory judgment actions)against Initial Developer or a Contributor (the Initial Developer or Contributor againstwhom You assert such claim is referred to as "Participant") alleging that the ParticipantSoftware (meaning the Contributor Version where the Participant is a Contributor orthe Original Software where the Participant is the Initial Developer) directly or indirectlyinfringes any patent, then any and all rights granted directly or indirectly to You bysuch Participant, the Initial Developer (if the Initial Developer is not the Participant)and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 daysnotice from Participant terminate prospectively and automatically at the expiration ofsuch 60 day notice period, unless if within such 60 day period You withdraw Your claimwith respect to the Participant Software against such Participant either unilaterally orpursuant to a written agreement with Participant.

6.3. If You assert a patent infringement claim against Participant alleging that theParticipant Software directly or indirectly infringes any patent where such claim isresolved (such as by license or settlement) prior to the initiation of patent infringementlitigation, then the reasonable value of the licenses granted by such Participant underSections 2.1 or 2.2 shall be taken into account in determining the amount or value ofany payment or license.

6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licensesthat have been validly granted by You or any distributor hereunder prior to termination(excluding licenses granted to You by any distributor) shall survive termination.

7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NOLEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT,OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHERCONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANYSUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FORANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OFANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSSOF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IFSUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCHDAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITYFOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'SNEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION.SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATIONOF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION ANDLIMITATION MAY NOT APPLY TO YOU.

8. U.S. GOVERNMENT END USERS. The Covered Software is a "commercial item,"as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercialcomputer software" (as that term is defined at 48 C.F.R. § 252.227-7014(a)(1)) and"commercial computer software documentation" as such terms are used in 48 C.F.R.12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1through 227.7202-4 (June 1995), all U.S. Government End Users acquire CoveredSoftware with only those rights set forth herein. This U.S. Government Rights clauseis in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision thataddresses Government rights in computer software under this License.

9. MISCELLANEOUS. This License represents the complete agreement concerningsubject matter hereof. If any provision of this License is held to be unenforceable,such provision shall be reformed only to the extent necessary to make it enforceable.

Preface

liv

Page 55: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

This License shall be governed by the law of the jurisdiction specified in a noticecontained within the Original Software (except to the extent applicable law, ifany, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Anylitigation relating to this License shall be subject to the jurisdiction of the courtslocated in the jurisdiction and venue specified in a notice contained within the OriginalSoftware, with the losing party responsible for costs, including, without limitation, courtcosts and reasonable attorneys' fees and expenses. The application of the UnitedNations Convention on Contracts for the International Sale of Goods is expresslyexcluded. Any law or regulation which provides that the language of a contract shall beconstrued against the drafter shall not apply to this License. You agree that You aloneare responsible for compliance with the United States export administration regulations(and the export control laws and regulation of any other countries) when You use,distribute or otherwise make available any Covered Software.

10. RESPONSIBILITY FOR CLAIMS.

As between Initial Developer and the Contributors, each party is responsible for claimsand damages arising, directly or indirectly, out of its utilization of rights under thisLicense and You agree to work with Initial Developer and Contributors to distributesuch responsibility on an equitable basis. Nothing herein is intended or shall bedeemed to constitute any admission of liability. NOTICE PURSUANT TO SECTION9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)

The code released under the CDDL shall be governed by the laws of the State ofCalifornia (excluding conflict-of-law provisions). Any litigation relating to this Licenseshall be subject to the jurisdiction of the Federal Courts of the Northern District ofCalifornia and the state courts of the State of California, with venue lying in SantaClara County, California.

~

GNU GENERAL PUBLIC LICENSE (GPL Version 2, June 1991)

Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, FifthFloor, Boston, MA 02110-1301, USA

Everyone is permitted to copy and distribute verbatim copies of this license document,but changing it is not allowed.

StringTemplate 4.3The BSD License]

Copyright (c) 2012 Terence Parr

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, arepermitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list ofconditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list ofconditions and the following disclaimer in the documentation and/or other materialsprovided with the distribution.

Preface

lv

Page 56: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Neither the name of the author nor the names of its contributors may be used toendorse or promote products derived from this software without specific prior writtenpermission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDCONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.

Developer's Certificate of Origin

All contributors to StringTemplate v4 must formally agree to abide by the certificate oforigin by signing on the bottom of that document. To contribute:

fork the StringTemplate v4 github repository

make your changes

[first time contributors]: sign contributors.txt by adding your github userid, full name,email address (you can obscure your e-mail, but it must be computable by human),and date.

commit your changes

send a pull request

After you have signed once, you don't have to sign future pull requests. We can mergeby simply checking to see your name is in the contributors file.

Preface

lvi

Page 57: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

1Changes in Release 20.2 for Oracle SQLclUser's Guide

This section lists the changes for this release.

New Features

New features in this release are:

• The SQLcl extension now supports the use of Liquibase contexts and labelsenabling more flexibility in its usage.

– Job and Directory are new supported DDL types.

– CreateOracleJob and CreateOracleDirectory are new Liquibasechangesets.

• Changes in syntax for the following Liquibase commands: GENOBJECT,GENSCHEMA, UPDATE, UPDATESQL, ROLLBACK, DIFF.

• New Liquibase commands exposed in SQLcl:

– ROLLBACKSQL

– DBDOC

– VERSION

• DATABASECHANGELOG_DETAILS is a new view in Liquibase. SeeDATABASECHANGELOG_DETAILS VIEW

• New load options available: SET LOAD and SET LOADFORMAT

See the LOAD command in Miscellaneous Commands

• A new Property Graph Query Language (PGQL) plug-in for SQLcl.

See PGQL Plug-in for SQLcl

1-1

Page 58: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

2Using Oracle SQLcl

Oracle SQLcl (SQL Developer Command Line) is a Java-based command-lineinterface for Oracle Database. Using SQLcl, you can execute SQL and PL/SQLstatements interactively or as as a batch file. SQLcl provides inline editing, statementcompletion, command recall, and also supports existing SQL*Plus scripts.

Oracle SQLcl is available for download from Oracle Technology Network.

This chapter contains the following topics:

• Alphabetic List of SQLcl Commands

• List of Unsupported SQL*Plus Commands and Features

• Starting and Leaving SQLcl

• Starting Up and Shutting Down a Database

• Entering and Executing Commands

• Manipulating SQL, SQLcl, and PL/SQL Commands

• Formatting Query Results

• Accessing Databases

• Miscellaneous Commands

2.1 Alphabetic List of SQLcl Commands@{url | file_name[.ext]} [arg ...]

@@ { url | file_name[.ext] } [arg ...]

/ (slash)

ACC[EPT] variable [NUM[BER] | CHAR | DATE | BINARY_FLOAT | BINARY_DOUBLE][FOR[MAT] format] [DEF[AULT] default] [PROMPT text | NOPR[OMPT]] [HIDE]

ALIAS [<name>=<SQL statement>;| LOAD [<filename>]|SAVE [<filename>] | LIST[<NAME>] | DROP <name> | DESC <name> <Description String>]

APEX [export <application_id>]

A[PPEND] text

ARCHIVE LOG LIST

BRE[AK] [ON report_element [action [action]]] ...

BRIDGE

BTI[TLE] [printspec [text | variable] ...] | [ON | OFF]

CD [<directory>]

2-1

Page 59: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

C[HANGE] sepchar old [sepchar [new [sepchar]]]

CL[EAR] option ...

COL[UMN] [{column | expr} [option ...]]

COMP[UTE] [function [LAB[EL] text] ... OF {expr | column | alias} ...ON{expr | column | alias | REPORT | ROW} ...]

CONN[ECT] [{<logon>| / |proxy} [AS {SYSOPER | SYSDBA | SYSASM}][edition=value]]

CTAS table new_table

COPY {FROM database | TO database | FROM database TO database} {APPEND| CREATE | INSERT | REPLACE | APPEND_BYTE | CREATE_BYTE | REPLACE_BYTE}destination_table[(column, column, column, ...)] USING query

DDL [object_name [type] [SAVE filename]]

DEF[INE] [variable] | [variable = text]

DEL [n | n m | n * | n LAST | * | * n | * LAST | LAST]

DESC[RIBE] {[schema.]object[@connect_identifier]}

DISC[ONNECT]

ED[IT] [file_name[.ext]]

EXEC[UTE] statement

{EXIT | QUIT} [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable][COMMIT | ROLLBACK]

FIND [<filename>]

FORMAT [BUFFER | RULES <filename> | FILE <input_file> <output_file>]

GET [FILE] file_name[.ext] [LIST | NOLIST]

HELP | ? [topic]

HISTORY [index | FULL | USAGE | SCRIPT | TIME | CLEAR (SESSION)?]

HO[ST] [command]

INFO[RMATION] {[schema.]object[@connect_identifier]}

I[NPUT] [text]

L[IST] [n | n m | n * | n LAST | * | * n | * LAST | LAST]

LOAD [schema.]table_name[@db_link] file_name

OERR <facility> <error>

PASSW[ORD] [username]

PAU[SE] [text]

PRINT [variable ...]

PRO[MPT] [text]

Chapter 2Alphabetic List of SQLcl Commands

2-2

Page 60: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

{QUIT | EXIT} [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable][COMMIT | ROLLBACK]

REM[ARK]

REPEAT <iterations> <sleep>

REST [export [<module_name> | <module_prefix>] | modules | privileges |schemas]

R[UN]

SAV[E] [FILE] file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]]

SCRIPT <script file>

SET system_variable value

SHO[W] [option]

SHUTDOWN [ABORT | IMMEDIATE | NORMAL | TRANSACTIONAL [LOCAL]]

SODA

SPO[OL] [filename[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT]

SSHTUNNEL <username>@<hostname> -i <identity_file> [-LlocalPort:Remotehost:RemotePort]

STA[RT] { url | file_name[.ext] } [arg ...]

STARTUP db_options | cdb_options | upgrade_options

STORE {SET} file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]]

TNSPING <address>

TTI[TLE] [printspec [text | variable] ...] | [ON | OFF]

UNDEF[INE] variable ...

WHENEVER OSERROR {EXIT [SUCCESS | FAILURE | n | variable | :BindVariable][COMMIT | ROLLBACK] | CONTINUE[COMMIT | ROLLBACK | NONE]}

WHENEVER SQLERROR {EXIT [SUCCESS | FAILURE | WARNING | n | variable| :BindVariable] [COMMIT | ROLLBACK] | CONTINUE [COMMIT | ROLLBACK |NONE]}

WHICH <filename>

XQUERY xquery_statement

Note:

You can use the up and down arrow keys to cycle through the previous 100statements or scripts.

Chapter 2Alphabetic List of SQLcl Commands

2-3

Page 61: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

2.2 List of Unsupported SQL*Plus Commands and FeaturesCommands

• REPHEADER

• REPFOOTER

• TIMING

The TIMING command is replaced by the SET TIMING command.

System Variables and Environment Settings through the SET Command

• describe

• flagger

• fullcolname

• logsource

• loboffset

• markup

• recsep

• shiftinout

• sqlterminator

• underline

• xmloptimizationcheck

2.3 Starting and Leaving SQLclLogging In and Logging Out

Use the following commands to log in to and out of SQLcl.

SQLCL [[option] [logon | / NOLOG] [start]]

where option has the following syntax:

-H[ELP] | -V[ERSION] | [ [-C[OMPATIBILITY] x.y[.z]]] [-L[OGON]] [-NOLOGINTIME] [-R[ESTRICT] {1 | 2 | 3}] [-S[ILENT]] [-AC]]

where logon has the following syntax:

{username[/password] [@connect_identifier] | /} [AS {SYSASM |SYSBACKUP |SYSDBA |SYSDG |SYSOPER |SYSRAC |SYSKM}] [edition=value]

and where start has the following syntax:

@{url | file_name[.ext]} [arg ...]

{EXIT | QUIT} [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable][COMMIT | ROLLBACK]

Chapter 2List of Unsupported SQL*Plus Commands and Features

2-4

Page 62: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Commits or rolls back all pending changes, logs out of Oracle, terminates SQLcl andreturns control to the operating system.

{QUIT | EXIT} [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable][COMMIT | ROLLBACK]

Commits or rolls back all pending changes, logs out of Oracle, terminates SQLcl andreturns control to the operating system.

Setting JVM Options

To set an Oracle Java Virtual Machine (JVM) option in SQLcl, use the followingenvironment variable:

JAVA_TOOL_OPTIONS

The following example shows in Windows, how to change the user interface languagein SQLcl to Spanish (es):

c:\SQLDev\sqlcl\20.2\sqlcl\bin>SET JAVA_TOOL_OPTIONS=-Duser.language=esc:\SQLDev\sqlcl\20.2\sqlcl\bin>sql hr/oraclePicked up JAVA_TOOL_OPTIONS: -Duser.language=esSQLcl: Versi�n 20.2 Production en mar. ago. 25 15:37:58 2020Copyright (c) 1982, 2020, Oracle. Todos los derechos reservados.Last Successful login time: Mar Ago 25 2020 15:38:01 -04:00Conectado a:Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Se ha encontrado login.sql en el CWD. El acceso a la DB estß restringido para login.sql.Ajuste SQLPATH para incluir la ruta y activar la funcionalidad completa.SQL>

The following example shows how to change the user interface language in SQLcl toFrench (fr), and also increase the maximum memory available to SQLcl (-Xmx800m):

c:\SQLDev\sqlcl\20.2\sqlcl\bin>SET JAVA_TOOL_OPTIONS=-Duser.language=fr -Xmx800mc:\SQLDev\sqlcl\20.2\sqlcl\bin>sql hr/oraclePicked up JAVA_TOOL_OPTIONS: -Duser.language=fr -Xmx800mSQLcl : version 20.2 Production sur mar. ao√t 25 15:57:21 2020Copyright (c) 1982, 2020, Oracle. Tous droits rΘservΘs....

2.4 Starting Up and Shutting Down a DatabaseStarting up and shutting down a database requires DBA privileges.

STARTUP db_options | cdb_options | upgrade_options

where db options has the following syntax:

[FORCE] [RESTRICT] [PFILE=filename] [QUIET] [ MOUNT [dbname] | [ OPEN[open_db_options] [dbname] ] | NOMOUNT ]

Chapter 2Starting Up and Shutting Down a Database

2-5

Page 63: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

where open_db_options has the following syntax:

READ {ONLY | WRITE [RECOVER]} | RECOVER

where cdb_options has the following syntax:

root_connection_options | pdb_connection_options

where root_connection_options has the following syntax:

PLUGGABLE DATABASE pdbname [FORCE] | [RESTRICT] [ OPEN {open_pdb_options}]

where pdb_connection_options has the following syntax:

[FORCE] | [RESTRICT] [ OPEN {open_pdb_options}]

where open_pdb_options has the following syntax:

READ WRITE | READ ONLY

and where upgrade_options has the following syntax:

[PFILE=filename] {UPGRADE | DOWNGRADE} [QUIET]

Starts an Oracle Database instance with several options, including mounting andopening a database.

SHUTDOWN [ABORT | IMMEDIATE | NORMAL | TRANSACTIONAL [LOCAL]]

Shuts down a currently running Oracle instance, optionally closing and dismounting adatabase.

2.5 Entering and Executing CommandsUse the following commands to execute and collect timing statistics on SQLcommands and PL/SQL blocks:

/ (slash)

Executes the most recently executed SQL command or PL/SQL block which is storedin the SQL buffer. Does not list the command. Use slash (/) at the command prompt orline number prompt in SQLcl command line.

EXEC[UTE] statement

Executes a single PL/SQL statement or runs a stored procedure.

R[UN]

Lists and executes the most recently executed SQLcl command or PL/SQL blockwhich is stored in the SQL buffer. The buffer has no command history list and does notrecord SQLcl commands.

TIMI[NG]

Timing is only available as a switch.

Use the following command to access the help system:

HELP | ? [topic]

Chapter 2Entering and Executing Commands

2-6

Page 64: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Accesses the command-line help system. Enter HELP INDEX or ? INDEX for a listof topics. You can view the Oracle Database Library at http://www.oracle.com/technology/documentation.

Use the following command to execute operating system commands:

HO[ST] [command]

Executes an operating system command without leaving SQLcl. Enter HOST withoutcommand to display an operating system prompt. You can then enter multipleoperating system commands.

With some operating systems, you can use another character instead of HOST suchas "!" (UNIX) and "$" (Windows). See the Oracle installation and user's manualsprovided for your operating system for details.

Use the following command to recall the history of SQLcl commands:

HISTORY [index | FULL | USAGE | SCRIPT | TIME | CLEAR (SESSION)?] | FAILS

• Use the Up and Down arrow keys to navigate through history items at the prompt.

• Use the HISTORY command to print the history contents.

• History is limited to the last 100 statements.

• SET HISTORY LIMIT N allows you to change the default limit, where N is themaximum number.

• History is retained between SQLcl sessions.

• By default, the SHOW, HISTORY, CONNECT, and SET commands are not saved inhistory.

• SET HISTORY BLACKLIST allows you to set the commands that should not berecorded in history.

2.6 Manipulating SQL, SQLcl, and PL/SQL CommandsUse the following commands to edit SQL commands and PL/SQL blocks:

A[PPEND] text

Adds specified text to the end of the current line in the SQL buffer. To separate textfrom the preceding characters with a space, enter two spaces. To append text thatends with a semicolon, end the command with two semicolons (a single semicolon isinterpreted as a command terminator).

C[HANGE] sepchar old [sepchar [new [sepchar]]]

Changes first occurrence of old on the current line of the SQL buffer. The buffer hasno command history list and does not record SQLcl commands. You can use anynon-alphanumeric character such as "/" or "!" as a sepchar. You can omit the spacebetween CHANGE and the first sepchar.

DEL [n | n m | n * | n LAST | * | * n | * LAST | LAST]

Deletes one or more lines of the SQL buffer ("*" indicates the current line). You canomit the space between DEL and n or *, but not between DEL and LAST. Enter DEL withno clauses to delete the current line of the buffer. The buffer has no command historylist and does not record SQLcl commands.

Chapter 2Manipulating SQL, SQLcl, and PL/SQL Commands

2-7

Page 65: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

I[NPUT] [text]

Adds one or more new lines of text after the current line in the SQL buffer. The bufferhas no command history list and does not record SQLcl commands.

L[IST] [n | n m | n * | n LAST | * | * n | * LAST | LAST]

Lists one or more lines of the most recently executed SQL command or PL/SQL blockwhich is stored in the SQL buffer. Asterisk (*) indicates the current line. You can omitthe space between LIST and n or *, but not between LIST and LAST. Enter LIST withno clauses to list all lines.

In SQLcl, you can also use ";" to list all the lines in the SQL buffer. The buffer has nocommand history list and does not record SQLcl commands.

Use the following commands to run scripts:

@ { url | file_name[.ext] } [arg ...]

Runs the SQLcl statements in the specified script. The script can be called from thelocal file system or a web server. You can pass values to script variables in the usualway.

@@ { url | file_name[.ext] } [arg ...]

Runs the SQLcl statements in the specified script. This command is almost identicalto the @ command. It is useful for running nested scripts because it has the additionalfunctionality of looking for the specified script in the same path or url as the callingscript.

REPEAT <iterations> <sleep>

Repeats the current SQL in the buffer at the specified times with sleep intervals. Themaximum sleep interval is 120 seconds.

SCRIPT <script file>

Runs the SQLcl statements in the specified script.

STA[RT] { url | file_name[.ext] } [arg ...]

Runs the SQLcl statements in the specified script. The script can be called from thelocal file system or a web server. You can pass values to script variables in the usualway.

Use the following commands to create and modify scripts:

ED[IT] [file_name[.ext]]

Invokes an operating system text editor on the contents of the specified file or on thecontents of the SQL buffer. To edit the buffer contents, omit the file name.

The DEFINE variable _EDITOR can be used to set the editor to use. In SQLcl,_EDITOR can be set to any editor that you prefer. Inline will set the editor to bethe SQLcl editor. This supports the following shortcuts:

• ^R - Run the current buffer

• ^W - Go to top of buffer

• ^S - Go to bottom of buffer

• ^A - Go to start of line

Chapter 2Manipulating SQL, SQLcl, and PL/SQL Commands

2-8

Page 66: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

• ^E - Go to end of line

FORMAT

• FORMAT BUFFER - formats the script in the SQLcl Buffer

• FORMAT RULES <filename> - Loads SQLDeveloper Formatter rules file to formatter

• FORMAT FILE <input_file> <output_file>

GET file_name[.ext] [LIST | NOLIST]

Loads a SQL statement or PL/SQL block from a file into the SQL buffer. The buffer hasno command history list and does not record SQLcl commands.

REM[ARK]

Begins a comment in a script. The REMARK command must appear at the beginningof a line, and the comment ends at the end of the line (a line cannot contain both acomment and a command). SQLcl does not interpret the comment as a command.

SAV[E] [FILE] file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]]

Saves the contents of the SQL buffer in a script. The buffer has no command historylist and does not record SQLcl commands.

STORE {SET} file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]]

Saves attributes of the current SQLcl environment in a file.

WHENEVER OSERROR {EXIT [SUCCESS | FAILURE | n | variable | :BindVariable][COMMIT | ROLLBACK] | CONTINUE [COMMIT | ROLLBACK | NONE]}

Performs the specified action (exits SQLcl by default) if an operating system erroroccurs (such as a file writing error).

WHENEVER SQLERROR {EXIT [SUCCESS | FAILURE | WARNING | n | variable| :BindVariable] [COMMIT | ROLLBACK] | CONTINUE [COMMIT | ROLLBACK |NONE]}

Performs the specified action (exits SQLcl by default) if a SQL command or PL/SQLblock generates an error.

Use the following commands to write interactive commands:

ACC[EPT] variable [NUM[BER] | CHAR | DATE | BINARY_FLOAT | BINARY_DOUBLE][FOR[MAT] format] [DEF[AULT] default] [PROMPT text | NOPR[OMPT]] [HIDE]

Reads a line of input and stores it in a given substitution variable.

DEF[INE] [variable] | [variable = text]

Specifies a substitution variable and assigns a CHAR value to it, or lists the value andvariable type of a single variable or all variables.

PAU[SE] [text]

Displays the specified text then waits for the user to press RETURN.

PRO[MPT] [text]

Sends the specified message or a blank line to the user's screen.

Chapter 2Manipulating SQL, SQLcl, and PL/SQL Commands

2-9

Page 67: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

UNDEF[INE] variable ...

Deletes one or more substitution variables that you defined either explicitly (with theDEFINE command) or implicitly (with a START command argument).

Use the following commands to create and display bind variables:

PRINT [variable ...]

Displays the current values of bind variables, or lists all bind variables.

Use the following symbols to create substitution variables and parameters for use inscripts:

&n

Specifies a parameter in a script you run using the START command. STARTsubstitutes values you list after the script name as follows: the first for &1, the secondfor &2, and so on.

&user_variable, &&user_variable

Indicates a substitution variable in a SQL or SQLcl command. SQLcl substitutes thevalue of the specified substitution variable for each substitution variable it encounters.If the substitution variable is undefined, SQLcl prompts you for a value each time an"&" variable is found, and the first time an "&&" variable is found.

. (period)

Terminates a substitution variable followed by a character that would otherwise be partof the variable name.

2.7 Formatting Query ResultsUse the following commands to format, store and print your query results.

BRE[AK] [ON report_element [action [action]]] ...

Specifies where changes occur in a report and the formatting action to perform, suchas:

• suppressing the display of duplicate values for a given column

• skipping a line each time a given column value changes

• printing computed figures each time a given column value changes or at the end ofthe report

Enter BREAK with no clauses to list the current BREAK definition.

Where report_element has the following syntax:

{column | expression | ROW | REPORT}

and where action has the following syntax:

[SKI[P] n | [SKI[P]] PAGE] [NODUP[LICATES] | DUP[LICATES]]

BTI[TLE] [printspec [text | variable] ...] | [ON | OFF]

Places and formats a title at the bottom of each report page, or lists the currentBTITLE definition. Use one of the following clauses in place of printspec:

Chapter 2Formatting Query Results

2-10

Page 68: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

BOLD

CE[NTER]

COL n

FORMAT text

LE[FT]

R[IGHT]

S[KIP] [n]

TAB n

CL[EAR] option ...

Resets or erases the current value or setting for the specified option.

Where option represents one of the following clauses:

BRE[AKS]

BUFF[ER]

COL[UMNS]

COMP[UTES]

CONTEXT

SCR[EEN]

SQL

TIMI[NG]

COL[UMN] [{column | expr} [option ...]]

Specifies display attributes for a given column, such as:

• text for the column heading

• alignment for the column heading

• format for NUMBER data

• wrapping of column data

Also lists the current display attributes for a single column or for all columns.

Where option represents one of the following clauses:

ALI[AS] alias

CLE[AR]

ENTMAP {ON | OFF}

FOR[MAT] format

HEA[DING] text

JUS[TIFY] {L[EFT] | C[ENTER] | R[IGHT]}

LIKE {expr | alias}

NEWL[INE]

NEW_V[ALUE] variable

NOPRI[NT] | PRI[NT]

NUL[L] text

OLD_V[ALUE] variable

ON | OFF

WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED]

Chapter 2Formatting Query Results

2-11

Page 69: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Note:

Currently only NEW_V[ALUE] variable syntax is supported.

Enter COLUMN [{column |expr} FORMAT format] where the format elementspecifies the display format for the column.

To change the display format of a NUMBER column, use FORMAT followed by one of theelements in the following table:

Element Examples Description

, (comma) 9,999Displays a comma in the specified position.

. (period) 99.99Displays a period (decimal point) to separate the integral andfractional parts of a number.

$ $9999Displays a leading dollar sign.

0 09999990

Displays leading or trailing zeros (0).

9 9999Displays a value with the number of digits specified by thenumber of 9s. Value has a leading space if positive, a leadingminus sign if negative. Blanks are displayed for leading zeros. Azero (0) is displayed for a value of zero.

B B9999Displays blanks for the integer part of a fixed-point numberwhen the integer part is zero, regardless of zeros in the formatmodel.

C C999Displays the ISO currency symbol in the specified position.

D 99D99Displays the decimal character to separate the integral andfractional parts of a number.

EEEE 9.999EEEEDisplays a value in scientific notation (format must containexactly four "E"s).

G 9G999Displays the group separator in the specified positions in theintegral part of a number.

L L999Displays the local currency symbol in the specified position.

MI 9999MIDisplays a trailing minus sign after a negative value. Displays atrailing space after a positive value.

PR 9999PRDisplays a negative value in <angle brackets>. Displays apositive value with a leading and trailing space.

RN rn RNrn

Displays uppercase Roman numerals. Displays lowercaseRoman numerals. Value can be an integer between 1 and 3999.

S S99999999S

Displays a leading minus or plus sign. Displays a trailing minusor plus sign.

Chapter 2Formatting Query Results

2-12

Page 70: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Element Examples Description

TM TMDisplays the smallest number of decimal characters possible.The default is TM9. Fixed notation is used for output up to64 characters, scientific notation for more than 64 characters.Cannot precede TM with any other element. TM can only befollowed by a single 9 or E.

U U9999Displays the dual currency symbol in the specified position.

COMP[UTE] [function [LAB[EL] text] ... OF {expr | column | alias} ...ON{expr | column | alias | REPORT | ROW} ...]

In combination with the BREAK command, calculates and prints summary lines usingvarious standard computations. It also lists all COMPUTE definitions. The followingtable lists valid functions. All functions except NUMBER apply to non-null values only.COMPUTE functions are always executed in the following sequence AVG, COUNT,MINIMUM, MAXIMUM, NUMBER, SUM, STD, VARIANCE.

Function Computes Applies to Datatypes

AVG Average of non-null values NUMBER

COU[NT] Count of non-null values All types

MIN[IMUM] Minimum value NUMBER, CHAR, NCHAR, VARCHAR2(VARCHAR), NVARCHAR2 (NCHARVARYING)

MAX[IMUM] Maximum value NUMBER, CHAR, NCHAR, VARCHAR2(VARCHAR), NVARCHAR2 (NCHARVARYING)

NUM[BER] Count of rows All types

SUM Sum of non-null values NUMBER

STD Standard deviation of non-nullvalues

NUMBER

VAR[IANCE] Variance of non-null values NUMBER

SET SQLFORMAT {csv | html | xml | json | ansiconsole | insert | loader |fixed | default}

Outputs reports in various formats. The ansiconsole option formats and resizes dataaccording to the column widths, for easier readability. The json option returns a queryin JSON format.

SET SQLFORMAT DELIMITED <delimiter> <left enclosure> <right enclosure>allows you to set a custom delimited format.

SET SQLFORMAT JSON-FORMATTED returns a query in well formatted JSON output.

SPO[OL] [filename[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT]

Stores query results in a file, or optionally sends the file to a printer. OFF stopsspooling. OUT stops spooling and sends the file to your computer's default printer. EnterSPOOL with no clauses to list the current spooling status. If no file extension is given,the default extension, .lst or .lis, is used.

Chapter 2Formatting Query Results

2-13

Page 71: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

TTI[TLE] [printspec [text | variable] ...] | [ON | OFF]

Places and formats a specified title at the top of each report page, or lists the currentTTITLE definition. The old form of TTITLE is used if only a single word or a string inquotes follows the TTITLE command.

Where printspec represents one or more of the following clauses:

BOLD

CE[NTER]

COL n

FORMAT text

LE[FT]

R[IGHT]

S[KIP] [n]

TAB n

2.8 Accessing DatabasesUse the following commands to access and copy data between tables on differentdatabases:

CONN[ECT] [{<logon>| / |proxy} [AS {SYSOPER | SYSDBA | SYSASM}][edition=value]]

where logon has the following syntax:

username[/password] [@connect_identifier]

where proxy has the following syntax:

proxyuser[username] [/password] [@connect_identifier]

Note:

The brackets around username in proxy are required syntax.

Connects a given username to the Oracle Database. If you omit connect_identifier,SQLcl connects you to the default database. If you omit username and/or password,SQLcl prompts you for them. CONNECT followed by a slash (/) connects you using adefault (OPS$) logon.

When you run a CONNECT command, the site profile, glogin.sql, and the user profile,login.sql, are processed in that order. CONNECT does not reprompt for username orpassword if the initial connection does not succeed.

DISC[ONNECT]

Commits pending changes to the database and logs the current user out of Oracle, butdoes not exit SQLcl. In SQLcl command line, use EXIT or QUIT to log out of Oracle andreturn control to your computer's operating system.

Chapter 2Accessing Databases

2-14

Page 72: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

COPY {FROM database | TO database | FROM database TO database} {APPEND| CREATE | INSERT | REPLACE | APPEND_BYTE | CREATE_BYTE | REPLACE_BYTE}destination_table[(column, column, column, ...)] USING query

where database has the following syntax:

username[/password]@connect_identifier

Copies data from a query to a table in the same or another database. APPEND, CREATE,INSERT or REPLACE specifies how COPY treats the existing copy of the destination table(if it exists). USING query identifies the source table and determines which rows andcolumns COPY copies from it. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2datatypes.

PASSW[ORD] [username]

Allows you to change a password without displaying it on an input device.

XQUERY xquery_statement

Allows you to run an XQuery from SQLcl.

2.9 Miscellaneous CommandsALIAS [<name>=<SQL statement>;| LOAD [<filename>]|SAVE [<filename>] | LIST[<NAME>] | DROP <name> | DESC <name> <Description String>]

Alias is a command which allows you to save a SQL, PL/SQL or SQL*Plus script andassign it a shortcut command.

• ALIAS — Print a list of aliases

• ALIAS LIST <alias_name> — List the contents of the alias

The following example shows how to create a simple alias:

SQL> ALIAS action1=select :one from dual;

Note:

Define an alias simply by using the alias keyword followed by a singleidentifier name followed by an '='. Anything after the '=' will be used as thealias contents. If it is SQL, it will be terminated by ';'. If it is PL/SQL, it will beterminated by '/'.

APEX

Lists Application Express Applications. Use APEX EXPORT <app id> to export theapplication which could be combined with spool for writing to a file.

ARCHIVE LOG LIST

Displays information about redo log files.

BRIDGE <targetTableName> as "<jdbcURL>"(<sqlQuery>);

Chapter 2Miscellaneous Commands

2-15

Page 73: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Used mainly to script data move between two connections/schemas. It also includesfunctionality to dynamically create Oracle tables which "fit" the data being receivedthrough JDBC. The following functionality is available:

1. Query tables in other connections

2. Query tables in multiple connections in the same statement

3. Insert data from one connection into another

4. Create a table and insert data into it from another connection

CTAS table new_table

Uses DBMS_METADATA to extract the DDL for the existing table, then modifies thatinto a create table as select * from.

DDL [object_name [type] [SAVE filename]]

Generates the code to reconstruct the object listed. Use the type option formaterialized views. Use the SAVE option to save the DDL to a file.

DESC[RIBE] {[schema.]object[@connect_identifier]}

Lists the column definitions for a table, view or synonym, or the specifications for afunction or procedure.

FIND [<filename>]

Searches the SQLPATH and its directories for the specified file name. FIND where<filename> lists all the SQLPATH locations where it finds files matching the specifiedfile name.

INFO[RMATION] {[schema.]object[@connect_identifier]}

Lists more detailed information about the column definitions for a table, view orsynonym, or the specifications for a function or procedure.

Note:

INFORMATION+ will show column statistics.

LOAD [schema.]table_name[@db_link] file_name

Loads a file into a table.

Defaults for file format:

• The columns are delimited by a comma and may optionally be enclosed in doublequotes.

• Lines are terminated with standard line terminators for Windows, UNIX, or Mac.

• File is encoded UTF8.

The default load:

• Processes with 50 rows per batch.

• If AUTOCOMMIT is set in SQLcl, a commit is done every 10 batches.

• The load is terminated if more than 50 errors are found.

Chapter 2Miscellaneous Commands

2-16

Page 74: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Use SET LOADFORMAT [options] for reading the file (delimiter, enclosures).

Use SET LOAD [options] for loading the data (rows per batch, date formats).

OERR <facility> <error>

Displays information about errors. Facility is identified by the prefix string in the errormessage. For example, if you get ORA-7300, "ora" is the facility and "7300" is theerror. So you should type "oerr ora 7300".

SSHTUNNEL <username>@<hostname> -i <identity_file> [-LlocalPort:Remotehost:RemotePort]

Creates a tunnel using standard ssh options such as port forwarding like option -L ofthe given port on the local host will be forwarded to the given remote host and port onthe remote side. It also supports identity files, using the ssh -i option. If passwords arerequired, they will be prompted for.

TNSPING <address>

The TNSPING utility determines whether the listener for a service on an Oracle Netnetwork can be reached successfully.

WHICH

Searches the SQLPATH and its directories for the specified file name and prints thename of the first file matching the specified file name in the SQLPATH.

2.9.1 REST

REST enables you to export Oracle REST Data Services 3.x services. This isapplicable for Oracle REST Data Services release 3.0.5 or later. If you have an earlierversion of Oracle REST Data Services, you will need to upgrade. See the InstallingOracle REST Data Services section in Oracle REST Data Services Installation,Configuration, and Development Guide for details.

The options are:

• REST export — Export all Oracle REST Data Services 3.x service modules

• REST export <module_name> — Export a specific module

• REST export <module_uri_uri prefix> — Export a specific module related tothe given prefix

• REST modules — List the available modules

• REST privileges — List the existing privileges

• REST schemas — List the available schemas

2.9.2 SODA

SODA allows schemaless application development using the JSON data model. Theoptions are:

• SODA create <collection_name> — Create a new collection

• SODA list — List all the collections

Chapter 2Miscellaneous Commands

2-17

Page 75: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

• SODA get <collection_name> [-all | -f | -k | -klist] [{<key> | <k1><k2> ... | <qbe>}] — List documents the collection. Optional arguments:

– all : list the keys of all docs in the collection

– k : list docs matching the specific <key>

– klist : list docs matching the list of keys

– f : list docs matching the <qbe>

• SODA insert <collection_name> <json_str | filename> — Insert a newdocument within a collection

• SODA drop <collection_name> — Delete existing collection

• SODA count <collection_name> [<qbe>] — Count number of documents insidecollection. Optional parameter <qbe> returns number of matching documents

• SODA replace <collection_name> <oldkey> <new_{str | doc}> — Replace onedocument with another

• SODA remove <collection_name> [-k | -klist | -f] {<key> | <k1><k2> ...| <qbe>} — Remove documents from collection. Optional arguments:

– k : Remove document in collection matching the specific <key>

– klist : Remove document in collection matching the list <key1> <key2> ...

– f : Remove document in collection matching <qbe>

2.9.3 SET system_variable valueSets a system variable to alter the SQLcl environment settings for your currentsession.

For example, to:

• Set the display width for data

• Customize HTML formatting

• Enable or disable printing of column headings

• Set the number of lines per page

Enter a system variable followed by a value as shown below:

SET APPI[NFO] {ON | OFF | text}

SET ARRAY[SIZE] {15 | n}

SET AUTO[COMMIT] {ON | OFF | IMM[EDIATE] | n}

SET AUTOP[RINT] {ON | OFF}

SET AUTORECOVERY {ON | OFF]

SET AUTOT[RACE] {ON | OFF | TRACE[ONLY]}

SET BLO[CKTERMINATOR] {. | c | ON | OFF}

SET CLASSIC [ ON | OFF ]

SET CLEAR [ TOP | BOTTOM | SAME ]

SET CLOUDCONFIG [ -proxy=<proxyhost>:<port> ] <wallet.zip location>

SET CMDS[EP] {; | c | ON | OFF}

SET CODESCAN ALL | NONE | SQLINJECTION [ON | OFF]

SET COLSEP {_ | text}

Chapter 2Miscellaneous Commands

2-18

Page 76: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

SET CON[CAT] {. | c | ON | OFF}

SET COPYC[OMMIT] {0 | n}

SET COPYTYPECHECK {ON | OFF}

SET DDL [[ PRETTY | SQLTERMINATOR | CONSTRAINTS | REF_CONSTRAINTS| CONSTRAINTS_AS_ALTER|OID | SIZE_BYTE_KEYWORD | PARTITIONING |SEGMENT_ATTRIBUTES | STORAGE | TABLESPACE | SPECIFICATION | BODY |FORCE | INSERT | |INHERIT | RESET] {on|off} ] | OFF ]

SET DEF[INE] {& | c | ON | OFF}

SET ECHO {ON | OFF}

SET EDITF[ILE] file_name[.ext]

SET EMB[EDDED] {ON | OFF}

SET ENCODING

SET ERRORL[OGGING] {ON | OFF} [TABLE [schema.]tablename] [TRUNCATE][IDENTIFIER identifier]

SET ESC[APE] {\ | c | ON | OFF}

SET ESCCHAR {@ | ? | % | $ | OFF}

SET EXITC[OMMIT] {ON | OFF}

SET FEED[BACK] {6 | n | ON | OFF}

SET FLU[SH] {ON | OFF}

SET HEA[DING] {ON | OFF}

SET HEADS[EP] { | | c | ON | OFF}

SET HISTORY [FAILS [LIMIT [ n | DEFAULT ] ] | NOFAILS |BLACKLIST[DEFAULT <command list>?|<command list>?] |LIMIT [n|DEFAULT]]

SET LDAPCON

SET LIN[ESIZE] {80 | n}

SET LOAD [options...]

SET LOADFORMAT [DEFAULT,CSV,DELIMITED] [options...]

SET LONG {80 | n}

SET LONGC[HUNKSIZE] {80 | n}

SET MAXROWS {n>1 | DEFAULT}

SET MAXSPOOLROWSTRUNCATE [ON | OFF | DEFAULT]

SET NET {ON | OFF | READONLY}

SET NEWP[AGE] {1 | n | NONE}

SET NOVERWRITE {ON | OFF | WARN}

SET NULL text

SET NUMF[ORMAT] format

SET NUM[WIDTH] {10 | n}

SET PAGES[IZE] {14 | n}

SET PAU[SE] {ON | OFF | text}

SET RECSEPCHAR { | c}

SET SERVEROUT[PUT] {ON | OFF} [SIZE {n | UNL[IMITED]}] [FOR[MAT]{WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED]}]

SET SHOW[MODE] {ON | OFF}

SET SQLBL[ANKLINES] {ON | OFF}

SET SQLC[ASE] {MIX[ED] | LO[WER] | UP[PER]}

SET SQLCO[NTINUE] {> | text}

SET SQLFORMAT {csv | html | xml | json | ansiconsole | insert | loader| fixed | default}

Chapter 2Miscellaneous Commands

2-19

Page 77: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

SET SQLPLUSCOMPAT[IBILITY] {x.y[.z]}

SET SQLPRE[FIX] {# | c}

SET SQLP[ROMPT] {SQL> | text}

SET SUF[FIX] {SQL | text}

SET T2 METRICDATA NAMESPACE {text}

SET T2 METRICDATA COMPARTMENTID {text}

SET T2 METRICDATA NAME {text}

SET T2 DIMENSIONS RESOURCEID {text}

SET T2 DIMENSIONS REGION {text}

SET T2 METADATA UNIT {text}

SET TAB {ON | OFF}

SET TERM[OUT] {ON | OFF}

SET TI[ME] {ON | OFF}

SET TIMI[NG] {ON | OFF}

SET TRIM[OUT] {ON | OFF}

SET TRIMS[POOL] {ON | OFF}

SET VER[IFY] {ON | OFF}

SET WRA[P] {ON | OFF}

SET DDL [[ PRETTY | SQLTERMINATOR | CONSTRAINTS | REF_CONSTRAINTS| CONSTRAINTS_AS_ALTER|OID | SIZE_BYTE_KEYWORD | PARTITIONING |SEGMENT_ATTRIBUTES | STORAGE | TABLESPACE | SPECIFICATION | BODY | FORCE |INSERT | |INHERIT | RESET] {on|off} ] | OFF ]

Allows you to set the DDL transform option on DBMS_METADATA.

SET ENCODING <encoding>

Allows you to set the encoding for the current session. Use SHOW ENCODING to view theencoding set for the current session. Use SHOW ENCODINGS to list the encodingsavailable on your platform.

2.9.4 SHOW option

Shows the value of a SQLcl system variable, or the current SQLcl environment. Enterany system variable set by the SET command in place of system_variable. SHOWSGA can only be used by a DBA user. Use one of the following terms or clauses inplace of option:

system_variable

ALL

BTI[TLE]

CON_ID

CON_NAME

CONNECTION

DDL

EDITION

ENCODING

ENCODINGS

Chapter 2Miscellaneous Commands

2-20

Page 78: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

ERR[ORS] [ {FUNCTION | PROCEDURE | PACKAGE | PACKAGE BODY | TRIGGER |VIEW | TYPE | TYPE BODY | DIMENSION | JAVA CLASS} [schema.]name]

INSTANCE

JAVA

JDBC

LNO

NLS

PARAMETER[S] [parameter_name]

PDBS

PNO

RECYC[LEBIN] [original_name]

REL[EASE]

REPF[OOTER]

REPH[EADER]

SGA

SPOO[L]

SPPARAMETER[S] [parameter_name]

SQLCODE

SQLPATH

TNS

TTI[TLE]

USER

VERSION

SHOW ENCODING

Shows the encoding which is set for the client.

SHOW ENCODINGS

Shows the available encodings for the client.

Chapter 2Miscellaneous Commands

2-21

Page 79: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3Liquibase Support in SQLcl

This chapter covers the Liquibase feature in SQLcl. It has the following topics:

• About Liquibase in SQLcl

• Requirements for Using Liquibase

• Supported Types

• Supported Liquibase Commands in SQLcl

• DATABASECHANGELOG_DETAILS VIEW

• ChangeSets in Liquibase

• Examples Using Liquibase

3.1 About Liquibase in SQLclLiquibase is an open-source database-independent library for tracking, managing andapplying database schema changes.

For an understanding of the major concepts in Liquibase, see Major Concepts.

Note:

Liquibase is not available in SQLcl that is part of the SQL Developerinstallation. To use this feature, you need to download the standalone SQLcloffering.

The Liquibase feature in SQLcl enables you to execute commands to generate achangelog for a single object or for a full schema (changeset and changelogs). Youcan process these objects manually using SQLcl or through any of the traditionalLiquibase interfaces.

With the Liquibase feature in SQLcl, you can:

• Generate and execute single object changelogs

• Generate and execute schema changesets with object dependencies

• Automatically sort a changeset during creation based on object dependencies

• Record all SQL statements for changeset or changelog execution, as it isgenerated

• Provide full rollback support for changesets and changelogs automatically

3-1

Page 80: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3.2 Requirements for Using LiquibaseThe two important aspects for using the Liquibase functionality are capturing anddeploying objects in an Oracle database.

Capture Objects

To capture an object or a schema, you must have SQLcl 19.2 or later installed.

In this release, you can only capture objects from the schema you are connected to inSQLcl. You also need write permission on the directory in which you save the files.

If you are capturing an entire schema, the user you are connected to must havethe privilege to create a table. The DATABASECHANGELOG_EXPORT table iscreated internally to gather object details and sort them correctly. The created objectis automatically excluded from the capture process and destroyed upon capturecompletion.

Deploy Objects

Liquibase uses the DATABASECHANGELOG table to track the changesets that havebeen run. The DATABASECHANGELOGLOCK table ensures that only one instance ofLiquibase is running at a time. The DATABASECHANGELOG_ACTIONS table tracksthe object state and the SQL statements executed during deployment.

• SQLcl

Deploying changes to any database through SQLcl requires the 19.2 release orlater and the privilege to create a table. You must have necessary permissions tocreate any object type through the change that you are deploying.

• Liquibase

If you use Liquibase directly to deploy changesets, you need to have:

– the extension installed in your Liquibase environment. Add the dbtools-liquibase.jar file in liquibase/lib/ext.

– the privileges to create a table and a package.

3.3 Supported TypesDDL types use create or replace syntax. A snapshot of the object is taken beforeapplying the change so automatic rollback to the last known state is supported.

SXML types support automatic alter generation with automatic rollback support.

DDL types have their own change type.

• CONSTRAINT

• DIMENSION

• DIRECTORY

• FUNCTION

• JOB

• OBJECT_GRANT

Chapter 3Requirements for Using Liquibase

3-2

Page 81: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

• PACKAGE_BODY

• PACKAGE_SPEC

• PROCEDURE

• PUBLIC_SYNONYM

• REF_CONSTRAINT

• SYNONYM

• TRIGGER

• TYPE BODY

• TYPE SPEC

SXML types share the SXML change type.

• AQ_QUEUE

• AQ_QUEUE_TABLE

• AQ_TRANSFORM

• ASSOCIATION

• AUDIT

• AUDIT_OBJ

• CLUSTER

• CONTEXT

• DB_LINK

• DEFAULT_ROLE

• FGA_POLICY

• JOB

• LIBRARY

• MATERIALIZED_VIEW

• MATERIALIZED_VIEW_LOG

• OPERATOR

• PROFILE

• PROXY

• REFRESH_GROUP

• RESOURCE_COST

• RLS_CONTEXT

• RLS_GROUP

• RMGR_CONSUMER_GROUP

• RMGR_INTITIAL_CONSUMER_GROUP

• RMGR_PLAN

• RMGR_PLAN_DIRECTIVE

• ROLE

Chapter 3Supported Types

3-3

Page 82: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

• ROLLBACK_SEGMENT

• SEQUENCE

• TABLE

• TABLESPACE

• TRIGGER XS_ACL

• TRUSTED_DB_LINK

• USER

• VIEW

• XMLSCHEMA

• XS_ACL_PARAM INDEX

• XS_DATA_SECURITY

• XS_ROLE

• XS_ROLESET

• XS_ROLE_GRANT

• XS_SECURITY_CLASS

• XS_USER

3.4 Supported Liquibase Commands in SQLclYou can invoke the Liquibase commands in SQLcl with liquibase or lb.

To display a list of all available commands, execute liquibase or lb with noarguments.

• LB GENOBJECT

• LB GENSCHEMA

• LB GENCONTROLFILE

• LB UPDATE

• LB UPDATESQL

• LB ROLLBACK

• LB ROLLBACKSQL

• LB DIFF

• LB DBDOC

• LB CHANGELOGSYNC

• LB CLEARCHECKSUMS

• LB LISTLOCKS

• LB RELEASELOCKS

• LB STATUS

• LB VALIDATE

• LB VERSION

Chapter 3Supported Liquibase Commands in SQLcl

3-4

Page 83: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3.4.1 LB GENOBJECTGenerates change logs for APEX, ORDS RESTful Service Modules, or databaseobjects.

APEX

Syntax

lb genobject -type {APEX} -applicationid APPLICATIONID -workspaceid WORKSPACEID [-instance] [-expWorkspace][-expMinimal] [-expFiles] [-skipExportDate] [-expPubReports] [-expSavedReports] [-expIRNotif] [-expTranslations] [-expFeedback] [-expTeamdevdata] [-deploymentSystem DEPLOYMENTSYSTEM] [-expFeedbackSince EXPFEEDBACKSINCE] [-expOriginalIds] [-expNoSubscriptions] [-expComments] [-expSupportingObjects {Y,N,I}] [-expACLAssignments] [-dir DIR] [-list LIST] [-changesSince CHANGESSINCE] [-changesBy CHANGESBY] [-nochecksum] [-split] [-expComponents EXPCOMPONENTS] [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Generates a change log for APEX objects.

Named Parameters

Parameter Description Default

-type {APEX} Generate output for APEX objects. -

-applicationidAPPLICATIONID

Specify ID for application to be exported. -

-workspaceidWORKSPACEID

Specify workspace ID for all applicationsto be exported or the workspace to beexported.

-

-instance Export all applications. False

-expWorkspace Export workspace identified by -workspaceid or all workspaces if -workspaceid not specified.

False

-expMinimal Export only workspace definition, users,and groups.

False

-expFiles Export all workspace files identified by -workspaceid.

False

-skipExportDate Exclude export date from application exportfiles

False

-expPubReports Export all user-saved public interactivereports.

False

-expSavedReports Export all user-saved interactive reports. False

-expIRNotif Export all interactive report notifications. False

-expTranslations Export the translation mappings and all textfrom the translation repository.

False

Chapter 3Supported Liquibase Commands in SQLcl

3-5

Page 84: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Parameter Description Default

-expFeedback Export team development feedback for allworkspaces or identified by -workspaceid.

False

-expTeamdevdata Export team development data for allworkspaces or identified by -workspaceid.

False

-deploymentSystemDEPLOYMENTSYSTEM

Specify deployment system for exportedfeedback.

-

-expFeedbackSinceEXPFEEDBACKSINCE

Export team development feedback sincedate in the format YYYYMMDD.

-

-expOriginalIds Export emits ids as they were when theapplication was imported.

False

-expNoSubscriptions Does not export references to subscribedcomponents.

False

-expComments Export developer comments. False

-expSupportingObjects{Y,N,I}

Export supporting objects. Pass (Y)es, (N)oor (I)nstall to override the default (default:N).

N

-expACLAssignments Export ACL User Role Assignments. False

-dir DIR Save all files in the given directory. Forexample, -dir some/sub/directory.

-

-list LIST List all changed applications in theworkspace or components in theapplication.

-

-changesSinceCHANGESSINCE

Expect date parameter (yyyy-mm-dd). Limit-list values to changes since the givendate.

-

-changesBy CHANGESBY Expect string parameter. Limit -list valuesto changes by the given user.

-

-nochecksum Overwrite existing files even if the contentshave not changed.

False

-split Split applications into multiple files. False

-expComponentsEXPCOMPONENTS

Export application components. Allremaining parameters must be of formTYPE:ID.

-

Common Generator Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

Chapter 3Supported Liquibase Commands in SQLcl

3-6

Page 85: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Parameter Description Default

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

False

Example

SQL> lb genobject -type apex -applicationid 4900Exporting Application 4900Action successfully completed please review created file f4900.xml

ORDS RESTful Service Modules

Syntax

lb genobject -type {ORDS} -name NAME [-noenable] [-noprivs] [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Generates a change log for an ORDS (Oracle REST Data Services) RESTful servicemodule.

Named Parameters

Parameter Description Default

-type {ORDS} Generate output for ORDSmodule

-

-name NAME Module name -

-noenable Dictates whether theenable_schema call isincluded in the export

True

-noprivs Dictates whether Privs isincluded in the export

True

Common Generator Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

Chapter 3Supported Liquibase Commands in SQLcl

3-7

Page 86: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Parameter Description Default

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

False

Database Object

Syntax

lb genobject -type TYPE -name NAME [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Generates a change log for a specified database object.

Named Parameters

Parameter Description

-type TYPE Type of object in the database

-name NAME Object name

Common Generator Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

False

Database Object Types Supported

Type Type Type

AQ_QUEUE AQ_QUEUE_TABLE AQ_TRANSFORM

ASSOCIATION AUDIT AUDIT_OBJ

CLUSTER CONSTRAINT CONTEXT

DB_LINK DEFAULT_ROLE DIMENSION

Chapter 3Supported Liquibase Commands in SQLcl

3-8

Page 87: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Type Type Type

FGA_POLICY FUNCTION INDEX

JOB LIBRARY MATERIALIZED_VIEW

MATERIALIZED_VIEW_LOG OBJECT_GRANT OPERATOR

PACKAGE_SPEC PACKAGE_BODY PROCEDURE

PROFILE PROXY PUBLIC_SYNONYM

REF_CONSTRAINT REFRESH_GROUP RESOURCE_COST

RLS_CONTEXT RLS_GROUP RLS_POLICY

RMGR_CONSUMER_GROUP RMGR_PLAN RMGR_PLAN_DIRECTIVE

ROLE ROLLBACK_SEGMENT SEQUENCE

SYNONYM TABLE TABLESPACE

TRIGGER TRUSTED_DB_LINK TYPE

TYPE_SPEC TYPE_BODY USER

VIEW XMLSCHEMA XS_USER XS_ROLE

XS_ROLESET XS_ROLE_GRANT XS_SECURITY_CLASS

XS_DATA_SECURITY XS_ACL XS_ACL_PARAM

XS_NAMESPACE RMGR_INTITIAL_CONSUMER_GROUP

Example

SQL> lb genobject -type table -name zipcodes Action successfully completed please review created file zipcodes_table.xml

3.4.2 LB GENSCHEMAGenerates changelogs and controller file for the connected schema.

Syntax

liquibase(lb) genschema [-noreport] [-synonyms] [-grants] [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Captures the entire schema that the user is connected to in SQLcl. An XML fileis created in the current working directory for each object in the schema, and acontroller.xml file is created. The controller file is a change log that includes all files inthe proper order to enable the schema to be deployed correctly.

Named Parameters

Parameter Description Default

-noreport Suppress screen output True

-synonyms Include public synonyms False

-grants Include grants False

Chapter 3Supported Liquibase Commands in SQLcl

3-9

Page 88: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Common Generator Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

False

Example

SQL> lb genschemalb genschema[Type - TYPE_SPEC]: 153 ms[Type - TYPE_BODY]: 29 ms[Type - SEQUENCE]: 48 ms[Type - CLUSTER]: 27 ms[Type - TABLE]: 36 ms[Type - MATERIALIZED_VIEW_LOG]: 19 ms[Type - MATERIALIZED_VIEW]: 6 ms[Type - VIEW]: 148 ms[Type - REF_CONSTRAINT]: 272 ms[Type - DIMENSION]: 23 ms[Type - FUNCTION]: 27 ms[Type - PROCEDURE]: 64 ms[Type - PACKAGE_SPEC]: 171 ms[Type - DB_LINK]: 14 ms[Type - SYNONYM]: 22 ms[Type - INDEX]: 202 ms[Type - TRIGGER]: 51 ms[Type - PACKAGE_BODY]: 252 ms[Method loadCaptureTable]: 1864 ms[Method parseCaptureTableRecords]: 7342 ms[Method sortCaptureTable]: 30 ms[Method createExportChangeLogs]: 3 ms

Export Flags Used:Export Grants falseExport Synonyms false

Chapter 3Supported Liquibase Commands in SQLcl

3-10

Page 89: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

3.4.3 LB GENCONTROLFILEGenerates a blank controller.xml as a sample.

Syntax

liquibase(lb) gencontrolfile

Creates an empty changelog, master.xml, with a placeholder to include files in thecurrent working directory. You can use this command when you are creating your ownchangelog with custom changeset inclusions.

Example

SQL> lb gencontrolfileAction successfully completed please review created file controller.xml

3.4.4 LB UPDATEApplies the specified change log using the current connection.

Syntax

liquibase(lb) update -changelog CHANGELOG [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Enables you to apply database changes that you and other developers have added tothe change log file.

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Common Update Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-log Generate a log of workperformed

False

-debug Generate and displayadditional debug output

False

Chapter 3Supported Liquibase Commands in SQLcl

3-11

Page 90: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Example

SQL> lb update -changelog zipcodes_table.xmlScriptRunner Executed:zipcodes_table.xml::3b128595dbfbc34086c0a18ff38e090529999::Generated

3.4.5 LB UPDATESQLGenerates SQL to update the database to the current version.

Syntax

liquibase(lb) updatesql -changelog CHANGELOG [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug]

Generates and renders to the screen the SQL statements that would be applied for aspecific change log.

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Common Generator Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

False

Example

SQL> lb updatesql -changelog zipcodes_tablev2.xml-- *********************************************************************-- Update Database Script

Chapter 3Supported Liquibase Commands in SQLcl

3-12

Page 91: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

-- *********************************************************************-- Change Log: zipcodes_tablev2.xml-- Ran at: 6/3/20 12:49 PM-- Against: JDOE@jdbc:oracle:thin:@localhost:1521/ORCLPDB1-- Liquibase version: 3.8.9-- *********************************************************************

-- Lock DatabaseUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.1.175 (192.168.1.175)', LOCKGRANTED = TO_TIMESTAMP('2020-06-03 12:49:05.779', 'YYYY-MM-DD HH24:MI:SS.FF') WHERE ID = 1 AND LOCKED = 0;

-- Changeset zipcodes_tablev2.xml::3595dbfbc34086449c0a18ff38e090529999::GeneratedALTER TABLE "ZIPCODES" ADD ("LON" NUMBER)/

-- Logging Oracle Extension actions to the Database. DECLARE id varchar2(200) := '3595dbfbc34086449c0a18ff38e090529999';rawAction clob;rawSxml clob;myrow varchar2(2000);action clob := '';sxml clob := '';dep varchar2(200) := '1202945773';author varchar2(200) := 'Generated';filename varchar2(200) := 'zipcodes_tablev2.xml';insertlog varchar2(200) := 'insert into DATABASECHANGELOG_ACTIONS (id,author,filename,sql,sxml,deployment_id) values (:id,:author,:filename,:action,:sxml,:dep) returning rowid into :out';updateaction varchar2(200) := 'update DATABASECHANGELOG_ACTIONS set sql = sql ||:action where rowid = :myrow ';updatesxml varchar2(200) := 'update DATABASECHANGELOG_ACTIONS set sxml = sxml ||:sxml where rowid = :myrow ';begin action := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw(q'{QUxURVIgVEFCTEUgIlpJUENPREVTIiBBREQgKCJMT04iIE5VTUJFUikKLwogIC0tIE9SQS0zOTM0MTogQ2Fubm90IGNvbnZlcnQgYW4gZXhpc3RpbmcgY29sdW1uIGludG8gYW4gaWRlbnRpdHkgY29sdW1uLgov}')));sxml := utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw(q'{PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PFRBQkxFIHhtbG5zPSJodHRwOi8veG1sbnMub3JhY2xlLmNvbS9rdSIgdmVyc2lvbj0iMS4wIj4KICAgPFNDSEVNQT5TS1VUWjwvU0NIRU1BPgogICA8TkFNRT5aSVBDT0RFUzwvTkFNRT4KICAgPFJFTEFUSU9OQUxfVEFCTEU+CiAgICAgIDxDT0xfTElTVD4KICAgICAgICAgPENPTF9MSVNUX0lURU0+CiAgICAgICAgICAgIDxOQU1FPklEPC9OQU1FPgogICAgICAgICAgICA8REFUQVRZUEU+TlVNQkVSPC9EQVRBVFlQRT4KICAgICAgICAgICAgPE5PVF9OVUxMLz4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICAgICA8Q09MX0xJU1RfSVRFTT4KICAgICAgICAgICAgPE5BTUU+Q09ERTw

Chapter 3Supported Liquibase Commands in SQLcl

3-13

Page 92: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

vTkFNRT4KICAgICAgICAgICAgPERBVEFUWVBFPlZBUkNIQVIyPC9EQVRBVFlQRT4KICAgICAgICAgICAgPExFTkdUSD42PC9MRU5HVEg+CiAgICAgICAgICAgIDxDT0xMQVRFX05BTUU+VVNJTkdfTkxTX0NPTVA8L0NPTExBVEVfTkFNRT4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICAgICA8Q09MX0xJU1RfSVRFTT4KICAgICAgICAgICAgPE5BTUU+Q0lUWTwvTkFNRT4KICAgICAgICAgICAgPERBVEFUWVBFPlZBUkNIQVIyPC9EQVRBVFlQRT4KICAgICAgICAgICAgPExFTkdUSD41MDwvTEVOR1RIPgogICAgICAgICAgICA8Q09MTEFURV9OQU1FPlVTSU5HX05MU19DT01QPC9DT0xMQVRFX05BTUU+CiAgICAgICAgIDwvQ09MX0xJU1RfSVRFTT4KICAgICAgICAgPENPTF9MSVNUX0lURU0+CiAgICAgICAgICAgIDxOQU1FPlNUQVRFPC9OQU1FPgogICAgICAgICAgICA8REFUQVRZUEU+VkFSQ0hBUjI8L0RBVEFUWVBFPgogICAgICAgICAgICA8TEVOR1RIPjUwPC9MRU5HVEg+CiAgICAgICAgICAgIDxDT0xMQVRFX05BTUU+VVNJTkdfTkxTX0NPTVA8L0NPTExBVEVfTkFNRT4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICAgICA8Q09MX0xJU1RfSVRFTT4KICAgICAgICAgICAgPE5BTUU+Q09VTlRZPC9OQU1FPgogICAgICAgICAgICA8REFUQVRZUEU+VkFSQ0hBUjI8L0RBVEFUWVBFPgogICAgICAgICAgICA8TEVOR1RIPjUwPC9MRU5HVEg+CiAgICAgICAgICAgIDxDT0xMQVRFX05BTUU+VVNJTkdfTkxTX0NPTVA8L0NPTExBVEVfTkFNRT4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICAgICA8Q09MX0xJU1RfSVRFTT4KICAgICAgICAgICAgPE5BTUU+QVJFQV9DT0RFPC9OQU1FPgogICAgICAgICAgICA8REFUQVRZUEU+TlVNQkVSPC9EQVRBVFlQRT4KICAgICAgICAgICAgPFBSRUNJU0lPTj4zPC9QUkVDSVNJT04+CiAgICAgICAgICAgIDxTQ0FMRT4wPC9TQ0FMRT4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICAgICA8Q09MX0xJU1RfSVRFTT4KICAgICAgICAgICAgPE5BTUU+TEFUPC9OQU1FPgogICAgICAgICAgICA8REFUQVRZUEU+TlVNQkVSPC9EQVRBVFlQRT4KICAgICAgICAgPC9DT0xfTElTVF9JVEVNPgogICAgICA8L0NPTF9MSVNUPgogICAgICA8UFJJTUFSWV9LRVlfQ09OU1RSQUlOVF9MSVNUPgogICAgICAgICA8UFJJTUFSWV9LRVlfQ09OU1RSQUlOVF9MSVNUX0lURU0+CiAgICAgICAgICAgIDxDT0xfTElTVD4KICAgICAgICAgICAgICAgPENPTF9MSVNUX0lURU0+CiAgICAgICAgICAgICAgICAgIDxOQU1FPklEPC9OQU1FPgogICAgICAgICAgICAgICA8L0NPTF9MSVNUX0lURU0+CiAgICAgICAgICAgIDwvQ09MX0xJU1Q+CiAgICAgICAgICAgIDxVU0lOR19JTkRFWD4KICAgICAgICAgICAgICAgPElOREVYX0FUVFJJQlVURVM+CiAgICAgICAgICAgICAgICAgIDxQQ1RGUkVFPjEwPC9QQ1RGUkVFPgogICAgICAgICAgICAgICAgICA8SU5JVFJBTlM+MjwvSU5JVFJBTlM+CiAgICAgICAgICAgICAgICAgIDxNQVhUUkFOUz4yNTU8L01BWFRSQU5TPgogICAgICAgICAgICAgICAgICA8VEFCTEVTUEFDRT5VU0VSUzwvVEFCTEVTUEFDRT4KICAgICAgICAgICAgICAgICAgPExPR0dJTkc+WTwvTE9HR0lORz4KICAgICAgICAgICAgICAgPC9JTkRFWF9BVFRSSUJVVEVTPgogICAgICAgICAgICA8L1VTSU5HX0lOREVYPgogICAgICAgICA8L1BSSU1BUllfS0VZX0NPTlNUUkFJTlRfTElTVF9JVEVNPgogICAgICA8L1BSSU1BUllfS0VZX0NPTlNUUkFJTlRfTElTVD4KICAgICAgPERFRkFVTFRfQ09MTEFUSU9OPlVTSU5HX05MU19DT01QPC9ERUZBVUxUX0NPTExBVElPTj4KICAgICAgPFBIWVNJQ0FMX1BST1BFUlRJRVM+CiAgICAgICAgIDxIRUFQX1RBQkxFPgogICAgICAgICAgICA8U0VHTUVOVF9BVFRSSUJVVEVTPgogICAgICAgICAgICAgICA8U0VHTUVOVF9DUkVBVElPTl9ERUZFUlJFRC8+CiAgICAgICAgICAgICAgIDxQQ1RGUkVFPjEwPC9QQ1RGUkVFPgogICAgICAgICAgICAgICA8UENUVVNFRD40MDwvUENUVVNFRD4KICAgICAgICAgICAgICAgPElOSVRSQU5TPjE8L0lOSVRSQU5TPgogICAgICAgICAgICAgICA8TUFYVFJBTlM+MjU1PC9NQVhUUkFOUz4KICAgICAgICAgICAgICAgPFRBQkxFU1BBQ0U+VVNFUlM8L1RBQkxFU1BBQ0U+CiAgICAgICAgICAgICAgIDxMT0dHSU5HPlk8L0xPR0dJTkc+CiAgICAgICAgICAgIDwvU0VHTUVOVF9BVFRSSUJVVEVTPgogICAgICAgICAgICA8Q09NUFJFU1M+TjwvQ09NUFJFU1M+CiAgICAgICAgIDwvSEVBUF9UQUJMRT4KICAgICAgPC9QSFlTSUNBTF9QUk9QRVJUSUVTPgogICA8L1JFTEFUSU9OQUxfVEFCTEU+CjwvVEFCTEU+}')));

Chapter 3Supported Liquibase Commands in SQLcl

3-14

Page 93: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

execute immediate insertlog using id,author,filename,action,sxml,dep returning into myrow;end;/--;

INSERT INTO JDOE.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3595dbfbc34086449c0a18ff38e090529999', 'Generated', 'zipcodes_tablev2.xml', SYSTIMESTAMP, 2, '8:5262bd1c3989655295b5641b82868158', 'createSxmlObject objectName=ZIPCODES, ownerName=JDOE, '', 'EXECUTED', NULL, NULL, '3.8.9', '1202945773');

-- Release Database LockUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

3.4.6 LB ROLLBACKRolls back the state requested.

Syntax

liquibase(lb) rollback -changelog CHANGELOG [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-log] [-debug] (-count COUNT | -date DATE)

Rolls back changes starting from the last change applied using the input changelog. The count can be higher than the changes in the change log. 999, which is themaximum size, rolls back all the changes.

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Rollback Style Options

Select one of the following options:

Option Description

-count COUNT Number of changes to apply

-date DATE Date to roll back to

Chapter 3Supported Liquibase Commands in SQLcl

3-15

Page 94: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Common Update Parameters

Parameter Description Default

-context CONTEXT Specify changeset contexts toexecute

-

-label LABEL Filter the changelog usinglabels

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

-runalways Set runAlways value inchangeset

False

-log Generate a log of workperformed

False

-debug Generate and displayadditional debug output

False

Example

lb rollback -changelog zipcodes_tablev2.xml -count 100ScriptRunner Executed:zipcodes_tablev2.xml::3595dbfbc34086449c0a18ff38e090529999::Generated

3.4.7 LB ROLLBACKSQLWrites SQL to roll back the database to the state requested.

Syntax

liquibase(lb) rollbacksql -changelog CHANGELOG [-context CONTEXT] [-label LABEL] [-emit_schema] [-fail] [-replace] [-runonchange] [-runalways] [-debug] (-count COUNT | -date DATE)

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Rollback Style Options

Select one of the following options:

Chapter 3Supported Liquibase Commands in SQLcl

3-16

Page 95: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Option Description

-count COUNT Number of changes to apply

-date DATE Date to roll back to

Common Update Parameters

Parameter Description Default

-label LABEL Filter the changelog usinglabels

-

-context CONTEXT Specify changeset contexts toexecute

-

-emit_schema Include the schema whengenerating DDL

False

-fail Set failOnError value inchangeset

False

-replace Set replaceIfExists value inchangeset

False

-runonchange Set runOnChange value inchangeset

False

-runalways Set runAlways value inchangeset

False

-debug Generate and displayadditional debug output

-

Example

lb rollbacksql -changelog zipcodes_tablev2.xml -count 100

-- *********************************************************************-- Rollback 100 Change(s) Script-- *********************************************************************-- Change Log: zipcodes_tablev2.xml-- Ran at: 6/3/20 12:55 PM-- Against: JDOE@jdbc:oracle:thin:@localhost:1521/ORCLPDB1-- Liquibase version: 3.8.9-- *********************************************************************

-- Lock DatabaseUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.1.175 (192.168.1.175)', LOCKGRANTED = TO_TIMESTAMP('2020-06-03 12:55:19.175', 'YYYY-MM-DD HH24:MI:SS.FF') WHERE ID = 1 AND LOCKED = 0;

-- Rolling Back ChangeSet: zipcodes_tablev2.xml::3595dbfbc34086449c0a18ff38e090529999::Generated

ALTER TABLE "JDOE"."ZIPCODES" DROP ("LON");

delete from DATABASECHANGELOG_actions where id = '3595dbfbc34086449c0a18ff38e090529999' and

Chapter 3Supported Liquibase Commands in SQLcl

3-17

Page 96: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

filename = 'zipcodes_tablev2.xml' and author ='Generated' and sequence = (select Max(sequence) from DATABASECHANGELOG_actions where id = '3595dbfbc34086449c0a18ff38e090529999' and filename = 'zipcodes_tablev2.xml' and author ='Generated');

DELETE FROM JDOE.DATABASECHANGELOG WHERE ID = '3595dbfbc34086449c0a18ff38e090529999' AND AUTHOR = 'Generated' AND FILENAME = 'zipcodes_tablev2.xml';

-- Release Database LockUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

3.4.8 LB DIFFWrites a description of differences between two databases to standard output.

Syntax

liquibase(lb) diff -url URL -user USER -pass PASS [-noreport]

Displays differences between the current connection and the specified database.When the report is true, the output will be in the form of a text report. When thereport is false, which is the default, the output will be in the form of a change log.

The destination URL format is HOST:PORT:SID or HOST:PORT/SERVICE.

Named Parameters

Parameter Description Default

-url URL JDBC URL for destinationdatabase

-

-user USER Destination user -

-pass PASS Destination password -

-noreport Results output as achangelog, not a text report

True

Example

lb diff -url localhost:1521/ORCLPDB1 -user hr -password hr

Action successfully completed please review created file diffResult.txt

!more diffResult.txtReference Database: JDOE @ jdbc:oracle:thin:@localhost:1521/ORCLPDB1 (Default Schema: JDOE)Comparison Database: HR @ jdbc:oracle:thin:@localhost:1521/ORCLPDB1 (Default Schema: HR)Compared Schemas: JDOE -> HRProduct Name: EQUALProduct Version: EQUAL

Chapter 3Supported Liquibase Commands in SQLcl

3-18

Page 97: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Missing Catalog(s): NONEUnexpected Catalog(s): NONEChanged Catalog(s): NONEMissing Column(s): JDOE.ZIPCODES.AREA_CODE JDOE.DATABASECHANGELOG.AUTHOR JDOE.DATABASECHANGELOG_ACTIONS.AUTHOR JDOE.DATABASECHANGELOG_DETAILS.AUTHOR JDOE.ZIPCODES.CITY JDOE.ZIPCODES.CODE JDOE.DATABASECHANGELOG.COMMENTS JDOE.DATABASECHANGELOG_DETAILS.COMMENTS JDOE.DATABASECHANGELOG.CONTEXTS JDOE.DATABASECHANGELOG_DETAILS.CONTEXTS JDOE.ZIPCODES.COUNTY JDOE.DATABASECHANGELOG.DATEEXECUTED JDOE.DATABASECHANGELOG_DETAILS.DATEEXECUTED JDOE.DATABASECHANGELOG.DEPLOYMENT_ID JDOE.DATABASECHANGELOG_ACTIONS.DEPLOYMENT_ID JDOE.DATABASECHANGELOG_DETAILS.DEPLOYMENT_ID JDOE.DATABASECHANGELOG.DESCRIPTION JDOE.DATABASECHANGELOG_DETAILS.DESCRIPTION JDOE.DATABASECHANGELOG.EXECTYPE JDOE.DATABASECHANGELOG_DETAILS.EXECTYPE JDOE.DATABASECHANGELOG.FILENAME JDOE.DATABASECHANGELOG_ACTIONS.FILENAME JDOE.DATABASECHANGELOG_DETAILS.FILENAME JDOE.DATABASECHANGELOG.ID JDOE.DATABASECHANGELOGLOCK.ID JDOE.DATABASECHANGELOG_ACTIONS.ID JDOE.DATABASECHANGELOG_DETAILS.ID JDOE.ZIPCODES.ID JDOE.DATABASECHANGELOG.LABELS JDOE.DATABASECHANGELOG_DETAILS.LABELS JDOE.ZIPCODES.LAT JDOE.DATABASECHANGELOG.LIQUIBASE JDOE.DATABASECHANGELOG_DETAILS.LIQUIBASE JDOE.DATABASECHANGELOGLOCK.LOCKED JDOE.DATABASECHANGELOGLOCK.LOCKEDBY JDOE.DATABASECHANGELOGLOCK.LOCKGRANTED JDOE.ZIPCODES.LON JDOE.DATABASECHANGELOG.MD5SUM JDOE.DATABASECHANGELOG_DETAILS.MD5SUM JDOE.DATABASECHANGELOG.ORDEREXECUTED JDOE.DATABASECHANGELOG_ACTIONS.SEQUENCE JDOE.DATABASECHANGELOG_ACTIONS.SQL JDOE.DATABASECHANGELOG_DETAILS.SQL JDOE.ZIPCODES.STATE JDOE.DATABASECHANGELOG_ACTIONS.SXML JDOE.DATABASECHANGELOG_DETAILS.SXML JDOE.DATABASECHANGELOG.TAGUnexpected Column(s): NONEChanged Column(s): NONEMissing Foreign Key(s): NONEUnexpected Foreign Key(s): NONE

Chapter 3Supported Liquibase Commands in SQLcl

3-19

Page 98: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Changed Foreign Key(s): NONEMissing Index(s): PK_DATABASECHANGELOGLOCK UNIQUE ON JDOE.DATABASECHANGELOGLOCK(ID) SYS_C00122620 UNIQUE ON JDOE.DATABASECHANGELOG_ACTIONS(ID, AUTHOR, FILENAME, SEQUENCE) SYS_C00122637 UNIQUE ON JDOE.ZIPCODES(ID)Unexpected Index(s): NONEChanged Index(s): NONEMissing Primary Key(s): PK_DATABASECHANGELOGLOCK on JDOE.DATABASECHANGELOGLOCK(ID) SYS_C00122620 on JDOE.DATABASECHANGELOG_ACTIONS(ID, AUTHOR, FILENAME, SEQUENCE) SYS_C00122637 on JDOE.ZIPCODES(ID)Unexpected Primary Key(s): NONEChanged Primary Key(s): NONEMissing Sequence(s): NONEUnexpected Sequence(s): NONEChanged Sequence(s): NONEMissing Table(s): DATABASECHANGELOG DATABASECHANGELOGLOCK DATABASECHANGELOG_ACTIONS ZIPCODESUnexpected Table(s): NONEChanged Table(s): NONEMissing Unique Constraint(s): NONEUnexpected Unique Constraint(s): NONEChanged Unique Constraint(s): NONEMissing View(s): DATABASECHANGELOG_DETAILSUnexpected View(s): NONEChanged View(s): NONE

SQL> lb diff -url localhost:1521/ORCLPDB1 -user hr -password hr -noreport

Action successfully completed please review created file diffResult.xml

diffResult.xml!more diffResult.xml<?xml version="1.1" encoding="UTF-8" standalone="no"?><databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> <changeSet author="jdoe (generated)" id="1591203948991-1"> <createTable tableName="DATABASECHANGELOG_ACTIONS"> <column name="ID" type="VARCHAR2(255 BYTE)"> <constraints nullable="false"/> </column> <column name="SEQUENCE" type="NUMBER">

Chapter 3Supported Liquibase Commands in SQLcl

3-20

Page 99: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

<constraints nullable="false"/> </column> <column name="SQL" type="CLOB"/> <column name="SXML" type="CLOB"/> <column name="AUTHOR" type="VARCHAR2(255 BYTE)"> <constraints nullable="false"/> </column> <column name="FILENAME" type="VARCHAR2(255 BYTE)"> <constraints nullable="false"/> </column> <column name="DEPLOYMENT_ID" type="VARCHAR2(10 BYTE)"/> </createTable> </changeSet> <changeSet author="jdoe (generated)" id="1591203948991-2"> <createView fullDefinition="true" viewName="DATABASECHANGELOG_DETAILS">CREATE OR REPLACE FORCE VIEW DATABASECHANGELOG_DETAILS (DEPLOYMENT_ID, ID, AUTHOR, FILENAME, SQL, SXML, DATEEXECUTED, EXECTYPE, MD5SUM, DESCRIPTION, COMMENTS, LIQUIBASE, CONTEXTS, LABELS) AS SELECT da.deployment_id, da.id, da.author, da.filename, da.sql, da.sxml, d.dateexecuted, d.exectype, d.md5sum, d.description, d.comments, d.liquibase, d.contexts, d.labels FROM databasechangelog d LEFT JOIN databasechangelog_actions da ON d.id = da.id AND d.author = da.author AND d.filename = da.filename ORDER BY 1,7</createView> </changeSet> <changeSet author="jdoe (generated)" id="1591203948991-3"> <createTable tableName="ZIPCODES"> <column name="ID" type="NUMBER"> <constraints nullable="false" primaryKey="true" primaryKeyName="SYS_C00122637"/> </column> <column name="CODE" type="VARCHAR2(6 BYTE)"/> <column name="CITY" type="VARCHAR2(50 BYTE)"/> <column name="STATE" type="VARCHAR2(50 BYTE)"/> <column name="COUNTY" type="VARCHAR2(50 BYTE)"/> <column name="AREA_CODE" type="NUMBER(3, 0)"/> <column name="LAT" type="NUMBER"/> <column name="LON" type="NUMBER"/> </createTable> </changeSet> <changeSet author="jdoe (generated)" id="1591203948991-4"> <createIndex indexName="SYS_C00122620" tableName="DATABASECHANGELOG_ACTIONS" unique="true"> <column name="ID"/> <column name="AUTHOR"/> <column name="FILENAME"/> <column name="SEQUENCE"/> </createIndex> </changeSet> <changeSet author="skutz (generated)" id="1591203948991-5">

Chapter 3Supported Liquibase Commands in SQLcl

3-21

Page 100: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

<addPrimaryKey columnNames="ID, AUTHOR, FILENAME, SEQUENCE" constraintName="SYS_C00122620" forIndexName="SYS_C00122620" tableName="DATABASECHANGELOG_ACTIONS"/> </changeSet></databaseChangeLog>

3.4.9 LB DBDOCGenerates Javadoc-like documentation based on the current database and changelog.

Syntax

liquibase(lb) dbdoc -changelog CHANGELOG -dir DIR [-context CONTEXT] [-label LABEL]

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

-dir DIR Saves all files in the given directory, example,-dir some/sub/directory

Common Update Parameters

Parameter Description

-context CONTEXT Specify the changeset contexts to execute

-label LABEL Filter the changelog using labels

Example

SQL> lb dbdoc -changelog states_table.xml -dir ./docSQL> !ls -l ./doctotal 56drwxr-xr-x 3 jdoe staff 96 Jun 3 13:25 authors-rw-r--r-- 1 jdoe staff 449 Jun 3 13:25 authors.htmldrwxr-xr-x 3 jdoe staff 96 Jun 3 13:25 changelogs-rw-r--r-- 1 jdoe staff 474 Jun 3 13:25 changelogs.htmldrwxr-xr-x 31 jdoe staff 992 Jun 3 13:25 columns-rw-r--r-- 1 jdoe staff 555 Jun 3 13:25 currenttables.html-rw-r--r-- 1 jdoe staff 899 Jun 3 13:25 globalnav.html-rw-r--r-- 1 jdoe staff 769 Jun 3 13:25 index.html-rw-r--r-- 1 jdoe staff 445 Jun 3 13:25 overview-summary.htmldrwxr-xr-x 4 jdoe staff 128 Jun 3 13:25 pendingdrwxr-xr-x 3 jdoe staff 96 Jun 3 13:25 recent-rw-r--r-- 1 jdoe staff 1202 Jun 3 13:25 stylesheet.cssdrwxr-xr-x 4 jdoe staff 128 Jun 3 13:25 tables

Figure 3-1 shows the index page that is created by the DBDOC command. It enablesyou to navigate the various details of the changelog used to produce the document.

Chapter 3Supported Liquibase Commands in SQLcl

3-22

Page 101: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Figure 3-1 Index Page

3.4.10 LB CHANGELOGSYNCWrites the SQL statements to mark all changes in the change log as executed in thedatabase to a file.

Syntax

liquibase(lb) changelogsync -changelog CHANGELOG

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Example

SQL> lb changelogsync -changelog zipcodes_table.xml-- *********************************************************************-- SQL to add all changesets to database history table-- *********************************************************************

Chapter 3Supported Liquibase Commands in SQLcl

3-23

Page 102: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

-- Change Log: zipcodes_table.xml-- Ran at: 6/3/20 1:28 PM-- Against: JDOE@jdbc:oracle:thin:@localhost:1521/ORCLPDB1-- Liquibase version: 3.8.9-- *********************************************************************

-- Lock DatabaseUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.1.175 (192.168.1.175)', LOCKGRANTED = TO_TIMESTAMP('2020-06-03 13:28:24.686', 'YYYY-MM-DD HH24:MI:SS.FF') WHERE ID = 1 AND LOCKED = 0;

INSERT INTO JDOE.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('e6568d24910039bf3d4241e7edff5ec82612c60f', 'Generated', 'zipcodes_table.xml', SYSTIMESTAMP, 3, '8:e4fe731b3a40f479dec11e234e4a69ac', 'createSxmlObject objectName=ZIPCODES, ownerName=JDOE', '', 'EXECUTED', NULL, NULL, '3.8.9', '1205304697');

-- Release Database LockUPDATE JDOE.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

3.4.11 LB CLEARCHECKSUMSRemoves current checksums from the database. For the next update, changesets thathave already been deployed will have their checksums recomputed, and changesetsthat have not been deployed will be deployed.

Syntax

liquibase(lb) clearchecksums -changelog CHANGELOG

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Example

SQL> lb clearchecksums -changelog zipcodes_table.xml

3.4.12 LB LISTLOCKSLists who currently has locks on the database change log.

Chapter 3Supported Liquibase Commands in SQLcl

3-24

Page 103: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Syntax

liquibase(lb) listlocks -changelog CHANGELOG

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Example

SQL> lb listlocks -changelog zipcodes_table.xmlNo locks currently in use

3.4.13 LB RELEASELOCKSReleases all locks on the database change log.

Syntax

liquibase(lb) releaselocks -changelog CHANGELOG

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Example

SQL> lb releaselocks -changelog zipcodes_table.xml

3.4.14 LB STATUSOutputs a list of change sets that have not been applied.

Syntax

liquibase(lb) status -changelog CHANGELOG

Checks the status of the change log using the current connection. This shows if thechange log has been applied and the result of the change log.

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Chapter 3Supported Liquibase Commands in SQLcl

3-25

Page 104: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Example

SQL> lb status -changelog zipcodes_table.xml

1 change sets have not been applied to JDOE@jdbc:oracle:thin:@localhost:1521/ORCLPDB1 zipcodes_table.xml::e6568d24910039bf3d4241e7edff5ec82612c60f::Generated

3.4.15 LB VALIDATEChecks the changelog for errors.

Syntax

liquibase(lb) validate -changelog CHANGELOG

Named Parameters

Parameter Description

-changelog CHANGELOG Specify the changelog file to use

Example

lb validate -changelog zipcodes_table.xmlNo issues were found in file zipcodes _table.xml, validation passed

3.4.16 LB VERSIONDisplay product version information.

Syntax

liquibase(lb) version

Example

SQL> lb version

Liquibase version: 3.8.9Extension Version: 2.0.0.0.0

3.4.17 LB HELPLists the available Liquibase commands.

Syntax

liquibase(lb) help command

Chapter 3Supported Liquibase Commands in SQLcl

3-26

Page 105: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Type a command with no options for help on a specific command.

Example

SQL> lb helpusage: lb COMMAND ...

Commands:The following commands are available within the liquibase feature.lb help COMMAND for command specific help

COMMANDgenobject Generate change log for a specific database objectgenschema Generate changelogs and controller for connected schemagencontrolfile Remove locks held by changelogupdate Updates database to current versionupdatesql Generates SQL to update database to current versionrollback Rolls back the state requestedrollbacksql Writes SQL to roll back the database to the state requesteddiff Writes description of differences between two databases to standard out.dbdoc Generates Javadoc-like documentation based on current database and change log.changelogsync Mark all changes as executed in the database.clearchecksums Removes current checksums from database.listlocks Lists who currently has locks on the database changelog.releaselocks Releases all locks on the database changelog.status Outputs list of unrun change sets.validate Checks the changelog for errors.version Display product version information

3.5 DATABASECHANGELOG_DETAILS VIEW

DATABASECHANGELOG_DETAILS is a view that consolidates information from theDATABASECHANGELOG and DATABASECHANGELOG_ACTIONS tables for easierreporting and troubleshooting.

This view enables a better understanding of the status and work performed by eachchange applied to the database. The SQL column shows the actual SQL that was runin the database. The SXML column shows the state of the object prior to the changebeing applied.

Example

SQL> desc DATABASECHANGELOG_DETAILS

Name Null? Type ________________ ___________ ________________ DEPLOYMENT_ID VARCHAR2(10)

Chapter 3DATABASECHANGELOG_DETAILS VIEW

3-27

Page 106: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

ID VARCHAR2(255) AUTHOR VARCHAR2(255) FILENAME VARCHAR2(255) SQL CLOB SXML CLOB DATEEXECUTED NOT NULL TIMESTAMP(6) EXECTYPE NOT NULL VARCHAR2(10) MD5SUM VARCHAR2(35) DESCRIPTION VARCHAR2(255) COMMENTS VARCHAR2(255) LIQUIBASE VARCHAR2(20) CONTEXTS VARCHAR2(255) LABELS VARCHAR2(255)

3.6 ChangeSets in LiquibaseThe following table lists the changeSets and provides a description for each of them.To learn more about changeSets, see <changeSet> tag.

ChangeSet Description

CreateOracleConstraint Creates a constraint from SQL.

CreateOracleDirectory Creates a directory from SQL.

CreateOracleFunction Creates a function from SQL.

CreateOracleGrant Creates a grant from SQL.

CreateOraclePackageBody Creates a package body from SQL.

CreateOracleJob Creates a DBMS_Scheduler job from SQL.

CreateOraclePackageSpec Creates a package specification from SQL.

CreateOracleProcedure Creates a procedure from SQL.

CreateOraclePublicSynonym Creates a public synonym from SQL.

CreateOracleRefConstraint Creates a referential constraint from SQL.

CreateOracleSynonym Creates a synonym from SQL.

CreateOracleTrigger Creates a trigger from SQL.

CreateOracleTypeBody Creates a type body from SQL.

CreateOracleTypeSpec Creates a type spec from SQL.

CreateSxmlObject Creates a function from SQL.

DropOracleConstraint Drops a constraint.

DropOracleFunction Drops a function.

DropOracleGrant Drops a grant.

DropOraclePackageBody Drops a package body.

DropOraclePackageSpec Drops a package specification.

DropOracleProcedure Drops a procedure.

DropOracleRefConstraint Drops a referential constraint.

DropOracleTrigger Drops a trigger.

DropOracleTypeBody Drops a type body.

DropOracleTypeSpec Drops a type specification.

DropOracleSynonym Drops a synonym.

Chapter 3ChangeSets in Liquibase

3-28

Page 107: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

ChangeSet Description

DropSxmlObject Drops an SXML object. If the object wascreated through createSxmlObject, this rollsback the object to the last state. If not created,the object is just dropped. This is primarilyused internally for SXML object handling.

RunOracleScript Executes a SQL script using the SQLcl engineand therefore supports all SQLcl commands.Supports script, file, and URL sources. SeeExecute Custom SQL with RunOracleScript

3.7 Examples Using LiquibaseSome examples of using the Liquibase functionality for database change managementtasks:

• Capture and Deploy an Object

• Capture and Deploy a Schema

• Generate the Master Control File

• Capture and Deploy a Schema and then Upgrade it and Redeploy

• Execute Custom SQL with RunOracleScript

3.7.1 Capture and Deploy an Object

To deploy the EMPLOYEES table from HR to HR2:

Note:

The syntax for the GENOBJECT command has changed. See LBGENOBJECT

1. Connect to HR.

SQL> connect hr/hrConnected.

2. Capture the object.

SQL> lb genobject -type table -name employeesAction successfully completed please review created file employees_table1.xml

3. Connect to the other user.

SQL> connect hr2/hr2Connected.

Chapter 3Examples Using Liquibase

3-29

Page 108: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

4. Ensure the object does not already exist.

SQL> drop table employeesTable EMPLOYEES dropped.

5. Create the object in the current schema.

Note:

As the schema name has changed, you must set include schema tofalse or it will try and create the object in the hr schema.

SQL> lb update -changelog employees_table.xmlScriptRunner Executed:/Users/jdoe/Documents/lbtest/v2/employees_table.xml::6486f968-93fe-4e1c-ac59-17ef392e1423::Generated

6. Verify the object was created.

SQL> desc employees ---- ----- ------ EMPLOYEE_ID NOT NULL NUMBER(6) FIRST_NAME VARCHAR2(20) LAST_NAME NOT NULL VARCHAR2(25) EMAIL NOT NULL VARCHAR2(25) PHONE_NUMBER VARCHAR2(20) HIRE_DATE NOT NULL DATE JOB_ID NOT NULL VARCHAR2(10) SALARY NUMBER(8,2) COMMISSION_PCT NUMBER(2,2) MANAGER_ID NUMBER(6) DEPARTMENT_ID NUMBER(4)

3.7.2 Capture and Deploy a Schema

To capture the HR schema and reproduce it in the HR2 schema:

sql.exe hr/hr@pdb1

SQL> lb genschema[Type - TYPE_SPEC]: 107 ms[Type - TYPE_BODY]: 80 ms[Type - SEQUENCE]: 26 ms[Type - CLUSTER]: 25 ms[Type - TABLE]: 721 ms[Type - MATERIALIZED_VIEW_LOG]: 18 ms[Type - MATERIALIZED_VIEW]: 9 ms[Type - VIEW]: 81 ms[Type - REF_CONSTRAINT]: 128 ms[Type - DIMENSION]: 14 ms[Type - FUNCTION]: 43 ms

Chapter 3Examples Using Liquibase

3-30

Page 109: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

[Type - PROCEDURE]: 47 ms[Type - PACKAGE_SPEC]: 24 ms[Type - DB_LINK]: 14 ms[Type - SYNONYM]: 23 ms[Type - INDEX]: 102 ms[Type - TRIGGER]: 25 ms[Type - PACKAGE_BODY]: 33 ms[Type - JOB]: 14 ms[Method loadCaptureTable]: 1534 ms[Method parseCaptureTableRecords]: 5479 ms[Method sortCaptureTable]: 37 ms[Method createExportChangeLogs]: 0 ms

Export Flags Used:

Export Grants falseExport Synonyms falseSQL>

setup the hr2 user --

drop user hr2 cascade;create user hr2 identified by hr2;grant connect,resource, create view to hr2;alter user hr2 quota unlimited on users;alter user hr2 quota unlimited on sysaux;

SQL> drop user hr2 cascade;User HR2 dropped.

SQL> create user hr2 identified by hr2;User HR2 created.

SQL> grant connect,resource, create view to hr2;Grant succeeded.

SQL> alter user hr2 quota unlimited on users;User HR2 altered.

SQL> alter user hr2 quota unlimited on sysaux;User HR2 altered.

SQL> connect hr2/hr2Connected.

SQL> lb update -changelog controller.xmlScriptRunner Executed:person_typ_type_spec.xml::32492b89db4b0e2a115caa3e7e6c3d29c11fa1db::GeneratedScriptRunner Executed:emp_person_typ_type_spec.xml::cb314e652bc79126fa0a2b5261720d15728c7e04::GeneratedScriptRunner Executed:people_typ_type_spec.xml::cc5c2298290e3ce2dc1563da82ddd9ea33a768c8::Generated

Chapter 3Examples Using Liquibase

3-31

Page 110: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

SQL> tables

TABLES___________________________DATABASECHANGELOGDATABASECHANGELOGLOCKDATABASECHANGELOG_ACTIONSCOUNTRIESREGIONSLOCATIONSDEPARTMENTSJOBSEMPLOYEESJOB_HISTORY

10 rows selected.

3.7.3 Generate the Master Control File

SQL> lb gencontrolfileAction successfully completed please review created file controller.xml

SQL> !more controller.xml<?xml version="1.0" encoding="UTF-8"?><databaseChangeLogxmlns="http://www.liquibase.org/xml/ns/dbchangelog"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangeloghttp://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"><include file="{filename.xml}"/></databaseChangeLog>

3.7.4 Capture and Deploy a Schema and then Upgrade it andRedeploy

The steps are:

1. Migrate the HR schema to the HR2 schema, then modify the HR schema andupdate HR2.

setup the hr2 user --drop user hr2 cascade;create user hr2 identified by hr2;grant connect,resource, create view to hr2;alter user hr2 quota unlimited on users;alter user hr2 quota unlimited on sysaux;

SQL> drop user hr2 cascade;User HR2 dropped.

Chapter 3Examples Using Liquibase

3-32

Page 111: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

SQL> create user hr2 identified by hr2;User HR2 created.

SQL> grant connect,resource, create view to hr2;Grant succeeded.

SQL> alter user hr2 quota unlimited on users;User HR2 altered.

SQL> alter user hr2 quota unlimited on sysaux;User HR2 altered.

SQL> connect hr2/hr2Connected.

SQL> !mkdir v1

SQL> cd v1SQL> connect hr/hrConnected.SQL> lb genschema[Type - TYPE_SPEC]: 185 ms[Type - TYPE_BODY]: 84 ms[Type - SEQUENCE]: 41 ms[Type - CLUSTER]: 38 ms[Type - TABLE]: 702 ms[Type - MATERIALIZED_VIEW_LOG]: 20 ms[Type - MATERIALIZED_VIEW]: 10 ms[Type - VIEW]: 85 ms[Type - REF_CONSTRAINT]: 142 ms[Type - DIMENSION]: 21 ms[Type - FUNCTION]: 45 ms[Type - PROCEDURE]: 52 ms[Type - PACKAGE_SPEC]: 30 ms[Type - DB_LINK]: 18 ms[Type - SYNONYM]: 30 ms[Type - INDEX]: 125 ms[Type - TRIGGER]: 31 ms[Type - PACKAGE_BODY]: 39 ms[Type - JOB]: 19 ms[Method loadCaptureTable]: 1717 ms[Method parseCaptureTableRecords]: 6243 ms[Method sortCaptureTable]: 42 ms[Method createExportChangeLogs]: 1 ms

Export Flags Used:Export Grants falseExport Synonyms false

2. Modify the HR schema.

SQL> ALTER TABLE DEPARTMENTS ADD (COLUMN1 VARCHAR2(20) );Table DEPARTMENTS altered.

SQL> ALTER TABLE COUNTRIES ADD (COLUMN1 VARCHAR2(20) );

Chapter 3Examples Using Liquibase

3-33

Page 112: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Table COUNTRIES altered.

SQL> ALTER TABLE LOCATIONS ADD (COLUMN1 VARCHAR2(20) );Table LOCATIONS altered.

SQL> CREATE OR REPLACE PROCEDURE PROCEDURE2 (PARAM1 IN VARCHAR2,PARAM2 IN VARCHAR2,PARAM3 IN VARCHAR2, PARAM4 IN VARCHAR2) AS BEGIN NULL; END PROCEDURE2;Procedure PROCEDURE2 compiled

3. Make a change to the v2 directory.

SQL> cd .. SQL> !mkdir v2 SQL> cd v2

4. Export v2 of the HR schema.

SQL> lb genschema[Type - TYPE_SPEC]: 102 ms[Type - TYPE_BODY]: 74 ms[Type - SEQUENCE]: 26 ms[Type - CLUSTER]: 25 ms[Type - TABLE]: 534 ms[Type - MATERIALIZED_VIEW_LOG]: 13 ms[Type - MATERIALIZED_VIEW]: 10 ms[Type - VIEW]: 78 ms[Type - REF_CONSTRAINT]: 119 ms[Type - DIMENSION]: 15 ms[Type - FUNCTION]: 44 ms[Type - PROCEDURE]: 46 ms[Type - PACKAGE_SPEC]: 25 ms[Type - DB_LINK]: 14 ms[Type - SYNONYM]: 24 ms[Type - INDEX]: 100 ms[Type - TRIGGER]: 25 ms[Type - PACKAGE_BODY]: 34 ms[Type - JOB]: 14 ms[Method loadCaptureTable]: 1322 ms[Method parseCaptureTableRecords]: 5452 ms[Method sortCaptureTable]: 37 ms[Method createExportChangeLogs]: 0 msExport Flags Used:Export Grants falseExport Synonyms false

To import v1, change back to the v1 directory and connect as HR2.

SQL> cd ..SQL> connect hr2/hr2 Connected.

Chapter 3Examples Using Liquibase

3-34

Page 113: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

5. Now import the capture into the HR2 schema.

SQL> lb update -changelog controller.xmlScriptRunner Executed:person_typ_type_spec.xml::f9d8cb37f8030674b1d0060b054254a28f96dd51::GeneratedScriptRunner Executed:emp_person_typ_type_spec.xml::cabf96af49def8fc164a6c0aa7be69c1a78d46c4::GeneratedScriptRunner Executed:people_typ_type_spec.xml::6a98e2a2ec56a7ca6b716a114804081f8760ec78::GeneratedScriptRunner Executed:dept_persons_typ_type_spec.xml::e250a6757e4e023a30c1b9f458149e4dfa0ad6bc::GeneratedScriptRunner Executed:employee_type_type_spec.xml::aa2ef7c172e6df08e4082a4f139f4c6edf6e14bc::GeneratedScriptRunner Executed:person_typ_type_body.xml::bd29fd1d0827b70ae4b644781eeb9a69f7caf956::GeneratedScriptRunner Executed:departments_seq_sequence.xml::ea03838db9dc0613a5128090c9388ff1b8dc8a1a::GeneratedScriptRunner Executed:locations_seq_sequence.xml::2aba6107a95a977632161be9ca920bdb836f18fc::GeneratedScriptRunner Executed:employees_seq_sequence.xml::2379ab3cbd7f84f52f6596fa16479bb6ccf721ca::GeneratedScriptRunner Executed:countries_table.xml::8e87e94fd74b172dc76d950216e057827e2e3f83::GeneratedScriptRunner Executed:countries_comments.xml::8797a740e38cf3ef7da36b6ba4aa5497cfd6b457::Generated

6. Check a table to verify.

SQL> show userUSER is "HR2"

SQL> desc departments

Name Null? Type__________________ ___________ _______________DEPARTMENT_ID NOT NULL NUMBER(4)DEPARTMENT_NAME NOT NULL VARCHAR2(30)MANAGER_ID NUMBER(6)LOCATION_ID NUMBER(4)

7. Switch to v2 and import the capture.

SQL> cd v2SQL> lb update -changelog controller.xml

Chapter 3Examples Using Liquibase

3-35

Page 114: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

ScriptRunner Executed:countries_table.xml::31a15fa402822ae67ae588a74e2b0d9506f1dc26::GeneratedScriptRunner Executed:locations_table.xml::9548f26f7f8b53bc3639869e23b118b4fe09363b::GeneratedScriptRunner Executed:departments_table.xml::560727e73ed902cd0ad3e25793987d323580b823::GeneratedScriptRunner Executed:emp_email_uk_index.xml::99a0278c50a75912985023c6a075514ec939d233::GeneratedScriptRunner Executed:secure_employees_trigger.xml::cfe2f3f3443973ee9d43f4cc77701d211c6023ba::GeneratedScriptRunner Executed:update_job_history_trigger.xml::aa8e35e3de04b9bb0ef3c47885f175e20be6c59e::Generated

8. Verify that you are on v2.

SQL> desc departments

Name Null? Type__________________ ___________ _______________DEPARTMENT_ID NOT NULL NUMBER(4)DEPARTMENT_NAME NOT NULL VARCHAR2(30)MANAGER_ID NUMBER(6)LOCATION_ID NUMBER(4)COLUMN1 NUMBER

3.7.5 Execute Custom SQL with RunOracleScript

Create a RunOracleScript changeset where the source can be a script, a link to afile, or a URL. The changeset in this example shows how to create a table and usePL/SQL variables in the script.

#### SCRIPT - STRING EXAMPLE ####

<?xml version="1.0" encoding="UTF-8"?><databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n0="http://www.oracle.com/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <changeSet id="runScriptString" author="jdoe"> <n0:runOracleScript objectName="myScript" ownerName="JDOE" sourceType="STRING"> <n0:source><![CDATA[DEFINE table_name = RUNNERSTRING;create table &&table_name (id number);]]></n0:source> </n0:runOracleScript> </changeSet>

Chapter 3Examples Using Liquibase

3-36

Page 115: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

</databaseChangeLog>---------------------------------------------------------------------------------------------------------------------------------------------------- SQL> tablesno rows selected SQL> lb update -changelog stringscript.xmlScriptRunner Executed:stringscript.xml::runScriptString::jdoe SQL> tablesTABLES ____________________________ DATABASECHANGELOGLOCK DATABASECHANGELOG DATABASECHANGELOG_ACTIONS RUNNERSTRING

#### SCRIPT - FILE EXAMPLE ####

filescript.xml----------------------------------------------------------------------------------------------------------------------------------------------------<?xml version="1.0" encoding="UTF-8"?><databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n0="http://www.oracle.com/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <changeSet id="RunScriptFile" author="jdoe"> <n0:runOracleScript objectName="myScript" ownerName="JDOE" sourceType="FILE"> <n0:source><![CDATA[/Volumes/SSD/work/sqlcl/scriptFILE.sql]]></n0:source> </n0:runOracleScript> </changeSet></databaseChangeLog>----------------------------------------------------------------------------------------------------------------------------------------------------

scriptFILE.sql-------------------------------------------------------------------------------------------------------------------------------------------CREATE TABLE RUNNERFILE (id number)-------------------------------------------------------------------------------------------------------------------------------------------

SQL> tablesTABLES ____________________________

Chapter 3Examples Using Liquibase

3-37

Page 116: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

DATABASECHANGELOGLOCK DATABASECHANGELOG DATABASECHANGELOG_ACTIONS RUNNERSTRING

SQL> lb update -changelog filescript.xmlScriptRunner Executed:/Volumes/SSD/work/sqlcl/filescript.xml::RunScriptFile::jdoe

SQL> tablesTABLES ____________________________ DATABASECHANGELOGLOCK DATABASECHANGELOG DATABASECHANGELOG_ACTIONS RUNNERSTRING RUNNERFILE

#### SCRIPT - URL EXAMPLE ####

urlscript.xml----------------------------------------------------------------------------------------------------------------------------------------------------<?xml version="1.0" encoding="UTF-8"?><databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n0="http://www.oracle.com/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <changeSet id="RunScriptUrl" author="jdoe"> <n0:runOracleScript objectName="myScript" ownerName="JDOE" sourceType="URL"> <n0:source><![CDATA[file:///Volumes/SSD/work/sqlcl/scriptURL.sql]]></n0:source> </n0:runOracleScript> </changeSet></databaseChangeLog>----------------------------------------------------------------------------------------------------------------------------------------------------

scriptURL.sql-------------------------------------------------------------------------------------------------------------------------------------------CREATE TABLE RUNNERURL (id number)-------------------------------------------------------------------------------------------------------------------------------------------

SQL> tablesTABLES ____________________________ DATABASECHANGELOGLOCK

Chapter 3Examples Using Liquibase

3-38

Page 117: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

DATABASECHANGELOG DATABASECHANGELOG_ACTIONS RUNNERSTRING RUNNERFILE

SQL> lb update -changelog urlscript.xmlScriptRunner Executed:/Volumes/SSD/work/sqlcl/urlscript.xml::RunScriptUrl::jdoe

SQL> tablesTABLES ____________________________ DATABASECHANGELOGLOCK DATABASECHANGELOG DATABASECHANGELOG_ACTIONS RUNNERSTRING RUNNERFILE RUNNERURL

Chapter 3Examples Using Liquibase

3-39

Page 118: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

4PGQL Plug-in for SQLcl

Property Graph Query Language (PGQL) is a graph pattern-matching query languagefor the property graph data model. The PGQL plug-in enables execution andtranslation of PGQL statements from the command line in SQLcl.

The PGQL plug-in for SQLcl is available with Oracle Graph Server and Client Release20.3 and later releases.

See Also:

Property Graph Query Language for more information about PGQL.

This chapter covers the following topics:

• Downloading and Installing

• About PGQL Commands

• Examples

4.1 Downloading and InstallingYou can download the plug-in either from Oracle Software Delivery Cloud (search for"Oracle Graph Server and Client") or from Oracle Graph Server and Client Downloads.

To install the PGQL plug-in for SQLcl, you need to unzip the downloaded plug-in intothe lib/ext directory of your local SQLcl installation.

4.2 About PGQL CommandsTo run PGQL statements against a database, start SQLcl and then turn on PGQLmode by using the following command:

pgql auto on;

After PGQL mode is turned on, all subsequent SELECT, INSERT, UPDATE, DELETE,CREATE, and DROP statements are considered as PGQL statements.

You can also provide different arguments when turning on PGQL mode:

pgql auto on [args]

The possible arguments are:

4-1

Page 119: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

• graph <graph_name>: Make queries run against the specified graph.

• execute: Turn on PGQL execution.

• executeonly: Turn on PGQL execution and do not show PGQL-to-SQL translation.

• translate: Show PGQL-to-SQL translation.

• translateonly: Show PGQL-to-SQL translation and turn off PGQL execution.

• parallel <parallel>: Run (or translate) PGQL queries using the specifiedparallel value.

• dynamic_sampling <dynamic_sampling>: Run (or translate) PGQL queries usingthe specified dynamic sampling value.

By default, the graph value is not set, PGQL execution is turned on, and PGQL to SQLtranslation is turned off. The default value for parallel is 0, and the default value fordynamic_sampling is 6.

To run SQL statements again, turn PGQL mode off:

pgql auto off;

To reset all parameters to their default values, turn PGQL mode off and then turn onagain.

4.3 ExamplesThis section provides some examples:

• Turn On PGQL Mode

• Create a Property Graph and Execute a Query

• Define a Graph Parameter

• Show SQL Translation Using Parallel Value 2

• Turn Off PGQL Mode

Turn On PGQL Mode

This example turns PGQL mode on. The PGQL prompt appears when PGQL isenabled.

SQL> pgql auto on; PGQL Auto enabled for graph=[null], execute=[true], translate=[false]PGQL>

Create a Property Graph and Execute a Query

This example creates a property graph and executes a query against the newlycreated "scott_hr" graph.

PGQL> CREATE PROPERTY GRAPH scott_hr 2 VERTEX TABLES ( 3 emp KEY(empno) LABEL Employee

Chapter 4Examples

4-2

Page 120: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

4 PROPERTIES ARE ALL COLUMNS EXCEPT ( deptno ), 5 dept KEY(deptno) LABEL Department 6 PROPERTIES ( deptno, dname ) 7 ) 8 EDGE TABLES ( 9 emp AS works_for 10 SOURCE KEY ( empno ) REFERENCES emp 11 DESTINATION KEY ( deptno ) REFERENCES dept 12 NO PROPERTIES 13 ); Graph created PGQL> column name format a15;PGQL> SELECT e.ename AS name 2 FROM MATCH (e:Employee) ON scott_hr 3 ORDER by e.ename 4 LIMIT 4; NAME ---------------ADAMS ALLEN BLAKE CLARK

Define a Graph Parameter

You can define a graph parameter to run all PGQL queries against a particular graph.This example sets graph to scott_hr. Note that the query does not need an ONclause.

PGQL> pgql auto on graph scott_hr; PGQL Auto enabled for graph=[SCOTT_HR], execute=[true], translate=[false] PGQL> column department format a20;PGQL> column employees format a10;PGQL> SELECT d.dname AS department, COUNT(e) AS employees 2 FROM MATCH (e:Employee) -[:works_for]-> (d:Department) 3 GROUP BY d 4 ORDER BY employees 5* LIMIT 3; DEPARTMENT EMPLOYEES-------------------- ----------ACCOUNTING 3 RESEARCH 5 SALES 6

Chapter 4Examples

4-3

Page 121: Oracle® SQLcl User's Guide · Generate the Master Control File3-32. Capture and Deploy a Schema and then Upgrade it and Redeploy3-32. Execute Custom SQL with RunOracleScript3-36

Show SQL Translation Using Parallel Value 2

This example shows the SQL translation of a PGQL query using a parallel value of 2.Note that the SQL translation has a hint using the defined parallel value.

SQL> pgql auto on translateonly parallel 2; PGQL Auto enabled for graph=[null], execute=[false], translate=[true]PGQL> SELECT id(n) FROM MATCH (n) ON scott_hr;SELECT /*+ parallel(2) */ * FROM(SELECT 7 AS "id(n)$T",to_nchar(T0$0.VID,'TM9','NLS_Numeric_Characters=''.,''') AS "id(n)$V",T0$0.VID AS "id(n)$VN",to_timestamp_tz(null) AS "id(n)$VT"FROM "SCOTT".SCOTT_HRVD$ T0$0);

Turn Off PGQL Mode

This example shows how to turn PGQL mode off.

PGQL> pgql auto off; PGQL Auto disabledSQL>

Chapter 4Examples

4-4