acs run sql scripts & other db2 for i tools...

36
0 © 2016, 2017 IBM Corporation Cognitive Systems LISUG September, 2017 ACS Run SQL Scripts & Other Db2 for i Tools Reinvented Scott Forstie - [email protected] Business Architect Db2 for i

Upload: others

Post on 02-Apr-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

0© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

ACS Run SQL Scripts & Other Db2 for i Tools Reinvented

Scott Forstie - [email protected] Architect Db2 for i

Page 2: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

Who can use ACS

User Accessing the IBM i

Managing IBM i System

Db2 for i Engineer

Page 3: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

2© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Celebrating collaboration

Page 4: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

3© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

IBM i Access Client Solutions (ACS)

• More powerful and feature rich

IBM i Access Client Solutions (ACS)

IBM i Access Windows Service Pack

Version 1.1.7.1

Run SQL Scripts and SQL Performance

Center, Visual Explain, Show

Statements, and much more…

Product Download Site:

http://www-03.ibm.com/systems/power/software/i/access/solutions.html

Next Planned Update… October, 2017

Launch

Page 5: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

4© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

ACS Version 1.1.7.1 (July, 2017)

• General

– Add Database Health Center

– Add help text to dialogs

• Run SQL Scripts

– Add Performance Monitor pulldown

– Direct launch buttons

– More Insert from Examples

• SQL Performance Center

– Import SQL Performance Monitor

– Import SQL Plan Cache Snapshot

– Import SQL Plan Cache Event Monitor

– New SQL Performance Monitor

– New SQL Plan Cache Snapshot

– New SQL Plan Cache Event Monitor

• Schemas

– Journal - View Entries

– Add Include... filtering support for

Tables and Indexes

– All Objects - Permissions action

Page 6: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

5© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Schemas in ACS

ACS-based Actions:

• Definition

• Description

• Generate SQL

• Properties

• Rename

• New Database Object

• Explain

• Data

o View, Clear, ...

• Actions in

Visual Explain

• …

Page 7: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

6© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Run SQL Scripts

Highlights:

• Faster Startup Time

• Line Numbers

• Highlighting

• Color Coding

• Improved Usability

• Status Bar

• Reconnect

• Editor features

• Save Results

• Graphical Debugger

• Built-in examples

Page 8: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

7© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Insert From Examples

Page 9: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

8© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

SQL Formatter

Page 10: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

9© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

CL command prompting

• Press PF4

to prompt

and build

your

command

string

Page 11: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

10© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

JDBC Configuration

Page 12: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

11© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

JDBC Configuration

• New connection using

the same JDBC

configuration

• New connection using a

different JDBC

configuration

Page 13: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

12© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

SQL Performance Center

• Improved performance

• Tighter rendering of column widths

Page 14: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

13© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

SQL Plan Cache

• SQL Plan Cache

Properties are on

the front page

• Some are

configurable

Page 15: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

14© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Show Statements

• Launch into a live

interrogation of

SQL activity

Page 16: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

15© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Show Statements

• Explore Understand Tune (repeat)

Page 17: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

16© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Visual Explain

• Better than before

– Search

Launch from:

• Run SQL Scripts

• Analyze

• Show Statements

Page 18: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

17© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Compare

Contrast matching SQL, run at different times

Page 19: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

18© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Scott’s

Faves

Page 20: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

19© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

1) Add the following comments to your Run SQL Script.

-- category: Demo Scripts

-- description: Demonstrate Guardium Database Activity Monitor

2) Save the script to the following path.

C:\Users\<your-

user>\Documents\IBM\iAccessClient\RunSQLScripts\Examples

3) Find your script with Search or via the Examples pane.

Adding examples to Run SQL Scripts

Page 21: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

20© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

(Re) Directing .sql launch to ACS

Page 22: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

21© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Rational Developer for IBM i (RDi)

• Rdi Minimum level 9.5.1

• Preferred level 9.5.1.2

• SQL statement is populated into an ACS Run SQL Scripts dialog

• Launched from:

– Editor

– Objects Subsystem

Page 23: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

22© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Tim’s

Faves

Page 24: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

23© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Screen History

• Expanded from 15

screens to unlimited

• Easy to use controls

• Save the screens you

want

• Click Stop to create a

Archive file

• View list of Files

Screen History - Archive

Page 25: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

24© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Screen History - Archive

Print all the

Screens to

Text File

Create many files and

open the screen viewer

Page 26: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

26© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Page 27: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

27© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

For the

administrator

Page 28: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

28© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

• All the Navigators utilize server jobs

• These server jobs can be:

1. Managed – Position certain users or groups to run in alternate

subsystems, where system resources are configured

accordingly

2. Locked down – Denying access to certain users, groups, etc

3. Controlled – Establish query governor controls to protect over-

consumption of resources

Run SQL Scripts

& other database

features

Admin stuff

Admin stuff

Systems Management of ACS

Page 29: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

29© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Manage ACS users

Avoid having all users run in QUSRWRK, with the same priority

Configurable by user or group…by server name or all servers

Choice of whether the connection fails if the target subsystem is not available

-- Description: Reposition all Navigator users into a -- controlled subsystem and do not allow-- connections to fall-over into the default-- subsystem (QUSRWRK or QSERVER) if the -- INAVGRP subsystem cannot be used

CALL QSYS2.SET_SERVER_SBS_ROUTING(AUTHORIZATION_NAME => 'INAVGRP', SERVER_NAME => '*ALL', SUBSYSTEM_NAME => 'INAVSBS', ALLOW_ROLLOVER => 'NO');

http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajq/rzajqprocsetrouting.htm?lang=en

SET_SERVER_SBS_ROUTING

Page 30: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

30© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Configure ACS database feature availability via:

WRKFCNUSG or CHGFCNUSG function usage commands

Navigator for i – Application Administration

System i Navigator – Application Administration

Application Administration of ACS

Page 31: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

31© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

-- description: Review ACS function usage configuration--SELECT function_id, default_usage, f.*FROM qsys2.function_info f

WHERE function_id LIKE 'QIBM_DB_%' ORfunction_id LIKE 'QIBM_XE1_OPNAV_DB_%';

Application Administration of ACS

Page 32: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

32© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

-- description: Review ACS function usage -- user and group configurationSELECT *

FROM qsys2.function_usage fWHERE function_id LIKE 'QIBM_DB_%' OR

function_id LIKE 'QIBM_XE1_OPNAV_DB_%';

Application Administration of ACS

Page 33: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

33© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Locked down – Denying access to certain users, groups, etc

Establish exit programs to deploy business rules

http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajr/rzajrmst31.htm?lang=en

Host Server Exit Programs

Page 34: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

34© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

Controlled – Establish query governor controls to protect over-consumption

of resources

Use the Change Query Attributes (CHGQRYA) command to guard against

over-consumption of resources related to SQL query execution

The governor has two controls:

1. The estimated runtime for a query.

2. The estimated temporary storage consumption for a query.

http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajq/govrle.htm?lang=en

Query Governor

Page 35: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

35© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

How do you get it ???

http://www-03.ibm.com/systems/power/software/i/access/solutions.html

Page 36: ACS Run SQL Scripts & Other Db2 for i Tools Reinventedlisug.org/presentations/ACS_Run_SQL_Scripts.pdfWho can use ACS User Accessing the IBM i Managing IBM i System Db2 for i EngineerFile

36© 2016, 2017 IBM Corporation

Cognitive Systems

LISUG – September, 2017

www.ibm.com/developerworks/ibmi/techupdates/db2