|
|
-
|
|
Use this process to record all sql statements for a give period of time on DB2.
In other words, a trace
#connect to db
#1-Create event monitor- make sure you've got write permissions to stated folder
db2 "CREATE EVENT MONITOR stmon FOR STATEMENTS WRITE TO FILE '/tmp'"
#2 Turn on event monitor
......
|
|
-
|
|
The idea of table sizes in DB2, can spawn into a wide ranging conversation. This is a quicj script tha I use to output the DB2 table sizes, comparing used and allocated space.
SELECT
char(date(t.stats_time))||' '||char(time(t.stats_time)) AS statstime
,substr(t.tabschema,1,4)||'.'||substr(t.ta......
|
|
-
|
|
Quite often I get a monitoring message stating the drive space is filling, I'll execute some DB2 clean up scripts, but still the problem persists. This little script quicly finds the largest 20 files on a Linux server, execute it from the command line.
du -a /my_folder | sort -n -r | head -n 20
......
|
|
-
|
|
Useful code to gather the rowcount of all tables, worth doing a reindex prior to this code
############START#################
SELECT
SCHEMA_NAME(t1.schema_id) AS [schema],
t1.name AS [table],
i1.rows AS [row_count]
FROM sys.tables AS t1 INNER JOIN
sys.sysindexes AS i1 ON t1.object_id = i1.......
|
|
-
|
|
On a production system running DB29.5 on Red Hat Linux 4.6.
If you want to keep the health monitor running, you can increase
the size of MON_HEAP_SZ to about 2048. But I decided to turn the Health
Monitors Off, due to overconsumption of memory.
These are OLTP databases. Since I've turned off th......
|
|
-
|
|
I was asked to troubleshoot a problem related to a HADR start.
and issued the following db2 command:
$ db2 start hadr on db MY_DB as standby
I got back the following error description.
SQL1768N Unable to start HADR. Reason code = "1".
It turns out the the users had attempted to set HADR up wit......
|
|
-
|
|
I was doing some TSA testing, in preparation for HADR automation and as part of
the testing I did a:
mv ./sqllib/adm/db2start db2start.mv
When trying to reverse the change:
mv db2start.mv ./sqllib/adm/db2start
the file lost its setuid
and I was getting a systenm error
The resolut......
|
|