Presentation is loading. Please wait.

Presentation is loading. Please wait.

What’s new in DB2 for i Scott Forstie DB2 for i Business Architect

Similar presentations


Presentation on theme: "What’s new in DB2 for i Scott Forstie DB2 for i Business Architect"— Presentation transcript:

1 What’s new in DB2 for i Scott Forstie DB2 for i Business Architect
@Forstie_IBMi

2 Continual Investment and Innovation
DB2 for i Standard compliant Secure Scalable Functionally Advanced Excellent Performance Easier to use Easier to maintain Value Proposition Continual Investment and Innovation IBM i 7.3 Temporal Generated columns for auditing OLAP Extensions Regression Functions / Covariance EVI Only Access More Built-in Global Variables More SQL Scalar functions More IBM i Services CREATE OR REPLACE TABLE ATTACH & DETACH PARTITION DBE tooling and automation High priority customer requests IBM i 7.2 Row and Column Access Control XMLTABLE CONNECT BY OLAP Extensions TRANSFER OWNERSHIP Named arguments and defaults for parameters Obfuscation of SQL routines Array support in UDFs Timestamp precision Multiple-action Triggers Built-in Global Variables 1.7 Terabyte Indexes Navigator Graphing and Charting System Limits for IFS IBM i 7.1 XML Support Encryption enhancements (FIELDPROCs) Result set support in embedded SQL CURRENTLY COMMITTED MERGE Global variables Array support in procedures Three-part names and aliases SQE Logical file support EVI enhancements Inline functions CREATE OR REPLACE DECLARE GLOBAL TEMPORARY TABLE Catalog views TR Delivered SQL Enhancement November 2016 JSON_TABLE() April 2016 Fair Lock / No Lock November 2015 LIMIT & OFFSET May 2015 CREATE OR REPLACE TABLE November 2014 Regular Expressions = IBM i 7.3 offers significant client value in the areas of database and security and support for industry-leading workloads like analytics and mobile computing. In addition to all the features and functions from previous releases, it also includes enhancements provided through the Technology Refreshes previously applied to IBM i 7.2. = We'll talk about these new IBM i 7.3 functions in detail. = If anyone asks: Hardware where IBM i 7.3 runs : P7 P7+ and P8 servers. Not on blades based on P7 and P7+.

3 DB2 for i – Enhancements delivered via DB2 PTF Groups
7.2 – TR4 7.3 – GA 7.2 – TR5 7.3 – TR1 7.2 – TR6 7.3 – TR2 2016 2017 SF99702 Level 11 SF99703 Level 1 SF99702 Level 14 SF99703 Level 3 Enhancements timed with TR4 Inlined UDTFs Trigger (re)deployment More IBM i Services New DB2 built-in Global Variables Enhanced SQL Scalar functions Evaluation option for DB2 SMP & DB2 Multisystem Enhancements in 7.3: Temporal Tables Generated columns for auditing New OLAP built-ins Raised architecture limits New support for partitioned tables More IBM i Services And much more Enhancements timed with TR5 & TR1 JSON_TABLE() INCLUDE for SQL Routines Database features in ACS Faster Scalar Functions More IBM i Services New DB2 for i Services And much more… DB2 PTF Group GA plan is 11/11/2016

4 JSON Publishing functions
JSON support in DB2 for i JSON Publishing functions JSON_ARRAY JSON_ARRAYAGG JSON_OBJECT JSON_OBJECTAGG JSON Query support Predicates: IS JSON JSON_EXISTS Scalar functions: JSON_QUERY() JSON_VALUE() DB2 JSON Store JSON_TABLE() June 2015 November 2016 TBD TBD First DB2 Family member to have JSON_TABLE support (note that Oracle has it already) Why invest in adding JSON into DB2 for i? JSON is very popular SQL Standards body is adopting this into the standard IBM i 7.1, 7.2, & 7.3 IBM i 7.2 & 7.3

