Search

1 to 6 of 6
Sort by

Library Entry
FIND ALIASES WITHOUT EXISTING TABLES

SQL statement for DB2 on Z; identify and create DROP statements for all aliases whose tables (or views) do not currently exist. (Uses Common Table Expression and UNION to create multi-line output)

2 attachments


Library Entry
SQL: Recent Util History for Tablespaces, including lack of backup

Catalog query identifying several data events for tablespaces, within the past n (31, in the example) days. Results are verbose.


Library Entry
SQL: Find Tablespaces without Recent Backups

Using left-outer join, identify any tablespaces or partitions (I don't include code for copyable indexes in this version, sorry) which have not been recently (31 days, in the sample code) backed up, or recently loaded with REPLACE. (Either event will remove a tablespace from this result set.) ...


Library Entry
SQL to extract low2key & high2key values for DECIMAL data

The below SQL interprets the columns high2key & low2key of sysibm.syscolumns for decimal columns. Note the restrictions: coltype='DECIMAL' (since just designed for this case) and statstime (which should normally guarantee that low2key and high2key are filled). WITH a(t,c,n,l,s,v1,v2) AS ...


Library Entry
Derive DB2 Dataset Names from the Catalog

Multi-statement SQL-only script, should be executable in all standard DB2 SQL processors (Data Studio, TEP2, SPUFI, Command Processor). Create Declared Global Temporary Tables; populate with DB2 Catalog Entry elements needed to create names of the underlying VSAM datasets; UPDATE to populate...


Library Entry
[F09] The ABC’s of Disaster Recovery

This is your first disaster recovery drill, and you are wondering what is involved. We will go thru the process from A to Z. Our discussion will start with an overview of the fundamentals of DB2 infrastructure: the catalog and directory, the BSDS, and the active and archive logs. After a...

EU13F09.pdf