DB2 f i DB2 for i Update Trends and Directions Update, Trends and

advertisement
DB2 for
f i
Update Trends and Directions
Update,
Mike Cain
IBM DB2 for
f i Center
C
off Excellence
E
ll
Rochester, MN USA
mcain@us.ibm.com
© 2008 IBM Corporation
DB2 Family
z/OS, i, Linux/Unix/Windows (LUW)
Managing family compatibility

Information Management Architecture Board

SQL Language Council
Common design, algorithms, and code sharing where possible
Two Types of Differences

Short term differences based on different release dates and
different customer priorities

Long term differences based on Operating System differences
(Isolated to database configuration, management, and utilities)
IBM DB2 Cross Platform Reference

http://www.ibm.com/developerworks/db2/library/techarticle/db2co
mmon/
© 2008 IBM Corporation
DB2 for i – How is it different from other DB2s
Not a separate product – integrated into System i
Not a separate charge
Release number is not the same
Native and SQL Interfaces
Easier to use and maintain
Management GUI is S
System
stem i Na
Navigator
igator
© 2008 IBM Corporation
DB2 for i Major Strengths
 Openness and standards
 Interoperability
 Performance
 Scalability
l bl
 Security
 National
N ti
l llanguage supportt
 Ease of use and management
© 2008 IBM Corporation
An Open Database
ANS, ISO, FIPS, and JIS SQL Standard
Open Group - Distributed Relational Database Architecture
Open Group - XA Resource Manager APIs
ANS and ISO SQL Call Level Interface
ANS and
d ISO SQL and
d External
E t
l Procedures
P
d
UCS-2, UTF-8, UTF-16 (Unicode - ISO 10646)
ODBC
JDBC
ISO/ANS SQL Standard - Core
OLE and ADO
.NET
Oracle 10g
US Government C2 Security
Euro Character support
Microsoft SQL Server
...
2005
DB2 for z/OS
DB2 for LUW
DB2 for i
0
10
20
30
40
50
60
70
80
90
© 2008 IBM Corporation
Interoperability
p
y – DRDA
DB2 for z/O S
DB2 for VM and VSE
DB2 for i
DB2 for AIX
DB2 for HP-UX
DB2 for Sun Solaris
DB2 for W indows
DB2 for Liniux
Inform ix
Txaction
Attachm ate
G randview
HiT Software
M icrosoft
O racle
Rocket
StarQ uest
Sybase/M DI
W all Data
XDB System s
DDM/DRDA
P t
Protocols
l
DDM/DRDA
P
Protocols
l
DB2
DB2
DB2
DB2
DB2
DB2
DB2
DB2
fo r
fo r
fo r
fo r
fo r
fo r
fo r
ffo r
z/O S
V M and V S E
i
A IX
H P -U X
S u n S ola ris
W in dow s
Li
Lin iiu x
Server and Client
F ile Tek , Inc.
G ra n d view
P la tinum Tech n olog y Inc.
X D B S yste m s
Oracle and Microsoft do not
support DRDA as a Server
Application
S erver (D a ta)
© 2008 IBM Corporation
System i - Logical Partitioning (LPAR)
DB2 for i
DB2 for i
DB2 for Linux
JDBC
CLI
DRDA
DDM
JDBC
ODBC
DRDA
DB2 for AIX
DB2 for Windows
JDBC
DRDA
JDBC
ODBC
OLE DB
.NET
DRDA
LPAR
IXS/IXA
Power Server
LPAR
LPAR
LPAR
© 2008 IBM Corporation
DB2 for i: Strategy and Goals
 Preserve your development investments
 Get more out of the OS and DBMS
 Ease of use, ease of management
 Support
pp
data-centric p
programming
g
g and information
management
 SQL is the strategic language and interface for DDL,
DML and PSM
 SQL is the strategic language and interface
© 2008 IBM Corporation
On the Web
DB2 for i Home Page

http://www.ibm.com/systems/i/software/db2/
System i Advantages

http://www-1.ibm.com/systems/i/advantages/
System
y
i Access

http://www.ibm.com/systems/i/access/
DB2 for i Java

http://www.ibm.com/systems/i/software/db2/javadb2.html
Education and Publications

http://www.ibm.com/systems/i/ - Click on Education

http://publib.boulder.ibm.com/iseries/
Newsgroups and Forums

comp.databases.ibm db2
comp.databases.ibm-db2

comp.sys.ibm.as400.misc groups
Questions can be sent to:

rchudb@us.ibm.com
© 2008 IBM Corporation
DB2® for i 6.1 Enhancements
© 2008 IBM Corporation
6 1 SQL Enhancements
6.1
Queries
Schema statements (DDL)

Grouping Sets and Super groups

Decimal Float

VALUES in FROM

Expressions in Indexes

INSERT in FROM

ROW CHANGE TIMESTAMP

Full Outer Join

Hidden Columns

NCHAR, NVARCHAR, and NCLOB

ALTER FUNCTION
Data Change statements (DML)

E t d d Indicator
Extended
I di t Variable
V i bl V
Values
l

Ignore unsupported syntax

Skip Locked Data

SYSTOOLS/SYSIBMADM

FOR EACH STATEMENT INSTEAD OF trigger
S l Functions
Scalar
F
ti
Mi
Miscellaneous
ll
TIMESTAMP_FORMAT and
VARCHAR_FORMAT enhancements

Statistics catalog views (V5R4 PTF)
CLIENT special registers