5 JSON_TABLE Converts a JSON expression into relational data
JSON-expressions can be: Character or Graphic (use FORMAT JSON) Binary (use FORMAT BSON) JSON path expression lax Structural problems are tolerated Arrays are automatically unnested strict Structural problems result in an error Arrays are not automatically unnested Can leverage HTTP Functions SELECT * FROM JSON_TABLE( <JSON-expression> , <JSON-path-expression> COLUMNS ( <column-definitions> ) <error-option> FORMAT BSON would equate to using the DB2 JSON Store:

6 JSON Value Pairs { "id":901, "name" : {"first":"John", "last":"Doe" },
JSON Keys Must be a string – a sequence of Unicode characters surrounded by double quotation marks For example: “id”, “name”, “first”, “last”, “phones”, “type”, “number” { "id":901, "name" : {"first":"John", "last":"Doe" }, "phones" : [ {"type":"home", "number":" " }, {"type":"work", "number":" " } ] }

7 JSON Value data types String
“The quick brown fox jumps over the lazy dog” Number -- signed decimal number that may include an exponent using exponential E notation. E23 Boolean – map these to character columns true or false Null – an empty value indicated by the word null null Array – Enclosing brackets [ ] indicate an array Array entries are separated by commas Array entry counting starts with zero Object { ……………… }

8 JSON Object SELECT * FROM
JSON objects are represented using a list of key-value pairs Curly braces { } indicate object start and end Value Pairs are separated by commas Keys and values separated by colons SELECT * FROM json_table('{"first":"John","last":"Doe"}', '$' columns("first" VARCHAR(40), "last" VARCHAR(40))) x;

9 JSON in action Study the JSON document 

10 JSON in action Build the query…
-- Which IT strategy provides the greatest ROI? -- JSON Feed Source: U.S. Department of Commerce select * from JSON_TABLE( SYSTOOLS.HTTPGETCLOB(' null), 'lax $.strategies[*]' COLUMNS ( "strategyTitle" VARCHAR(100), "amountType" VARCHAR(100), amount_saved_2012 DECIMAL(10,3) PATH 'lax $.fy2012.amount', amount_saved_2013 DECIMAL(10,3) PATH 'lax $.fy2013.amount', amount_saved_2014 DECIMAL(10,3) PATH 'lax $.fy2014.amount', amount_saved_2015 DECIMAL(10,3) PATH 'lax $.fy2015.amount' )) x order by amount_saved_2015 desc limit 10; Note that the first 2 columns are delimited so no PATH is needed for the column definition; it uses that name. The result column is lower case due to this

11 JSON in action Review the results… Consume JSON Feeds:
Government (local, state, national, …) Social Media (Twitter, Facebook, …) Intranet Etc…

12 INCLUDE Support for SQL Routines and Triggers
SQL already had an INCLUDE statement for traditional HLL programming. Now the INCLUDE statement is supported in SQL language programming for procedures, functions, and triggers. Included files can contain either SQL or ILE C. Included files can come from library/file(member) or from the IFS. The syntax looks like this: = Explain that SQL means the included source is written in SQL. = Without the SQL tag, the include source is written in ILE C. It can also contain SQL tagged with EXEC SQL. = String does not mean a string of course. It identifies a stream file (e.g. IFS) that contains the include. = Note that these options facilitate storing include source wherever you store the rest of your source.

13 INCLUDE Support – Achieving Code Reuse
Build includes for commonly used declares and for standardized error logging QCSRC(COMCODE) DECLARE c1_EMPNO CHAR(6); DECLARE c2_FIRSTNME VARCHAR(12); DECLARE c3_MIDINIT CHAR(1); DECLARE c4_LASTNAME VARCHAR(15); CREATE PROCEDURE … BEGIN INCLUDE SQL QCSRC(COMCODE); INCLUDE SQL QCSRC(COMNOTF); END; QCSRC(COMNOTF) BEGIN DECLARE obj_not_found CONDITION FOR '42704'; DECLARE CONTINUE HANDLER FOR obj_not_found SET errlog_notfound = 'Y'; . . . INSERT INTO errorlog VALUES ( ); END;

14 INCLUDE Support – Q&A Is there a limit on the number of INCLUDE's per routine or trigger? No, there is no limit. (But you can't nest includes within includes.) Can I include anything? You can include source written in SQL or C anywhere but it has to follow the usual syntax rules. For example, declares have to be specified before executable statements. C source can also contain SQL statements tagged with EXEC SQL. Will the catalogs and generated SQL include the INCLUDE statements? INCLUDE SQL – No (the composite source is seen) INCLUDE C – Yes (the INCLUDE statement is seen) Can I use exports from other service programs? Yes, use SET OPTION BINDOPT = BNDSRVPGM(MYLIB/MYSRVPGM) or BINDOPT = BNDDIR(MYLIB/MYBINDDIR) Many options are available for use via BINDOPT. Also, BINDDIR

15 Using INCLUDE to deploy common error handling
Can write a generic handler for SQLEXCEPTION to save important job log messages BEGIN/END isolates any error handling in the handler from other logic in the routine This example specifically saves lock contention details to an error log Solve problems that have been mysteries! Working examples found here: Many options are available for use via BINDOPT. Also, BINDDIR

16 Using INCLUDE to do things SQL cannot do
Many options are available for use via BINDOPT. Also, BINDDIR

17 PERCENT_RANK – another ordered OLAP specification
-- Break down departments by ranked salary SELECT department,employee_last_name,SALARY,percent_rank() over(PARTITION BY department ORDER BY salary) AS "%RANK" FROM toystore.emp; This is the only enhancement limited to IBM i 7.3

18 Performance Improvements
LPAD & RPAD Built-in functions implemented in SQE  Apply the DB2 PTF Group and some queries run faster OBJECT_STATISTICS() – *ALLSIMPLE support  Use *ALLSIMPLE as the library-name to quickly find all libraries Faster implementation of the following views: QSYS2.OBJECT_LOCK_INFO QSYS2.SYSPROGRAMSTAT QSYS2.SYSPROGRAMSTMTSTAT QSYS2.OUTPUT_QUEUE_ENTRIES QSYS2.OUTPUT_QUEUE_INFO  Apply the DB2 PTF Group and some queries run faster Improved Inline capability for SQL Scalar Functions  Easy opportunity to improve performance Statement deterministic support for Functions  Interesting opportunity to improve performance

19 Faster OBJECT_LOCK_INFO…
-- Find interactive jobs that hold a lock on TOYSTORE WITH LIB_LOCK_HOLDERS AS ( SELECT DISTINCT(JOB_NAME) FROM QSYS2.OBJECT_LOCK_INFO WHERE OBJECT_SCHEMA = 'QSYS' AND OBJECT_NAME = 'TOYSTORE' AND OBJECT_TYPE = '*LIB' ) SELECT A.JOB_NAME, B.JOB_TYPE_ENHANCED FROM LIB_LOCK_HOLDERS A INNER JOIN TABLE(QSYS2.JOB_INFO(JOB_TYPE_FILTER => '*INTERACT', JOB_USER_FILTER => '*ALL')) B ON A.JOB_NAME = B.JOB_NAME;

20 SQL Scalar Function (UDF) Inlining
SQL Scalar functions now enjoy much of the same inline potential as SQL Table functions Many of the restrictions for inlining have been removed CREATE OR REPLACE FUNCTION IMPROVE_IT(NAME VARCHAR(10)) RETURNS VARCHAR(20) LANGUAGE SQL DETERMINISTIC RETURN NAME CONCAT 'abulous!'; = This example is a trifle to regain everyone’s attention = I mention how we unofficially collaborated with the Watson team to discover the best way to improve a name = How does a scientist prove such a formula? Thorough testing of course. The image shows the before and after evidence of UDF inlining. Below is what was in the SQL reference that may have caused a function that said it could inline in the catalog to not actually inline. These restrictions have all been removed. The following attributes of the function must match the attributes of the query. DATFMT, DATSEP, TIMFMT, and TIMSEP SRTSEQ and LANGID (if SRTSEQ is *LANGIDSHR or *LANGIDUNQ) DECFLTRND (if there is a DECFLOAT field used in the function) DECMPT and DECRESULT SQLPATH (if there is an object reference in the function) The CCSID of constants (the source CCSID) in the function and query

21 Assessing Inline Eligibility
Will existing functions be inlined? To become eligible for inlining, the function needs to be altered or recreated, after application of the enabling DB2 PTF Group level How can you assess whether functions are inline eligible? Query the INLINE column within QSYS2.SYSFUNCS = This column was already there for scalar UDF's. = Note that this doesn't cover the authority attributes. = There are situations where inlining is fine otherwise but we have to run the UDF offline as it runs under a different user's authority.

22 Measuring Inlining How do I find good opportunities for inlining? SQL Performance Monitors and SQL Plan Cache Snapshots can be analyzed to find high impact queries where inlining did not occur. Review your SQL Performance Monitor or SQL Plan Cache Snapshot Drill into SQE  Summary = High impact queries run long, run often, or both. E.g. don't bother tuning the query that is run three times a week and is subsecond. = Small print but notice the column in the monitor/cache output: Scalar UDF's not inlined. = Yes, we're repurposing a column name and now it refers to both scalar and table UDF's. = The column name at the bottom should only be familiar to consumers of the raw data from SQL performance monitors. We recommend the graphical tools whenever possible. QQSMINT8 Specifies the number of SQL Scalar user-defined functions (UDFs) and SQL Table Functions (UDTFs) that were not inlined in an SQL query or expression.

23 Statement deterministic functions
Statement deterministic functions can accelerate performance when a function is invoked more than once within a single query If you can’t use Global Deterministic, evaluate Statement Deterministic Statement deterministic functions are not inlined Statement deterministic functions are executed once per statement New

24 Debugger improvements
The debugger has been enhanced for the SQL developer The enhancements correspond to SQL procedures, functions, and triggers that have been built with SET OPTION DBGVIEW=*SOURCE To enable, rebuild the code after application of the DB2 PTF Group Enhancements: Evaluation and fly-over of variables covers more SQL data types SQL variables can be changed under debug Both the Green screen debugger Start Debug (STRDBG) and Graphical System Debugger have been enhanced for the SQL developer

25 IBM i Services for SQL users
7.2 – TR4 7.3 – GA 7.2 – TR5 7.3 – TR1 7.2 – TR3 2016 2017 Services in 4Q/2015: MEMORY_POOL_INFO SYSTEM_STATUS_INFO LICENSE_INFO OBJECT_LOCK_INFO RECORD_LOCK_INFO OUTPUT_QUEUE_ENTRIES MEDIA_LIBRARY_INFO NETSTAT_INFO NETSTAT_JOB_INFO NETSTAT_INTERFACE_INFO NETSTAT_ROUTE_INFO GROUP_PTF_DETAILS Services in 2Q/2016: OUTPUT_QUEUE_INFO ENVIRONMENT_VARIABLE_INFO SERVICES_INFO Services dependency management AUTHORITY_COLLECTION Enhanced: NETSTAT services SET_SERVER_SBS_ROUTING System Limits DISPLAY_JOURNAL() OBJECT_STATISTICS Services in 4Q/2016: HISTORY_LOG_INFO JOB_INFO PARSE_STATEMENT Enhanced: GET_JOB_INFO GROUP_PTF_CURRENCY SYSPARTITIONSTAT DISPLAY_JOURNAL() OBJECT_STATISTICS Performance improvement for five services

26 QSYS2.PARSE_STATEMENT – Table Function
Returns a list of object and column names used in an SQL query, data change statement, or other statement which includes a query or expression The statement is only parsed and not executed If object references are not qualified, schema name will be NULL QSYS2.SYSPROGRAMSTAT and QSYS2.SYSPROGRAMSTMTSTAT can be used to find and analyze static SQL statements Four input parameters: SQL Statement text Naming mode (default - *SYS) Decimal Separator (default - *PERIOD) SQL String Delimiter (default - *APOSTSQL) = What’s in a name? = We had a hard time naming this service and finally decided to call it PARSE_STATEMENT because the service simply parses the statement and returns detail

27 PARSE_STATEMENT() – Deconstructed SQL
SELECT * FROM TABLE(qsys2.parse_statement( 'update toystore.sales set sales = sales * inflate_sales_numbers where sales_person = inflate_person')) x;

28 Impact analysis example
WITH program_statements(naming, dec_point, delim, stmt_text, pgmname, type) AS ( SELECT a.naming, a.decpnt, a.strdlm, b.stmttext, a.sys_name, a.pgmtype FROM qsys2.sysprogramstat a INNER JOIN qsys2.sysprogramstmtstat b ON a.COLLID = b.collid AND a.name = b.name AND a.modname = b.modname WHERE a.collid = 'TOYSTORE') SELECT pgmname, type, c.schema, c.name, stmt_text FROM program_statements, TABLE(qsys2.parse_statement(stmt_text, naming, dec_point, delim)) c WHERE c.name_type = 'TABLE' ORDER BY c.schema, c.name;

29 SYSTOOLS.GROUP_PTF_CURRENCY – View
Enhanced to return ‘CURRENT AT THE NEXT IPL’ for PTF Groups that are pending application -- Review PTF Group posture SELECT * FROM SYSTOOLS.GROUP_PTF_CURRENCY WHERE PTF_GROUP_RELEASE = 'R710' ORDER BY PTF_GROUP_LEVEL_AVAILABLE - PTF_GROUP_LEVEL_INSTALLED DESC; IBM is moving the XML feeds!

30 History Log Service Use SQL to gain new historical insights
Think of unanswered questions that could be solved or automated using SQL QSYS2.HISTORY_LOG_INFO IBM i 7.2 and higher Each row is a message in the history log Result columns are similar to QSYS2.JOBLOG_INFO Two input filters: Start Time (default is midnight yesterday) End Time (default is current timestamp)

31 QSYS2.HISTORY_LOG_INFO – Table Function
Find answers to all kinds of important questions… SNDMSG MSG('Who will win the Super Bowl this season?') TOUSR(*SYSOPR) MSGTYPE(*INQ) SELECT message_type, message_subtype, message_text FROM TABLE(qsys2.history_log_info()) x WHERE message_type IN ('REPLY', 'INQUIRY') ORDER BY message_timestamp ASC;

32 Job life span study -- Compute the 50 QUSER jobs with the longest time span WITH new_jobs(JN, job_start, from_user) AS (SELECT from_job, message_timestamp, from_user FROM TABLE(qsys2.history_log_info()) x WHERE message_id = 'CPF1124'), ended_jobs(JN, job_end, from_user) WHERE message_id = 'CPF1164') SELECT n.JN, TIMESTAMPDIFF(4, CAST(job_end - job_start AS CHAR(22))) AS execution_minutes FROM new_jobs n INNER JOIN ended_jobs e ON n.JN = e.JN WHERE n.from_user = 'QUSER' ORDER BY execution_minutes DESC LIMIT 50;

33 Work Management Services
Three table functions exist for working with jobs QSYS2.GET_JOB_INFO() IBM i 6.1 and higher Single row returned for active jobs Includes SQL detail Input qualified job name QSYS2.ACTIVE_JOB_INFO() IBM i 7.1 and higher Returns rows for active jobs Includes performance detail Three input filters: List of up to 25 subsystem names Generic job name or special values Job user list QSYS2.JOB_INFO() IBM i 7.2 and higher Returns rows for all jobs Includes job definition detail Five input filters: Job status Job type Job subsystem Job user Job submitter

34 QSYS2.JOB_INFO – Table Function
SQL alternative to Work with User Jobs (WRKUSRJOB), Work with Subsystem Jobs (WRKSBSJOB), and Work with Submitted Jobs (WRKSBMJOB) -- Review batch jobs that are sitting on a job queue SELECT * FROM TABLE(qsys2.job_info(job_type_filter => '*BATCH', job_user_filter => '*ALL', job_status_filter => '*JOBQ'))x;

35 QSYS2.GET_JOB_INFO – Table Function
Enhanced to return prestart job reuse detail -- Review the prestart job reuse criteria and usage WITH ACTJOBS(JN) AS ( SELECT JOB_NAME FROM TABLE(QSYS2.JOB_INFO(JOB_STATUS_FILTER => '*ACTIVE', JOB_SUBSYSTEM_FILTER => 'QSYSWRK', JOB_USER_FILTER => '*ALL')) X WHERE JOB_TYPE = 'PJ') SELECT JN, V_PJ_REUSE_COUNT AS REUSE_COUNT, CASE WHEN V_PJ_MAXUSE_COUNT = -1 THEN '*NOMAX' ELSE V_PJ_MAXUSE_COUNT END AS MAXUSE FROM ACTJOBS, TABLE(QSYS2.GET_JOB_INFO(JN)) Z ORDER BY V_PJ_REUSE_COUNT DESC;

36 Mining the history since the last IPL
Find the last IPL time using JOB_INFO Use the IPL time to define the search window for HISTORY_LOG_INFO -- Examine history since the last IPL WITH last_ipl(ipl_time) AS (SELECT job_entered_system_time FROM TABLE(qsys2.job_info(job_status_filter => '*ACTIVE', job_user_filter => 'QSYS')) x WHERE job_name = '000000/QSYS/SCPF') SELECT x.* FROM last_ipl, TABLE(qsys2.history_log_info(ipl_time,CURRENT TIMESTAMP))x; the system value QABNORMSW shows you whether an Abnormal IPL occurred This service shows you whether the next IPL will be abnormal

37 Predictive Abnormal vs Normal IPL
Find the last IPL time using JOB_INFO Use the IPL time to define the search window for HISTORY_LOG_INFO Look for instances of CPC1225 (Job &3/&2/&1 ended abnormally) -- Determine whether the next IPL will be abnormal WITH last_ipl(ipl_time) AS (SELECT job_entered_system_time FROM TABLE(qsys2.job_info(job_status_filter => '*ACTIVE', job_user_filter => 'QSYS')) x WHERE job_name = '000000/QSYS/SCPF'), abnormal(abnormal_count) AS (SELECT COUNT(*) FROM last_ipl, TABLE(qsys2.history_log_info(ipl_time, CURRENT TIMESTAMP)) x WHERE message_id IN ('CPC1225')) SELECT CASE WHEN abnormal_count = 0 THEN ‘NORMAL' ELSE ‘ABNORMAL – ‘ concat abnormal_count END AS ipl_indicator FROM abnormal ; This example builds upon the previous slide. Now that we have easy access to history, its time to think up valuable questions (aka queries) based upon partition history. the system value QABNORMSW shows you whether an Abnormal IPL occurred This service shows you whether the next IPL will be abnormal

38 DB2 Web Query and IBM i Services
DB2 Web Query can jump-start your consumption of IBM i Services Built-in reports, dashboards and stored procedures Enables Mobile, Graphical, Modern system administration If you’d like some help with this, contact Follow DB2 Web Query: @mckdrmoly ibm.co/db2wqwiki

39 * Future plans subject to change without notice
Database & ACS enhancement timeline Run SQL Scripts Improvements SQL Performance Center Improvements Visual Explain Show statements Compare Monitors or Snapshots Run SQL Scripts Improvements Index Advisor Schema Folders? Run SQL Scripts SQL Performance Center = Yes, this is unusual to see futures discussed in public. Tim Rowe (BA for ACS) endorses this approach because he felt is was necessary to reduce any confusion related to our plans and progress to providing reasonable alternative technologies for System i Navigator (Windows application), which is not supported on Windows 10. December, 2015 August, 2016 January, 2017 * Future plans subject to change without notice

40 Run SQL Scripts – SQL Formatter

41 Visual Explain Launch from: Run SQL Scripts Analyze Show Statements
Enhancement Search function

42 * * * * * * * * * * ACS Version 1.1.6.0 (delivered in August, 2016)
Run SQL Scripts JDBC Configuration manager Named parameters SQL Formatter Global variables tab Editor improvements Insert from Examples improvements Integration to VE Syntax check Show Statements Concurrent analysis Extra drilldown reports New 'top N' filter Compare Customizable sort criteria Visual Explain Search function Plan cache properties and configuration * * * * * * * * * * Indicates where ACS support is better than System i Navigator

43 DB2 for i – IBM i 7.2 TR4-timed Enhancements (April 2016)

44 Fair Lock Option Challenge: Frequent DML activity blocks DDL request
IBM i 7.2 Base Challenge: Frequent DML activity blocks DDL request Response: Add PREVENT_ADDITIONAL_CONFLICTING_LOCKS QAQQINI control Benefit: Improved ability to transform data model in production Support: Applies to ALTER TABLE (Add, Alter or Drop Column), CREATE TRIGGER, LOCK TABLE, & RENAME TABLE TABLE TABLE UPDATE UPDATE ALTER TABLE ALTER TABLE UPDATE = This is review of something added in 7.2 but relevant to ALLOW DDL WHILE OPEN which follows. = New option to direct the database to give preference to an operation that requires an exclusive lock. Use the new QAQQINI option to prevent additional conflicting locks until the operation succeeds or times out. = Animation == You've got a table == Someone is updating the table == Someone is inserting into the table == Someone wants to alter the table (often to upgrade the application) == Alter table has to wait until the updater and inserter drop their locks == This option ensures that any new updater gets in line after the alter. Without it, they could have gotten their lock first (because it is a lower and easier lock to get) and held off the alter. == Alter completes == Updater now gets their lock. New QAQQINI option - PREVENT_ADDITIONAL_CONFLICTING_LOCKS INSERT

45 No Lock Option Challenge: Data access blocks changes to the file
IBM i 7.1 IBM i 7.2 DB2 PTF Group SF99701 Level 40 DB2 PTF Group SF99702 Level 11 Challenge: Data access blocks changes to the file Response: Add ALLOW_DDL_CHANGES_WHILE_OPEN QAQQINI control Benefit: Ability to deploy file changes without quiescing activity Support: Applies to CREATE TRIGGER, ALTER TRIGGER, DROP TRIGGER, COMMENT ON TRIGGER, and LABEL ON TRIGGER, ADDPFTRG, RMVPFTRG, and CHGPFTRG TABLE TABLE DML t1 LIBRARY/TRIG_PGMX = This slide shows a DML operation in progress against a table which results in a trigger being activated. = Because the file is open, there is a lock which would block an attempt to get an exclusive lock to modify the trigger.

46 No Lock Option Challenge: Data access blocks changes to the file
Response: Add ALLOW_DDL_CHANGES_WHILE_OPEN QAQQINI control Benefit: Ability to deploy file changes without quiescing activity Support: Applies to CREATE TRIGGER, ALTER TRIGGER, DROP TRIGGER, COMMENT ON TRIGGER, and LABEL ON TRIGGER, ADDPFTRG, RMVPFTRG, and CHGPFTRG TABLE TABLE DML t1 LIBRARY/TRIG_PGMX CREATE OR REPLACE TRIGGER TRIG_PGMX = Now we want to replace the trigger. Without the new support, we would have to wait until we could get an exclusive lock which generally meant quiescing the application to eliminate any locks on the table. = The new ALLOW_DDL_WHILE_OPEN QAQQINI option allows modifications to triggers without requiring an exclusive lock on the table.

47 No Lock Option Challenge: Data access blocks changes to the file
Response: Add ALLOW_DDL_CHANGES_WHILE_OPEN QAQQINI control Benefit: Ability to deploy file changes without quiescing activity Support: Applies to CREATE TRIGGER, ALTER TRIGGER, DROP TRIGGER, COMMENT ON TRIGGER, and LABEL ON TRIGGER, ADDPFTRG, RMVPFTRG, and CHGPFTRG TABLE TABLE DML t1 No-Library TRIG_PGMX CREATE OR REPLACE TRIGGER TRIG_PGMX = Now with this enhancement in 7.3 and TR4, we don't need to get an exclusive lock for CREATE OR REPLACE TRIGGER. = The transaction in flight keeps on running fine and essentially uses the old version of the trigger until it eventually quiesces. = The old program instance is removed from the context. QRECOVERY was not used because it is never coming back and no-library makes it invisible. = Any new transaction would use the new trigger. = The reason that this isn't the default behavior is because there are rules around this. For example, you have to accept that it is ok to slip in a new trigger in flight and thereby potentially change how the database looks while the application is running. Forcing the application to quiesce provides a little more audit trail. Etc. DML t2 LIBRARY/TRIG_PGMX

48 DB2 for i – SQL Programming Resource
Essential resource for SQL & DB2 for i database application development Draft published: April 2016 Published in 2006, the “Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries” redbook was very popular. SQL functionality has made great advances since then so IBM has produced a new and improved version. If you are interested in programming in SQL, this is an excellent resource!

49 54 54 54 54

50 DB2 for i priced OS options – evaluation copy
Try before you buy! On any IBM i 7.x release! DB2 Symmetric Multiprocessing – Option 26 DB2 Multisystem – Option 27 The IBM Lab Services DB2 for IBM i team has the ability to allow you to evaluate either of these options for up to 70 days, for no charge. This is a simpler, no strings attached, way to evaluate these valuable database options. Interested? Contact… Rob Bestgen or Scott Forstie = Now you can measure the performance improvement without having to buy it first. = DB2 Multisystem is a prereq for any partitioned table support. This again lets you experiment with a partitioned table environment without having to but it first.

51 IBM® i Services http://ibm.biz/DB2foriServices
Application Services Storage Services System Health Services QSYS2.QCMDEXC – PROCEDURE QSYS2.ENVIRONMENT_VARIABLE_INFO – VIEW QSYS2.SERVICES_INFO – TABLE QSYS2.MEDIA_LIBRARY_INFO – VIEW QSYS2.SYSDISKSTAT – VIEW QSYS2.SYSTMPSTG – VIEW QSYS2.USER_STORAGE – VIEW QSYS2.SYSLIMITS – VIEW QSYS2.SYSLIMTBL – TABLE Message Handling Services Security Services QSYS2.HISTORY_LOG_INFO – UDTF QSYS2.JOBLOG_INFO – UDTF QSYS2.REPLY_LIST_INFO – VIEW QSYS2.DRDA_AUTHENTICATION_ENTRY_INFO – VIEW QSYS2.FUNCTION_INFO – VIEW QSYS2.FUNCTION_USAGE – VIEW QSYS2.GROUP_PROFILE_ENTRIES – VIEW QSYS2.SQL_CHECK_AUTHORITY – UDF QSYS2.USER_INFO – VIEW SYSPROC.SET_COLUMN_ATTRIBUTE – PROCEDURE Journal Services QSYS2.DISPLAY_JOURNAL – UDTF QSYS2.JOURNAL_INFO – VIEW Librarian Services QSYS2.LIBRARY_LIST_INFO – VIEW QSYS2.OBJECT_STATISTICS – UDTF Java Services QSYS2.JVM_INFO – VIEW QSYS2.SET_JVM – PROCEDURE Work Management Services Communication Services Product Services QSYS2.ACTIVE_JOB_INFO – UDTF QSYS2.GET_JOB_INFO – UDTF QSYS2.JOB_INFO – UDTF QSYS2.MEMORY_POOL – UDTF QSYS2.MEMORY_POOL_INFO – VIEW QSYS2.OBJECT_LOCK_INFO – VIEW QSYS2.RECORD_LOCK_INFO – VIEW QSYS2.SCHEDULED_JOB_INFO – VIEW QSYS2.SYSTEM_STATUS – UDTF QSYS2.SYSTEM_STATUS_INFO – VIEW QSYS2.SYSTEM_VALUE_INFO – VIEW QSYS2.NETSTAT_INFO – VIEW QSYS2.NETSTAT_INTERFACE_INFO – VIEW QSYS2.NETSTAT_JOB_INFO – VIEW QSYS2.NETSTAT_ROUTE_INFO – VIEW QSYS2.SERVER_SBS_ROUTING – VIEW QSYS2.SET_SERVER_SBS_ROUTING – PROCEDURE QSYS2.TCPIP_INFO – VIEW SYSIBMADM.ENV_SYS_INFO – VIEW QSYS2.LICENSE_INFO – VIEW Spool Services QSYS2.OUTPUT_QUEUE_ENTRIES – VIEW QSYS2.OUTPUT_QUEUE_ENTRIES – UDTF QSYS2.OUTPUT_QUEUE_INFO – VIEW PTF Services QSYS2.PTF_INFO – VIEW QSYS2.GROUP_PTF_INFO – VIEW SYSTOOLS.GROUP_PTF_CURRENCY – VIEW SYSTOOLS.GROUP_PTF_DETAILS – VIEW IBM i Services

52 IBM® DB2® for i Catalogs SYSCATALOGS INFORMATION_SCHEMA_CATALOG_NAME
Privileges SYSFUNCS SYSJARCONTENTS SYSJAROBJECTS SYSPARMS SYSPROCS SYSROUTINEDEP SYSROUTINES SQLFUNCTIONCOLS SQLFUNCTIONS SQLPROCEDURECOLS SQLPROCEDURES PARAMETERS ROUTINES Routines Statistics SYSCOLUMNSTAT SYSINDEXSTAT SYSMQTSTAT SYSPACKAGESTAT SYSPACKAGESTMTSTAT SYSPARTITIONDISK SYSPARTITIONINDEXES SYSPARTITIONINDEXDISK SYSPARTITIONINDEXSTAT SYSPARTITIONMQTS SYSPARTITIONSTAT SYSPROGRAMSTAT SYSPROGRAMSTMTSTAT SYSTABLEINDEXSTAT SYSTABLESTAT SQLSTATISTICS SQLCOLPRIVILEGES SQLTABLEPRIVILEGES AUTHORIZATIONS ROUTINE_PRIVILEGES UDT_PRIVILEGES USAGE_PRIVILEGES VARIABLE_PRIVILEGES SYSCOLAUTH SYSCONTROLS SYSCONTROLSDEP SYSPACKAGEAUTH SYSROUTINEAUTH SYSSCHEMAAUTH SYSSEQUENCEAUTH SYSTABAUTH SYSUDTAUTH SYSVARIABLEAUTH SYSXSROBJECTAUTH SQLSCHEMAS SCHEMATA Schemas SYSSCHEMAS SQL_FEATURES SQL_LANGUAGES SQL_SIZING CHARACTER_SETS Database Support SYSCOLUMNS SYSCOLUMNS2 SYSFIELDS SYSINDEXES SYSKEYS SYSTABLEDEP SYSTABLES SYSVIEWDEP SYSVIEWS SQLCOLUMNS SQLSPECIALCOLUMNS SQLTABLES COLUMNS TABLES VIEWS Tables Views Indexes Constraints SYSCHKCST SYSCST SYSCSTCOL SYSCSTDEP SYSKEYCST SYSREFCST Miscellaneous Objects SYSPACKAGE SYSSEQUENCES SYSTYPES SYSVARIABLEDEP SYSVARIABLES SYSTRIGCOL SYSTRIGDEP SYSTRIGGERS SYSTRIGUPD Triggers XSRANNOTATIONINFO XSROBJECTCOMPONENTS XSROBJECTHIERARCHIES XSROBJECTS XML Schemas SQLFOREIGNKEYS SQLPRIMARYKEYS SQLTYPEINFO SQLUDTS CHECK_CONSTRAINTS REFERENTIAL_CONSTRAINTS TABLE_CONSTRAINTS DB2 for i catalog views (QSYS2) ODBC and JDBCTM catalog views (SYSIBM) ANS and ISO catalog views (QSYS2) USER_DEFINED_TYPES SEQUENCES Java is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

53 Health Center Procedures
IBM® DB2® for i Services Health Center Procedures Performance Services QSYS2.HEALTH_ACTIVITY QSYS2.HEALTH_DATABASE_OVERVIEW QSYS2.HEALTH_DESIGN_LIMITS QSYS2.HEALTH_ENVIRONMENTAL_LIMITS QSYS2.HEALTH_SIZE_LIMITS QSYS2.RESET_ENVIRONMENTAL_LIMITS QSYS2.CONDENSEDINDEXADVICE – VIEW QSYS2.DATABASE_MONITOR_INFO – VIEW QSYS2.OVERRIDE_QAQQINI – PROCEDURE QSYS2.RESET_TABLE_INDEX_STATISTICS – PROCEDURE QSYS2.SYSIXADV – TABLE SYSTOOLS.ACT_ON_INDEX_ADVICE – PROCEDURE SYSTOOLS.HARVEST_INDEX_ADVICE – PROCEDURE SYSTOOLS.REMOVE_INDEXES – PROCEDURE Utility Procedures QSYS2.CANCEL_SQL QSYS2.DUMP_SQL_CURSORS QSYS2.EXTRACT_STATEMENTS QSYS2.FIND_AND_CANCEL_QSQSRVR_SQL QSYS2.FIND_QSQSRVR_JOBS QSYS2.GENERATE_SQL QSYS2.RESTART_IDENTITY SYSTOOLS.CHECK_SYSCST SYSTOOLS.CHECK_SYSROUTINE Plan Cache Procedures QSYS2.CHANGE_PLAN_CACHE_SIZE QSYS2.CLEAR_PLAN_CACHE QSYS2.DUMP_PLAN_CACHE QSYS2.DUMP_PLAN_CACHE_PROPERTIES QSYS2.DUMP_PLAN_CACHE_TOPN QSYS2.DUMP_SNAP_SHOT_PROPERTIES QSYS2.END_ALL_PLAN_CACHE_EVENT_MONITORS QSYS2.END_PLAN_CACHE_EVENT_MONITOR QSYS2.IMPORT_PC_EVENT_MONITOR QSYS2.IMPORT_PC_SNAPSHOT QSYS2.REMOVE_PC_EVENT_MONITOR QSYS2.REMOVE_PC_SNAPSHOT QSYS2.REMOVE_PERFORMANCE_MONITOR QSYS2.START_PLAN_CACHE_EVENT_MONITOR Application Services QSYS2.DELIMIT_NAME – UDF QSYS2.OVERRIDE_TABLE – PROCEDURE QSYS2.PARSE_STATEMENT – UDTF SYSPROC.WLM_SET_CLIENT_INFO – PROCEDURE DB2 for i Services


Download ppt "What’s new in DB2 for i Scott Forstie DB2 for i Business Architect"

Similar presentations


Ads by Google