SQLcl: A Modern Command Line Interface to the Oracle Database

Slides:



Advertisements
Similar presentations
CC SQL Utilities.
Advertisements

Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer Tips & Tricks Jeff Smith
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer What’s New in Version 4.1 Jeff Smith
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Week 5 – Chap. 5 Data Transfer DBAs often must transfer data to and from text files, Excel spreadsheets, Access, Oracle or other SQL Server databases This.
1 Tuning PL/SQL procedures using DBMS_PROFILER 20-August 2009 Tim Gorman Evergreen Database Technologies, Inc. Northern California Oracle.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Oracle for Software Developers. What is a relational database? Data is represented as a set of two- dimensional tables. (rows and columns) One or more.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
1 The following presentation is from the Oracle Webcast “What’s New in P6 EPPM Release 8.1.” As a partner, you may not use the Oracle Power Point template,
Data Management Console Synonym Editor
Database control Introduction. The Database control is a tool that used by the database administrator to control the database. To enter to Database control.
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1 Introduction to SQL *Plus Oracle SQL Interface MIS309 Database Systems.
​ TdBench 7.2 – tdb.sh Utility Script. 2 Created for TdBench 7.x release to consolidate tools Open architecture – looks for scripts in the./tools directory.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus.
CHAPTER 7 LESSON B Creating Database Reports. Lesson B Objectives  Describe the components of a report  Modify report components  Modify the format.
MATLAB The name of MATLAB stands for matrix laboratory. Starting a MATLAB Session -On Microsoft® Windows® platforms, start the MATLAB program by double-clicking.
Dept. of Computer & Information Sciences
MIKADO – Generation of ISO – SeaDataNet metadata files
3 A Guide to MySQL.
Fundamental of Databases
Oracle Tools for SQL Server?
Running a Forms Developer Application
Working with Data Blocks and Frames
Creating Oracle Business Intelligence Interactive Dashboards
A Guide to SQL, Seventh Edition
Working in the Forms Developer Environment
SQL and SQL*Plus Interaction
Using SQL*Plus.
SQL in Oracle.
SQL MODELER - OPEN There are Three Ways to open the SQL Modeler
22-INTEGRATION HUB
Metadata Editor Introduction
Using SQL Developer.
Tutorial 8 Objectives Continue presenting methods to import data into Access, export data from Access, link applications with data stored in Access, and.
Introduction to Ms-Access Submitted By- Navjot Kaur Mahi
Using SQL*Plus.
What’s New in Oracle SQL Developer
Intro to SQL Operations Studio
ORACLE SQL Developer & SQLPLUS Statements
The SMS Query Menu System for the iSeries
12 Product Configurator
Using JDeveloper.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Please thank our sponsors!
8 6 MySQL Special Topics A Guide to MySQL.
Chapter 7 Using SQL in Applications
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Contents Preface I Introduction Lesson Objectives I-2
Chapter 7 Using SQL in Applications
Using SQL*Plus.
Grauer and Barber Series Microsoft Access Chapter One
Creating Additional Input Items
Michelle Haarhues Keeping up with SSMS.
Tutorial 8 Sharing, Integrating, and Analyzing Data
Jean-Francois LEBLANC Christian SEBASTIAN
Integrated Statistical Production System WITH GSBPM
Presentation transcript:

SQLcl: A Modern Command Line Interface to the Oracle Database Galo Balda September 18, 2016

About Me Austin, TX Ecuador

Agenda What is it? Getting started: JRE, download, install, connect Show it! Multi-line Editing TAB Completion Result Formatting New Commands: History, Information, DDL, CTAS, Alias, Load, Script

What is it? A command line interface for Oracle Database that combines the power of SQL*Plus and SQL Developer Takes helpful GUI functionality to the CLI: Object name/Command completion, SQL/Command execution history and recall, query result formatting, user friendly text editing, etc… It allows you to interactively or batch execute its own commands alongside with SQL, PL/SQL, operating system commands, and JavaScript

