Gewissenhafte DBA's benennen allle ihre Primary Key und Check Constraints explizit. Damit kann man prima über Entwicklungs-, Test- und Produktions-Umgebungen hinweg, sofern erforderlich, einen Constraint überarbeiten, sprich löschen und geändert ieder aufbauen.
Aber was tun, wenn man keinen Constraint-Namen vergeben hat, ... weiterlesen
Hi folks,
db2pd -alldbs -apinfo liefert ja wirklich schon allerhand nützliche Informationen, die sich aber leider nur schlecht automatisiert weiterverarbeiten lassen.
Klar, es gibt zahlreiche Table Functions, Stored Procs und anderes Gedöns, das aber leider einen Connect an die Datenbank(en) erforderlich macht. ... weiterlesen
Gesucht war eine Möglichkeit, als Berichtszeitraum immer nur von Montag bis Freitag der Vorwoche oder der ablaufenden Woche zu selektieren. Ab Freitag (-nacht), Samstag und Sonntag sollte immer die aktuelle Woche selektiert werden, sonst die Vorwoche.
Beispiel: Am Ender einer Woche ... weiterlesen
Graeme Birchall, der Autor der legendären DB2 Cookbooks, hat sich in den Ruhestand begeben und seine Web Site aufgegeben. Graeme hat sich ausdrücklich die kostenfreie Bereitstellung seines Cookbooks gewünscht. Bevor die Dateien in den Weiten des Webs verloren gehen, ... weiterlesen
In diesem Beispiel wird von einem Unix/AIX das DB2LOOK Utility über Secondary AuthID an ein DB2 for z/OS Subsystem gebunden.
[crayon-5c6f0459a9527501444386/]
Bei einem BIND an DB2 for z/OS sind die anderen .bnd-Files unerheblich - sie werden nur für DB2 Unix oder DB2 ... weiterlesen
--------------------------------------------------------------------------------
-- SQL-Table-Index-Metrics.sql - Table/Index metrics since DB2 start/connection
-- DB2 9.7 FP 5 and later
--------------------------------------------------------------------------------
-- Number of INSERT/UPDATE/DELETE/SELECT and Tablescans,
-- overflows and page reorgs since first DB Connection
SELECT *
FROM TABLE(MON_GET_TABLE('','',-2)) AS T
;
-- Number of INDEX_SCANS, INDEX_ONLY_SCANS, KEY_UPDATES.
-- PSEUDO_DELETES, ... weiterlesen
Loading data of DB2 z/OS internal format into a DB2 Linux/Unix/Windows database became very easy.
Either you use DB2 Connect to connect from any DB2 Linux/Unix/Windows to DB2 for z/OS. But this costs you a separate license fee. For a distinct ... weiterlesen
Does your application has to check cerrtain authorzation id's for certain access rights needed? Following SQL shows some ways how to proceed:
[crayon-5c6f0459ad35c581956929/]
In this sample the SQL's have to check incoming userid's for having ..
L0nnnnnn or F0nnnnnn
where n=0-9
except first letter should ... weiterlesen
The following script references "Perl module xmpPerl.pm – function package used by DBA Perl scripts"
The following very simple script is just a small frame for sending mail via network from command level or as a service for other scripts.
[crayon-5c6f0459adab4330022393/]
For more ... weiterlesen
Do you need to execute one ore more commands at all of your DB2 instances? Then you should deploy xmpDB2all.sh!
This script ...
locates all DB2 instances using profiles.reg (DB2 9.1) or global.reg (9.7 or later)
executes commands passed as arguments
[crayon-5c6f0459ae3f2941501742/]
(Some comments are ... weiterlesen
xmpTBSCStmt.pl provides following functions:
creates CREATE TABLESPACE statements for existing database
creates REDIRECTED RESTORE statements for a database you possibly want to or need to recover at a remote site
creates ALTER TABLESPACE statements to reduce tablespace size and/or to lower the high ... weiterlesen
xmpTerm.pl provides following functions ...
lists all databases (local and remote) at current DB2 instance
lists all connections at the DB2 instance, or only those connected to a specified database
terminates all connections, or only those connected to a specified database, or a specific ... weiterlesen
You need to check the version of your Java Combined Client (JCC) installed? Try this way:
[crayon-5c6f0459b2541540114116/]
All DB2 JDBC Driver versions, see here!
More information on DB2, Java, JDBC and JCC.
This Perl script verifies the interface to DB2 whicht consists of the general database interface, called DBI, and the DB2-specific supplement, called DBD::DB2.
This script uses the xmpPerl.pm library, which is also available at this site.
[crayon-5c6f0459b2d28328709277/]
Do you want to generate a timestamp in external DB2 format YYYY-MM-DD-HH.MM.SS.ssssss?
Use either following functions which is already part of the xmpPerl.pm function library:
[crayon-5c6f0459b34ea852976200/]
Or try following Perl statements which are compatible to POSIX and are portable to other platforms:
[crayon-5c6f0459b34f1483971364/]
This perl module contains all functions need by xmp perl scripts, published at www.ruban.de. You should easily adapt some constant values to your pesonal needs.
Some comments are in german. If you need assistence, don't hesitate to contact me.
[crayon-5c6f0459b3fe4687667533/]
Perl script to administer files, especially DB2 administration files, like db2diag.log, admin log file, or any other file. It helps to archive, compress, rename or delete one or more files, optionally when size or age surpasses a threshold value.
[crayon-5c6f0459b4e0e611786912/]
-d=apply on db2diag.log ... weiterlesen
Activate requested DB2 environment:
Search for registered DB2 software version, instances, databases and execute the appropriate DB2 environment. The KSH shell script is quite useful on sites with more than one DB2 instance.
[crayon-5c6f0459b59db558129586/]
This KSH shell script executes DB2 SQL statements and commands. The script and starts an DB2 enviroment connects itself to the database specified as argument.Â
[crayon-5c6f0459b66db476986413/]
Perl script to create UPDATE DB|DBM CFG statements for databases and instances, prints ordered list of confuguration options. Enables users to "copy" or "save" configurations.
[crayon-5c6f0459b74aa661500873/]