LOCATE function fix (PTF)


FOR BIT DATA and binary compatibility

ENCRYPT_AES


ASCII (UTF-8 result)
Output parameter support for
heterogeneous CALL

MONTHS_BETWEEN,
ROUND TIMESTAMP and
ROUND_TIMESTAMP,
TRUNC_TIMESTAMP

BX literals

© 2008 IBM Corporation
GROUPING SETS
Produce the result based on two different grouping sets of rows from the SALES table.
SELECT WEEK(SALES_DATE) AS WEEK,
DAYOFWEEK(SALES_DATE) AS DAY_WEEK,
SALES_PERSON,
SUM(SALES) AS UNITS_SOLD
UNITS SOLD
FROM SALES
WHERE WEEK(SALES_DATE) = 13
Prior to this support you
would have to run
multiple queries
CUBE and ROLLUP
included in this support
GROUP BY GROUPING SETS( (WEEK(SALES_DATE), SALES_PERSON),
(DAYOFWEEK(SALES DATE) SALES_PERSON)
(DAYOFWEEK(SALES_DATE),
SALES PERSON) )
ORDER BY WEEK, DAY_WEEK, SALES_PERSON
The rows with WEEK 13 are from the first grouping set and the other rows are from the second grouping set.
© 2008 IBM Corporation
VALUES in FROM
Form the cross product of this table ″X″ with the SALES table. This
add columns ″R1″
R1 and ″R2″
R2 to every row.
row
SELECT
R1, R2,
WEEK(SALES_DATE) AS WEEK,
DAYOFWEEK(SALES DATE) AS DAY_WEEK,
DAYOFWEEK(SALES_DATE)
DAY WEEK
MONTH(SALES_DATE) AS MONTH,
REGION,
Equivalent to creating a
temporary table,
inserting rows, and then
using the temporary
table in the query
SALES AS UNITS_SOLD
FROM SALES,
SALES ( VALUES(
VALUES(‘GROUP
GROUP 1
1’,’GROUP
GROUP 2
2’)
) ) AS X (R1,R2)
(R1 R2)
© 2008 IBM Corporation
INSERT in FROM
Insert customer numbers into the new SALES table that has an identity column and return the
generated values.
CREATE TABLE SALES2 (
SALES_ID INTEGER AS IDENTITY,
SALES_DATE DATE DEFAULT CURRENT DATE,
SALES_PERSON FOR COLUMN SALES00001 VARCHAR(15) ,
REGION VARCHAR(15),
No easy way to return
generated values prior
to this support
SALES INTEGER );
SELECT *
FROM FINAL TABLE
( INSERT INTO SALES2 ( SALES_DATE, SALES_PERSON, REGION, SALES )
SELECT * FROM SALES )
ORDER BY INPUT SEQUENCE;
© 2008 IBM Corporation
EXTENDED INDICATOR VALUES
Get the next row in the transaction table for update and skip any rows that are
currently locked.
EXEC SQL DECLARE x CURSOR WITH EXTENDED INDICATORS FOR
SELECT * FROM corpdata.transaction;
EXEC SQL OPEN x;
EXEC SQL FETCH x INTO :trans:inds;
i d
…
inds1 = -5;
EXEC SQL UPDATE corpdata.transaction
SET TRANSOPERATION = :top:inds1,
t
i d 1
CUSTOMERID = :cid:inds2,
Prior to this support you
would have to update all
columns or would have to
use a different
diff
t UPDATE
statement for every
combination of columns
yyou wanted to update.
p
Applies to UPDATE and
INSERT VALUES, also
allowed on PREPARE.
TRANSINFO = :top:inds3
WHERE CURRENT OF x;
EXEC SQL CLOSE x;
Indicator Values
Meaning
0
Value is provided
-1, -2, -3, -4, and -6
Null value
-5
Default value
-7
Column is treated as if it had not been
specified in the statement.
statement
© 2008 IBM Corporation
DECIMAL FLOAT
New numeric data type with attributes of both decimal and floating point – IEEE 754R
CREATE TABLE mjatst.table1 (
New numeric data type
with
ith extended
t d d accuracy
and performance.
c1 DECFLOAT(16) ,
c2 DECFLOAT(34) );
DECFLOAT(16)
DECFLOAT(34)
Guarantees 16 digits of precision
Guarantees 34 digits of precision
8 bytes long
16 bytes long
Exponent range 10-383 to 10384
Exponent range 10-6143 to 106144
Infinity – NaN – SNaN special values
Infinity – NaN – SNaN special values
© 2008 IBM Corporation
Expressions and Selection in Indexes
CREATE INDEX mjatst.index1
mjatst index1 ON mjatst.table1
mjatst table1
(c1*c2) ;
CREATE INDEX mjatst.index2 ON mjatst.table1
(c1*c2)
WHERE c1 > 14;
SQL create index
enhancements for key
expressions and sparse
indexes.
SQE can use indexes
with expressions
expressions, but
does not provide
support for sparse
indexes yet
© 2008 IBM Corporation
ROW CHANGE TIMESTAMP
CREATE TABLE mjatst.table4 (
c1 INT,
c2 VARCHAR(20),
c3 TIMESTAMP NOT NULL IMPLICITLY HIDDEN
FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP );
INSERT INTO mjatst.table4 (c1, c2) VALUES
New standard way of
updating a timestamp
column on any update
or insert.
(1, ‘FIRST’),
FIRST ), (2, ‘SECOND’),
SECOND ), (3, ‘THIRD’);
THIRD );
SELECT c1, c2, c3 FROM mjatst.table4;
UPDATE mjatst.table4 SET c1 = 4, c2 = ‘FOURTH’ WHERE C1 = 1;
SELECT c1, c2, c3 FROM mjatst.table4;
© 2008 IBM Corporation
Hidden Columns
CREATE TABLE mjatst.table3 (
c1 INT,
c2 VARCHAR(20),
c3 TIMESTAMP IMPLICITLY HIDDEN;
INSERT INTO mjatst.table3 (c1, c2, c3) VALUES
(1, ‘FIRST’, CURRENT TIMESTAMP),
(2 ‘SECOND’
(2,
SECOND , CURRENT TIMESTAMP)
TIMESTAMP),
(3, ‘THIRD’, CURRENT TIMESTAMP);
SELECT * FROM mjatst.table3;
New standard way of
“hidi ” a column
“hiding”
l
when
h
querying all columns.
SELECT c1, c2, c3 FROM mjatst.table3;
© 2008 IBM Corporation
FULL OUTER JOIN
JJoin
i the
th tables
t bl on the
th PROD# column
l
to
t gett a table
t bl off all
ll parts
t and
d products,
d t
showing the supplier information, if any.
SELECT
PART,
SUPPLIER
SUPPLIER,
PARTS.PROD#,
PRODUCT
Equivalent to UNION
ALL of LEFT OUTER
JOIN and RIGHT
EXCEPTION JOIN
FROM PARTS
FULL OUTER JOIN PRODUCTS ON PARTS.PROD#
PARTS PROD# = PRODUCTS.PROD#;
PRODUCTS PROD#;
© 2008 IBM Corporation
COMMENT and LABEL Enhancements
COMMENT ON CONSTRAINT mjatst.cst IS ‘A long description up to 2000 bytes’;
LABEL ON
CONSTRAINT mjatst.cst IS ‘A short description up to 50 bytes’;
LABEL ON
FUNCTION
LABEL ON
PROCEDURE mjatst.prc IS ‘A short description up to 50 bytes’;
LABEL ON
ROUTINE
mjatst.rtn IS ‘A short description up to 50 bytes’;
LABEL ON
TRIGGER
mjatst.trg IS ‘A short description up to 50 bytes’;
LABEL ON
TYPE
mjatst.typ IS ‘A short description up to 50 bytes’;
mjatst.fun IS ‘A short description up to 50 bytes’;
Add descriptive
information to
constraints, routines,
and triggers.
© 2008 IBM Corporation
SKIP LOCKED DATA
Get the next row in the transaction table for update and skip any rows that are
currently locked.
DECLARE X CURSOR FOR
SELECT *
FROM transaction
WITH CS
SKIP LOCKED DATA
OPEN X;
Prior to this support
you would have
waited on locks
FETCH X INTO …
© 2008 IBM Corporation
SQL Enhancements – Scalar Functions
Datetime Functions
TIMESTAMP_FORMAT
Returns a timestamp from a character string representation of a
timestamp according to the specified format of the string.
VARCHAR FORMAT
VARCHAR_FORMAT
Returns
R
t
a character
h
t string
t i
representation
t ti
off a timestamp,
ti
t
with
ith the
th
string in a specified format
MONTHS_BETWEEN
Returns an estimate of the number of months between two dates
ROUND TIMESTAMP
ROUND_TIMESTAMP
Returns a timestamp rounded to the specified unit.
unit
TRUNC_TIMESTAMP
Returns a timestamp truncated to the specified unit.
String
g Functions
ASCII
Returns the ASCII code value of the leftmost character of the
argument as an integer
CHR
Returns
R
t
th
the character
h
t th
thatt h
has th
the ASCII code
d value
l
specified
ifi d by
b the
th
argument.
ENCRYPT_AES
Encrypts a string using the AES encryption algorithm
© 2008 IBM Corporation
NCHAR NVARCHAR
NCHAR,
NVARCHAR, NCLOB
CREATE TABLE mjatst.table2 (
c1 NCHAR(10),
c2 NVARCHAR(20),
New standard way of
specifying UTF-16.
c3 NCLOB(1M) );
NATIONAL CHARACTER
GRAPHIC (1) CCSID 1200
NATIONAL CHAR
NCHAR
NATIONAL CHARACTER (n)
GRAPHIC (n) CCSID 1200
NATIONAL CHAR (n)
NCHAR (n)
NATIONAL CHARACTER VARYING (n)
VARGRAPHIC (n) CCSID 1200
NATIONAL CHAR VARYING (n)
NCHAR VARYING (n)
NVARCHAR (n)
NATIONAL CHARACTER LARGE OBJECT
DBCLOB (1M) CCSID 1200
NCHAR LARGE OBJECT
NCLOB
NATIONAL CHARACTER LARGE OBJECT (n)
DBCLOB (n) CCSID 1200
NCHAR LARGE OBJECT (n)
O ((n))
NCLOB
© 2008 IBM Corporation
ALTER FUNCTION
ALTER FUNCTION mjatst.func1
j t tf
1
ALTER NOT DETERMINISTIC
RETURNS NULL ON NULL OUTPUT;
Change a function
without having to
reissue grants.
ALTER FUNCTION mjatst.func1
REPLACE (p1 VARCHAR(10)) RETURNS INT
BEGIN
G
DECLARE x INT;
RETURN (SELECT MAX(LENGTH) FROM QSYS2.SYSCOLUMNS
WHERE DATA_TYPE = p1);
END;
© 2008 IBM Corporation
Ignore unsupported syntax
CREATE TABLESPACE TS1 MANAGED BY DATABASE USING (device ’/dev/rcont $N’ 20000)
SQLSTATE: 01505
SQLCODE: +143
Message: Statement CREATE TABLESPACE ignored.
CREATE TABLE mjatst.newt1 (c1 INT) INDEX IN ts1
SQLSTATE: 01680
SQLCODE: +20367
Message: Clause INDEX IN ignored.
CREATE TABLE mjatst.t1 (c1 INT) IN ts1
SQLSTATE: 42704
SQLCODE: -204
204
Message: TS1 in MJA type *NODGRP not found.
Statements and clauses
that will never be
necessary on i are
ignored making ports
easier.
© 2008 IBM Corporation
FOR EACH STATEMENT INSTEAD OF trigger
CREATE TRIGGER mjatst.trgins1 INSTEAD OF INSERT ON mjatst.v1
FOR EACH STATEMENT
BEGIN
…
END;
Allow INSTEAD OF
triggers to be FOR
EACH STATEMENT.
PTFed to V5R4
© 2008 IBM Corporation
BX Literals
CREATE TABLE qtemp.binary1 (c1 VARBINARY(1000));
INSERT INTO qtemp.binary1 VALUES( BX’A1B2C3D4’ );
Alternative method of
specifying binary
constants.
SYSTOOLS
S
S OO S and
a d SYSIBMADM
S S
SYSTEM PATH changes for SQL naming:
″QSYS″ ″QSYS2″
″QSYS″,
″QSYS2″, ″SYSPROC″,
″SYSPROC″ ″SYSIBMADM″,
″SYSIBMADM″ ″the
″th value
l off the
th authorization
th i ti ID off the
th statement″
t t
t″
Two new system
schemas to house
future information.
© 2008 IBM Corporation
Statistics Catalog Views
SYSCOLUMNSTAT
Contains one row for every column in a table partition or table member and one row for
every column statistics collection.
SYSPARTITIONINDEXSTAT
Contains one row for every index built over a table partition or table member.
SYSPARTITIONSTAT
Contains one row for every table partition or table member.
SYSTABLEINDEXSTAT
Contains one row for every index that has at least one partition or member built over a
table. If the index is over more than one partition or member, the statistics include all
those partitions and members.
SYSTABLESTAT
Contains one row for every table that has at least one partition or member. If the table
has more than one partition or member, the statistics include all partitions and members.
SELECT table_schema, table_name, table_partition, number_rows,
number_deleted_rows
FROM QSYS2.SYSPARTITIONSTAT
QSYS2 SYSPARTITIONSTAT
WHERE table_schema = ‘MJATST’
New views allow simple
access to statistics.
These were PTFed to V5R4
© 2008 IBM Corporation
Statistics Catalog Views
SYSINDEXSTAT
Contains one row for every SQL index. Use this view when you want to see information for a
specific SQL index or set of SQL indexes. The information is similar to that returned via Show
Indexes in System i Navigator.
SYSMQTSTAT
Q
Contains one row for every
y materialized table. Use this view when you
y
want to see information
about a specified materialized query table or set of materialized query tables. The information
is similar to that returned via Show Materialized Query Tables in System i Navigator.
SYSPACKAGESTAT
Contains one row for each SQL package in the SQL schema.
SYSPARTITIONINDEXES
Contains one row for every index built over a table partition or table member
member. Use this view
when you want to see index information for indexes built on a specified table or set of tables.
The information is similar to that returned via Show Indexes in System i Navigator.
SYSPARTITIONMQTS
Contains one row for every materialized table built over a table partition or table member. Use
this view when you want to see materialized query table information for materialized tables
built on a specified table or set of tables. The information is similar to that returned via Show
Materialized Query Tables in System i Navigator.
SYSPROGRAMSTAT
Contains one row for each program, service program, and module that contains SQL
statements.
SELECT package_schema, package_name, package_type, number_statements, package_used_size
FROM QSYS2.SYSPACKAGESTAT
WHERE package_schema LIKE ‘Q%’
New views allow
simple access to
statistics.
NOT PTFed
© 2008 IBM Corporation
CLIENT Special Registers
CURRENT CLIENT_ACCTNG
Contains the value of the accounting string from the client information specified for
this connection.
CURRENT CLIENT_APPLNAME
Contains the value of the application name from the client information specified for
this connection.
CURRENT CLIENT_PROGRAMID
Contains the value of the client program ID from the client information specified for
this connection.
CURRENT CLIENT_USERID
Contains the value of the client user ID from the client information specified for this
connection.
CURRENT CLIENT_WRKSTNNAME
Contains the value of the workstation name from the client information specified for
this connection.
The values of the special registers can be changed through:
• The Set Client Information (SQLESETI) API
API.
• In CLI, the SQLSetConnectAttr() API.
• In JDBC, the setClientInfo connection method.
SELECT CURRENT CLIENT_ACCTNG AS "Client Accounting",
CURRENT CLIENT_APPLNAME AS "Client
" l
Application",
l
"
CURRENT CLIENT_PROGRAMID AS "Client Program",
CURRENT CLIENT_USERID AS "Client User",
Provides the ability to
track the real user and
application. Besides direct
access, database monitor
will capture the values and
Current SQL for a job will
show values.
CURRENT CLIENT_WRKSTNNAME AS "Client Workstation“ FROM sysibm.sysdummy1;
© 2008 IBM Corporation
Interoperability – DRDA
DB2 for z/O S
DB2 ffor VM and
d VSE
DB2 for i
DB2 for AIX
DB2 for HP-UX
DB2 for Sun Solaris
DB2 for W indows
DB2 ffor Li
Liniux
i
Inform ix
Txaction
Attachm ate
G randview
HiT S
Software
ft
M icrosoft
O racle
Rocket
StarQ uest
Sybase/M DI
W allll D
Data
t
XDB System s
DDM/DRDA
Protocols
DDM/DRDA
Protocols
Server and Client
DB2
DB2
DB2
DB2
DB2
DB2
DB2
DB2
for
for
for
for
for
for
for
for
z/OS
VM and VSE
i
AIX
HP-UX
Sun Solaris
W indows
Liniux
6.1
DDM and DRDA IPv6
DRDA Identity tokens
DRDA LOB Optimizations
DRDA Authentication Methods
DRDA Scrollable Cursors
Output parameter support for
heterogeneous CALL
FileTek, Inc.
Grandview
Platinum Technology Inc.
XDB S
System
t
s
Application
Oracle and Microsoft do not
supportt DRDA as a S
Server
Server (Data)
© 2008 IBM Corporation
6 1 Application Development
6.1
Native JDBC
 JDBC 4.0
40
 CLI Handle Threshold Exit
Embedded SQL
 RPG Precompiler Variable Scoping
 Precompiler IFS support
 Unicode support in COBOL
RUNSQLSTM IFS support
Run SQL Scripts flagger
CLI
 Alias
as suppo
supportt in Metadata
etadata APIs
s
 Row-wise array INSERT
 Wide APIs
JDBC
 JDBC 4.0
 Alias support in Metadata APIs
 Returning DEFAULT
 Return update counts
XDA
 SQL Server Mode
 Serviceability improvements
.NET
NET
 Multiple-row INSERT
 Additional data type support
 Visual Studio integration
g
 Distributed transaction support
 Exploit ADO.NET 2.0
© 2008 IBM Corporation
SQL Query Engine (SQE)
SQE Characteristics






Parallel to Normal Release Enhancements
Object Oriented Design
Enhanced Performance primarily for complex queries
Enhanced Optimization Engine
Enhanced Statistics
Encoded Vector Indexes Enhancements
SQE Delivery
First Wave
Second Wave
Third Wave
F
Fourth
th W
Wave
Fifth Wave
V5R2 GA
mid-V5R2
V5R3 GA
mid-V5R3
id V5R3
V5R4 GA
Virtually all SQL
queries use
SQE!
6.1 SQE (Stage 6)
 CCSID translation support




Lateral Correlation
UDTF support
Significant optimization time improvements
Other miscellaneous performance
© 2008 IBM Corporation
6 1 Performance
6.1
SQL Runtime Performance Improvements

Host Server Variable Length compression (V5R4 PTF)

SQL CALL cache improvements

Optimization time improvements

Long name resolve

Large page use (64K)
Database Maintenance Performance Improvements
p

ALWCANCEL(*YES) Reorganize No Longer Requires *EXCL Lock

Reorganize and LOB segment crossers (V5R4 PTF)

ALTER TABLE performance
 Do
D nott rebuild
b ild EVIs
EVI (V5R4 PTF)
 Preserve indexes in tables with LOBs (segment crossers)
SQL Performance Tools Improvements

Performance Monitor Improvements
 3010 fixes and Unicode
 1000 records for non-SQL
 Filter by port number and ipV6
© 2008 IBM Corporation
6 1 Increased Limits
6.1
SQL Application and Runtime Limits

64K result row length (partial – V5R4 PTF)

128-byte cursor and statement names

M
More
than
th
120 columns
l
in
i GROUP BY

Larger in-use table
Database Object Limits

Number of schemas - number of dependent logicals – (partial V5R4 PTF)

Increase ALTER TABLE number of dependents supported

Increase Save number of dependents supported
© 2008 IBM Corporation
6 1 Availability/Recovery
6.1
Database
 Outlaw
O tl
logical
l i l file
fil and
d MQT restore
t
 XA and DDL improvements
 Quiesce transactions for XSM Switchover
 Serviceability improvements
 Eliminate package corruption (V5R4 PTF)
Journaling
 Statistics DDL entries
 Implicit library journaling (STRJRNLIB, ENDJRNLIB, SQL CREATE SCHEMA)
 End Journal While Open
 Start and End Journal *ALL objects in a library
 Merge APYJRNCHG and APYJRNCHGX
 Change journal exit point (QIBM_QJO_CHG_JRNRCV)
(QIBM QJO CHG JRNRCV)
 List eligible but unprotected access paths (DSPRCYAP)
 Miscellaneous recovery improvements
© 2008 IBM Corporation
6 1 System i Navigator
6.1
On Demand Performance Center
•
•
•
•
•
•
•
•
•
•
•
Copy to spreadsheet
Customization for Analyze
Condensed Advice (PTF)
Plan Cache Event Monitor
Plan Cache properties and resize
Fast summary compare
Reset last used date and stats
Monitor filters - Storage Governor & Port
Show statements enhancements
Visual Explain while running
Additional SQL Job Information
Health Center
•
•
•
•
Environmental limits
Package and procedure in Size Limits
File activity
Journals and receivers in Overview
Database Management
•
•
•
Schema based info
Show object locks
Label and Comment cleanup
Run SQL Statements
•
•
•
•
Automatic flagger
gg
Save to spreadsheet
Save to source member
Save to UTF-8
© 2008 IBM Corporation
DB2 for i
What’s New Since 6.1
© 2008 IBM Corporation
Web Based Q
Query
y and Reporting
p
g
 Web-based query and report writing product that
replaces IBM Query for iSeries (Query/400)
 Base Product
 Report and graphing Assistants
 Power Painter
 Spreadsheet integration
 Web-enable
W b
bl Q
Query/400
/400 reportt
 DB2 for i cross system Queries
 Additional IBM Features
 Active Reports (Disconnected)
 On Line Analytical Processing
 Developer’s Workbench
 Advanced metadata creation
 SQL Wizard
 HTML Layout Painter
 Additional Add-On Available
 ERP System Integration
 250+ Database/Cube/Mining
/
/
g Connectors
 Extract/Transformation/Load
 Visual Discovery
 MS Excel Add-In
 Automatic Report Distribution / Intelligent Bursting
F more details,
For
d il refer
f to: http://www.ibm.com/systems/i/db2
h //
ib
/
/i/db2
© 2008 IBM Corporation
IBM DB2 Web Query for i
Report Broker
 Additional product IBM DB2 Web Query for i
 Easy to use graphical scheduler for
automating report execution in the
background
 Schedule reports to run on daily, weekly,
monthly, or certain days of the week.
Specify blackout dates when reports should
NOT be run
 G
Generate
t reports
t iin many different
diff
t formats,
f
t
including PDF, spread-sheets, or as an
“active” report with the Active Reports
feature of DB2 Web Query
 Automate the report distribution function
via
i email
il to
t single
i l users or multiple
lti l users
through a distribution list
 Intelligently burst the reports to send
sections of the report to regional managers
with only data pertinent to their job/region
F more details,
For
d il refer
f to: http://www.ibm.com/systems/i/db2
h //
ib
/
/i/db2
© 2008 IBM Corporation
IBM DB2 Web Q
Query
y for i
Software Development Kit (SDK)
 Additional product IBM DB2 Web Query for i
 Enables application integration of the
reporting environment through
h
h a set off
SOA-based Web Services
 Customize a web application to work with
DB2 Web Query and Report Broker functions
 Invoke these functions from an existing
application
 Link to a report from a URL within a portal
interface
F more details,
For
d il refer
f to: http://www.ibm.com/systems/i/db2
h //
ib
/
/i/db2
© 2008 IBM Corporation
MySQL
 Most popular open source DB
 Frequently
F
tl used
d with
ith PHP
 Two stages
 Stage 1
 Runs AIX version of MySQL in PASE with Support by MySQL
 Uses existing Storage engines (MyISAM)
 Stage 2
 Custom storage engine that integrates MySQL with DB2 for i
© 2008 IBM Corporation
OmniFind Text Search Server for DB2 for i
 No-charge offering (5733-OMF)
 Quickly search text in DB2 columns with advanced linguistic methods
 OmniFind can index and search:

Adobe PDF

Rich Text Format (RTF)

HTML

XML

Lotus 123

Lotus Freelance

Lotus WordPro

Microsoft Excel

Microsoft PowerPoint

Microsoft Word

Open Office 1.1 & 2.0

JustSystems Ichitaro
© 2008 IBM Corporation
DB2® for i Post 6.1
61
Enhancements
© 2008 IBM Corporation
Post V5R4 GA Enhancements
Performance
Systems Management
Validate Constraints without Checking
SQL Server Mixed Mode for Batch Processing
•
V5R4 - Database Group SF99504 Version 18
•
V5R4 - Database Group SF99504 Version 19 (planned)
•
6.1 - Database Group SF99601 Version 6
•
6.1 - Database Group SF99601 Version 8 (planned)
Preserve EVI Indexes on ALTER
Allow QSQSRVR jobs in a User Subsystem
•
V5R4 - Database Group SF99504 Version 19 (planned)
•
V5R4 - Database Group SF99504 Version 18
•
6.1 - In the base release
•
6.1 - Database Group SF99601 Version 8 (planned)
CPYFRMIMPF performance
•
V5R4 - Database Group SF99504 Version 19
•
6.1 - Database Group SF99601 Version 8
Materialize Member List Seize
•
V5R4 - Database Group SF99504 Version 20
•
6.1 – Database Group SF99601 Version 9 (planned)
Solid State Disks (SSD)

V5R4 - Database Group SF99504 Version 21 and 22
(planned)

6 1 – Database Group SF99601 Version 9 and 10
6.1
Add “Server Mode Connecting Job” to QUSRJOBI()
and System i Navigator
•
V5R4 - Database Group SF99504 Version 18
•
6.1 - Database Group SF99601 Version 7
Audit and Security
SECURE columns
•
V5R4 - Database Group SF99504 Version 19 (planned)
•
6.1 - Database Group SF99601 Version 8 (planned)
(planned)
Check the DB2 for i Home Page
© 2008 IBM Corporation
Post 6.1
6 1 GA Enhancements
Performance
SQL Procedure
P
d
Performance
P f
Enhancements
E h
t
•
Database Group SF99601 Version 7
PROGRAM TYPE SUB on CREATE PROCEDURE (SQL)
•
Database Group SF99601 Version 7
Function
Allow Unqualified SRVPGM Names for Routines
A dit and
Audit
d Security
S
it

Database Group SF99601 Version 8
RUNSQLSTM/STRSQL and client special register
•
Database Group SF99601 Version 7
*JOBCTL No Longer Required for STRDBMON on JOB(*)
•
Database Group SF99601 Version 8
STRDBMON over a View
•
Database Group SF99601 Version 9 (planned)
Availability and Recovery
Prevent EVI Rebuild On Cancel During Catch Up
•
Database Group SF99601 Version 10 (planned)
Internal Error (-901) Service Logging

Database Group SF99601 Version 10 (planned)
© 2008 IBM Corporation
Solid State Disks (SSD)
 Allows a user to indicate a media preference on an SQL table, SQL index, physical file, and
logical file
 CL command support

UNIT(*SSD) on CRTPF, CRTLF, and CRTSRCPF*

UNIT(*SSD) on CHGPF,
CHGPF CHGLF,
CHGLF and CHGSRCPF*
 SQL statement support


UNIT SSD on the object level

CREATE TABLE

ALTER TABLE

CREATE INDEX
UNIT SSD on the partition level

CREATE TABLE

ALTER TABLE ... ADD PARTITION

ALTER TABLE ... ALTER PARTITION
 CHGxxx and ALTER will asynchronously move data and indexes
V5R4 - Database Group SF99504 Version 21 and 22 (planned)
6.1 – Database Group SF99601 Version 9 and 10 (planned)
© 2008 IBM Corporation
SECURE columns
Protects
P
t t secure data
d t in
i a
database monitor and plan
cache.
Issue an SQL CALL to secure column CCNBR in table LIB1.Orders:
CALL SYSPROC.SET_COLUMN_ATTRIBUTE ('LIB1', 'ORDERS', 'CCNBR', 'SECURE YES');
P
Parameter
d
descriptions:
i i

Table_Schema
VARCHAR(10)
The system name of a table's schema.

Table_Name
VARCHAR(10)
The system name of a table.

Column_Name
VARCHAR(10)
The system column name that is secured.

Attribute
VARCHAR(10)
The attribute being set for the column.
The valid values of the Attribute are:

SECURE NO
cache.
- This column
col mn does not contain data that needs to be secured
sec ed in a database monitor
monito or
o plan

SECURE YES - This column contains data that needs to be secured in a database monitor or plan cache. All
variable values for any query that references this column will not be visible in a database monitor or plan
cache unless the security officer has started the database monitor or the security officer is accessing the plan
cache.
Notes

Calling the procedure will require an exclusive lock and enough authority to alter the table.

It will generate a journal entry so the HABPs can replay it on another system.
© 2008 IBM Corporation
SECURE columns
Prior to V7R1, the following statements may need to be issued once:
CREATE PROCEDURE SYSPROC.SET_COLUMN_ATTRIBUTE (
Table_Schema
VARCHAR(10),
Table_Name
VARCHAR(10),
Column_Name
VARCHAR(10),
Attribute VARCHAR(10) )
LANGUAGE C PARAMETER STYLE SQL
MODIFIES SQL DATA
SPECIFIC QDBCATTR
EXTERNAL NAME 'QSYS/QDBSSUDF2(QDBCATTR)';
GRANT EXECUTE ON PROCEDURE SYSPROC.SET_COLUMN_ATTRIBUTE TO PUBLIC;
© 2008 IBM Corporation
SQL Server Mode
Subsystem control
SQL Server mode jobs (QSQSRVR) reside within the QSYSWRK subsystem.
Some customers want the server mode jobs to run in the subsystem of the
application, to permit better performance controls and serviceability.
The support is enabled with an environment variable.
variable
To enable the switch:
ADDENVVAR ENVVAR(QIBM_SRVRMODE_SBS)
VALUE('*SAME')
LEVEL(*SYS)
SQL CLI control provided via new connection
attribute SQLSetConnectAttr() SQL ATTR SERVERMODE SUBSYSTEM
SQL_ATTR_SERVERMODE_SUBSYSTEM
JDBC control provided via new connection
property - servermode subsystem
© 2008 IBM Corporation
SQL Server Mode
Improved identification of current user
Some customers have thousands of active SQL Server mode jobs.
System i Navigator has been improved to show the current application user and thread.
© 2008 IBM Corporation
SQL Server Mode
Improved identification of current user
Green screen users can see the connecting job, but not the thread detail.
© 2008 IBM Corporation
Collect SQL details
For all statements executed
via STRSQL or RUNSQLSTM
Start SQL Interactive Session (STRSQL command) users will
observe the following client special register values:
CLIENT
CLIENT
CLIENT
CLIENT
CLIENT
PROGRAMID = 'STRSQL'
APPLNAME
= 'START SQL INTERACTIVE SESSION'
USERID
= The current user's name
WRKSTNNAME = The DB2 for i database name
ACCTNG
= The current user's accounting code
(i.e. ACGCDE parameter on CHGUSRPRF)
Run SQL Statements (RUNSQLSTM command) users will
observe the following client special register values:
CLIENT
CLIENT
CLIENT
CLIENT
CLIENT
PROGRAMID
APPLNAME
USERID
WRKSTNNAME
ACCTNG
= 'RUNSQLSTM'
= 'RUN SQL STATEMENTS'
= The current user's name
= The DB2 for i database name
= The current user's accounting code
(i.e. ACGCDE parameter on CHGUSRPRF)
© 2008 IBM Corporation
Collect SQL details
for all statements executed
via STRSQL or RUNSQLSTM
Corporate auditing requirements (SOX) are becoming more demanding.
SOX officers are responsible for establishing and maintaining internal controls.
Some companies have decided to record and archive all the SQL statement activity for
command interface users.
Th D
The
Database
t b
Monitor
M it client
li t register
i t pre-filters
filt
can be
b used
d tto solve
l
this
thi need.
d
Example:
STRDBMON OUTFILE(QGPL/STRSQLMON1)
OUTMBR(*FIRST *REPLACE)
JOB(*ALL/*ALL/QPADE*)
TYPE(*DETAIL)
COMMENT( FTRCLTPGM(STRSQL) )
COMMENT('FTRCLTPGM(STRSQL)')
<.....>
ENDDBMON JOB(
JOB(*ALL/*ALL/QPADE*)
ALL/ ALL/QPADE ) )
© 2008 IBM Corporation
Collect SQL details
only for statements executed
by CQE or SQE
Focus monitor collection on either CQE or SQE queries. This helps to minimize the
overhead of monitoring SQL requests.
Example:
STRDBMON OUTFILE(lib/file)
…
COMMENT('WANT_CQE_ONLY')
STRDBMON OUTFILE(lib/file)
…
COMMENT('WANT_SQE_ONLY')
© 2008 IBM Corporation
CREATE PROCEDURE – PROGRAM TYPE SUB
Add the following option to CREATE PROCEDURE (SQL) and ALTER PROCEDURE (SQL).
option-list
>--+-------------------+----->
+-PROGRAM TYPE MAIN-+
'-PROGRAM TYPE SUB--'
Service program calls perform
faster than program calls
PROGRAM TYPE MAIN
Specifies that the routine executes as the main entry point in a
program. The external program generated will be a *PGM object.
PROGRAM TYPE SUB
Specifies that the routine executes as a procedure in a service
program. The external program generated will be a *SRVPGM object.
© 2008 IBM Corporation
DB2® for i What’s Next
Disclaimer: The following information is tentative
and might not come to fruition.
IBM makes no guarantees or commitments to provide the features or
functions listed here.
© 2008 IBM Corporation
Possible Future SQL Enhancements
Queries and Data Change statements (DML)

MERGE

Result set support in embedded SQL
Schema statements (DDL)
 XML data type
 Global variables
 Array support in routines
 Encryption enhancements (FIELDPROCS)
 Three-part Aliases
 Partition table enhancements
Scalar Functions

XML functions

MQ Series functions

TIMESTAMP_FORMAT and VARCHAR_FORMAT enhancements
Miscellaneous
 Parameter marker enhancements
 Expressions in CALL
© 2008 IBM Corporation
Possible Future SQL Query Engine (SQE)
SQE Ch
Characteristics
t i ti






Parallel to Normal Release Enhancements
Object Oriented Design
Enhanced Performance primarily for complex queries
Enhanced Optimization Engine
Enhanced Statistics
Encoded Vector Indexes Enhancements
SQE Delivery
First Wave
Second Wave
Third Wave
Fourth Wave
Fifth Wave
Sixth Wave
V5R2 GA
mid-V5R2
V5R3 GA
mid-V5R3
V5R4 GA
6.1 GA
SQE (Stage 7)
• Logical File support
• Adaptive Query Processing (AQP)
• Other miscellaneous pperformance enhancements
© 2008 IBM Corporation
Possible Future Performance Enhancements
SQL Runtime Performance Improvements
 SQL
Q function enhancements ((inline functions))
 OVRDBF and REUSEDLT(NO)  support available now via Lab Services
 EVI enhancements
CREATE ENCODED VECTOR INDEX idx2 ON sales (region)
INCLUDE ( SUM(sales) )
SELECT region,
region SUM(sales) FROM sales GROUP BY region
Database Maintenance Performance Improvements
 ALTER TABLE performance and concurrency
© 2008 IBM Corporation
Possible Future Limits/Availability/Recovery
SQL Application and Runtime Limits
 128-byte
128 b t schema
h
names
Database
 Currently Committed
 Allow transactions to span *SYSBAS and IASPs
 CHGPFCST CHECK(*YES
(
*NO))
 CHGSRCF TEXT(*FROMMBR) SRCTYPE(*FROMMBR)
Journaling
 Additional filtering based on generic names on STRJRNLIB and CHGJRNOBJ
to control what journaling implicitly gets started
 Additional control on whether journal entries for an object(s) should be
fl
filtered
d on remote journaling
l
 Option 42 (HA Journal Performance)
© 2008 IBM Corporation
Possible Future System i Navigator
On Demand Performance Center
•
•
•
•
Database
D
t b
monitor
it
− Client register filter
− Monitor over a View (PTFed)
Authority changes
SQL details for a job
Save Show Statements
Database Management
•
•
•
•
•
•
•
Support for DB enhancements
Support for Omnifind indexes
Large list performance
Partitioned table enhancement for Show
Indexes and Show MQTs
Generate
Ge
e ate SQ
SQL option
opt o to include
c ude GRANTs
G
s
Status
− Reorganize enhancements
− Index build
− ALTER TABLE
Save folder contents
© 2008 IBM Corporation
© 2008 IBM Corporation
© 2008 IBM Corporation
Download