sql developer make yourself at home - acesathome.com · robert marz –independent consultant...

48
SQL Developer Make yourself at home 1 Robert Marz Sabine Heimsath

Upload: others

Post on 18-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

SQL Developer –

Make yourself at home

1

Robert Marz

Sabine Heimsath

Page 2: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Robert Marz – Independent Consultant

Senior Technical Architect

with database centric view of the world

Primary Job Role

Active Member of Database Community

Responsible for Cloud Topics

DOAG(German Oracle User Group)

@RobbieDatabee

robbie.databee.org

[email protected]

Page 3: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Sabine Heimsath – Independent Consultant

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 3

Self-employed

PL/SQL and APEX Developer

Passionate Data Modeler

Active Member of

DOAG Development Community

(Responsible for PL/SQL Topics)

Page 4: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

bit.ly/OracleACEProgram

500+ Technical Experts

Helping Peers Globally

Nominate yourself or someone you know: acenomination.oracle.com

Page 5: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

@Home in SQL Developer

©fr

an

k p

ete

rs -

sto

ck.a

do

be

.co

m

Page 6: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Edit/Setup Shortcuts

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 8

Menu:

Tools

→ Preferences

→ Shortcut Keys

Page 7: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Open Object on Single or Double Click

If this option is checked, any table

or view in the connection tree is

opened in the object viewer as

soon as you click on it once.

If you don‘t like that