How do I get started? SQLcl: Release 4.2.0 requires JRE 1.8.0_50 or higher Copying a specific JRE install to SQLCL_HOME\bin forces to use that JRE

How do I get started? Get the .ZIP from OTN Unzip it No installer or setup

How do I get started? Start a terminal/cmd session Run the SQL program in SQLCL_HOME/bin No need for the Oracle client

Connecting to the Database TNS: hr/oracle looks at the $TWO_TASK, $ORACLE_HOME, $TNS_ADMIN environment variables EZConnect: hr/oracle@localhost:1521/orcl LDAP SSH Tunnel Wallet

I’m in, where’s the good stuff? Supported commands available from the HELP command New commands are highlighted

I’m in, where’s the good stuff? HELP <command> prints the command’s description and examples Help topics also available for system variables

Multi-line editing No need to jump to an external editor Use the arrow keys to move through your query The EDIT command is still available

Multi-line editing Ctrl-a Advance to beginning of current line Ctrl-e Advance to end of current line Ctrl-w Advance to beginning of the buffer Ctrl-s Advance to end of the buffer Ctrl-r Run your buffer from wherever you are in the editor ESC Back to the SQL> prompt

TAB Completion If you need a table, column, SQL command in a query, use the TAB key for assistance SQLcl automatically completes the text using the lowest common match available

Result Formatting Export a result-set in different formats using SET SQLFORMAT <format> Supported formats include CSV Delimited Insert statements XML JSON Disable it with SET SQLFORMAT

Result Formatting Use SET SQLFORMAT ANSICONSOLE to format your query output to fit your window Each page of query results gets measured to establish the best size for each column before printing the output.

Format Apply default SQL Developer formatting to the content of the buffer (FORMAT BUFFER) or the content of a file (FORMAT FILE) FORMAT RULES loads a SQL Developer formatter rules file to use it in SQLcl

History (His) Stores the last 100 statements/commands that have been executed Can be accessed using the ‘Up’ and ‘Down’ arrow keys Can be accessed using the HISTORY command

History (His) Place a statement in the buffer with HISTORY <#> Execute with /

History (His) Use HISTORY CLEAR to cleanup the history list View the history including the number of executions for each statement/command with HISTORY USAGE

History (His) View the observable client time spent executing each statement/command with HISTORY TIME

History (His) Use HISTORY FAILS ON/OFF to configure whether failed statements/commands are saved. Disabled by default Use SET HISTORY BLACKLIST to configure what commands should not be saved

Information (INFO) For a table displays: Last analyzed date Number of rows (from stats) In-Memory column store status Comments PK indicated by a * next to the column(s) Column default values Column comments Indexes Referential integrity constraints Output formatted to display as best as possible

Information (INFO) Also supports PL/SQL objects. You can use it with an entire package or just individual procedures/functions Prints a code stub that you can paste into your script to execute your PL/SQL

Information (INFO+) For tables you can also run INFO+ and it displays column statistics instead of column comments

DDL Issue the command with the name of an object, and SQLcl will go get the DDL script to create that object using the DBMS_METADATA package. HELP SET DDL lists the various ways of influencing the DDL generation, but they are the same as the DBMS_METADATA.SET_TRAN SFORM_PARAM procedure

CTAS Executes DBMS_METADATA.GET_DDL to extract the DDL for the existing table and builds a create table as select * from command The create table as select command does not run automatically. You have to execute with /

Alias Allows re-use frequently used statements or multi-line scripts Bind variable can be used in the queries. They are defined in the order in which they appear

Script SQLcl allows you to run JavaScript to do things that SQLcl does not already support

Resources OTN Kris Rice's Blog Jeff Smith's Blog Barry McGillin's Blog

Contact Information galo.balda@gmail.com @GaloBalda galobalda.wordpress.com