(it's driving me nuts!)

uncheck this.

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 9

Page 8: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Data Grid: Zebra Pattern

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 10

Alternating line colours help

your eyes to stay in the same

row

Page 9: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Display Dates

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 11

I don’t like the standard setting DD.MM.RR for displaying dates.

You can choose you favourite format here.

Page 10: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Changing the Appearance of Null Values

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 12

Now the values are

easy to spot and can

be distinguished from

whitespace

Page 11: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Show Line Numbers by Default

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 13

Another option that’s quite

useful

(and could be a default imho)

Page 12: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Greying out Instrumentation Code 1/3

You can choose to

display

instrumentation code

in a different colour

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 14

Page 13: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Navigate to

PlSqlCustom/PlSQLLogger (new!)

and choose an unobtrusive but legible

colour

Greying out Instrumentation Code 2/3

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 15

Page 14: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

You'll find some typical

instrumentation tools in the

predefined list.

You can easily configure your own

by adding| ?grandChild = 'pit'

or the name of your own package

By the way, here's more info about the PL/SQL Instrumentation Toolkit (PIT): GitHub PIT

… and about Logger: GitHub Logger

Greying out Instrumentation Code 3/3

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 16

Page 15: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 16: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

SQL Developer Dark Mode

©la

pla

tere

sca

-sto

ck.a

do

be

.co

m

Page 17: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

SQL Dev got the Look

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 19

Oracle (blue)

OS Native (Windows / Mac / Linux)

Color-Themes Limited to

Only affects Editor-Pane

Custom Themes can be extended

by editing XML-File

e.g. Dracula Theme

Edits will be migrated between Releases

Remainder of UI is unchanged

Code Editor has more Options

Page 18: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Java Swing Dark/Flat Look & Feel

formdev.com flat L&F Home

flatlaf-0.36.jar

place in sqldeveloper/sqldeveloper/lib

Download

(located in sqldeveloper/sqldeveloper/bin)

AddJavaLibFile ../lib/flatlaf-0.36.jarAddVMOption -Dswing.defaultlaf=[choose from below]com.formdev.flatlaf.FlatLightLafcom.formdev.flatlaf.FlatDarkLafcom.formdev.flatlaf.FlatDarculaLafcom.formdev.flatlaf.FlatIntelliJLaf

Edit sqldeveloper.conf

looks very pleasing

but low contrast in datagrid zebra pattern

absolutely no support from Oracle

Enjoy

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 20

Page 19: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 20: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Editing©S

olis

Ima

ge

s-

sto

ck.a

do

be

.co

m

Page 21: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Multi Cursor Editing - Preparation

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 23

Preparation:

Choose your favourite key/key

combination for adding extra

cursors.

(Standard is Shift-Ctrl-Click,

which is waaay to complicated ;-)

Page 22: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Multi Cursor Editing

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 24

Keep the Alt key

pressed while

placing the cursors

in the worksheet

Start typing to add

text at the cursor

positions

Page 23: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Find the SQL of Your Result Tab 1/2

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 25

Hovering the

mouse over

the result tab

will show a

popup

including

connection

and SQL

statement

Page 24: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Find the SQL of Your Result Tab 2/2

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 26

Clicking the

SQL button

gives you an

extra popup

showing

connection,

SQL statement

and a

copy link

Page 25: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Search and Replace

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 27

Shortcut CTRL-R

Mark the string you want to replace

and press Ctrl-R

→ All occurences are highlighted

→ The focus is in the ‚Replace‘ field

→ You can start replacing right ahead ☺

Page 26: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Search and Replace

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 28

Challenge:

Keep upper case/lower case/init cap

Solution:

Press this button

Result

Page 27: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Search and Replace with RegExp

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 29

Regular Expressions

Page 28: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Search and Replace Escaped Characters

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 30

Substitute escaped characters

Page 29: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 30: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Navigation

©P

ave

l Tim

ofe

ev

-sto

ck.a

do

be

.co

m

Page 31: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Unshared Worksheet

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 33

Statements in the new

Worksheet will run completely

independent of the original

session

You can make this the

default, but yout DBA

might not like it if

you open too many

connections

While a Worksheet is

active, press

or Ctrl-Shift-N

to open a Worksheet

with a new session using

the same connection

information

Page 32: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

List of Open Tabs

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 34

Unobtrusive, but very helpful:

List of Open Windows

Current Window marked

by arrow

Windows can be closed via

the little x

Sometimes faster than via tab

You can use the left and right arrows to navigate the tabs

but there is an alternative:

Page 33: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Jumping Back and Forth

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 35

You can use the green

buttons to go back and

forward one step.

The arrow down shows

the history of tabs

(including worksheets,

files, object viewers,

package viewers).

A simple click will take

you there

Page 34: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Go Directly to Object, Do Not Pass Connection Tree

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 36

Hover over an object’s

name while pressing Crtl

When the hyperlink

appears, right click on it

It will take you the Object

Viewer:

Page 35: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Schema Browser

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 38

If you don’t like the Connection Tree … Just use the Schema Browser!

Page 36: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 37: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

ssh Tunnels

©K

alin

ovsky

Dm

itry

-sto

ck.a

do

be

.co

m

Page 38: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

ssh Tunnels

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 42

Local Network

IP 192.168.2.0/24

Remote Network

IP 10.175.76.0/24

ssh

oradbserver

tns port 6777

mycomputer

ssh opc@jumpserver

Clients

connect to

mycomputer:1521

Jumpserver

User opc

Forward

local port 1521

via Jumpserver to

oradbserver:6777

opc@jumpserver-L 1521:oradbserver:6777

sqlplus robbie@mycomputer:1521/orcl

Page 39: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

ssh Tunnel in SQL Developer

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 43

• Menu View => SSH

Show „SSH Hosts“ pane:

• Wizard lets you create (one step)

• ssh connection

• Port Foward

• Test it!

Create new SSH Host

• Choose Connection Type SSH

• Select existing Port Forward

• Provide SID / Service name

Create new Oracle Connection

Page 40: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

ssh Tunnel in SQL Developer

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 44

• Menu View => SSH

Show „SSH Hosts“ pane:

• Wizard lets you create (one step)

• ssh connection

• Port Foward

• Test it!

Create new SSH Host

• Choose Connection Type SSH

• Select existing Port Forward

• Provide SID / Service name

Create new Oracle Connection

Page 41: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 42: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

History (Bonus)

©S

ha

iithN

ow

ak J

ace

k -

sto

ck.a

do

be

.co

m

Page 43: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

File History

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 47

The important tab!

Diff with

current version

Saved versions

of your file

Navigate

Choose which changes you

want to apply to your file

Page 44: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

SQL History

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 48

You can filter for any string!Time of execution

Number of executions

Duration

With these buttons

you can replace the

current text in the

worksheet with the

selected statement

or

insert the selected

statement at cursor

position

Page 45: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Statement History

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 49

You can filter for any string!Parameters

Duration

Double click

opens a window

with the complete

text

This log contains everything that's sent to the database.

So you see your own statements as well as the metadata queries that SQL

Developer uses to display the database objects

Great for inquisitive

people! ☺

Page 46: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

©n

irow

orld

-sto

ck.a

do

be

.co

m

Page 47: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Conclusion

© H

atc

ha

po

ng

Pa

lurtc

ha

ivo

ng

-sto

ck.a

do

be

.co

m

Page 48: SQL Developer Make yourself at home - acesathome.com · Robert Marz –Independent Consultant Senior Technical Architect with database centric view of the world Primary Job Role Active

Make yourself @Home in SQL Developer

©2020 Sabine Heimsath & Robert Marz @RobbieDatabee @oraesque 54

SQL Dev is highly customisable

Observe yourself while working

Ask for help, discuss (Twitter, OTN)

Follow @thatjeffsmith, @krisrice, @OracleSQLDev

Always use the newest version