This is an old revision of the document!
DB2
Connection to db, choosing schema and doing queries:
su - db2instance_user_id db2 connect to tsmdb1 db2 set schema tsmdb1 db2 "select * from tsmdb1.mms_drives" db2 "select * from tsmdb1.drivest"
Drop Database afer Installationproblems/Errors:
Login as the Instance user. If needed CD to your db2 instance directory.
/opt/tivoli/tsm/db2/instance/ do: db2start db2 drop db tsmdb1
Do db2ilist to get a list of all the current instance names db2ilist db2stop
Change to the root user ID to do the next command (CD back to the instance directory– Example: /opt/tivoli/tsm/db2/instance/) :
db2idrop <instance name> "db2idrop tsm1"
Delete all files located in the instance directory. Example:
/tsm1/<instance_name> /tsm1/tsmdb001 /tsm1/tsmlog /tsm1/tsmarchlog /tsm1/tsmlogmirror /tsm1/tsmarchlogfailover
TSM Instance down.
Paket läuft noch, db prozesse laufen noch, dsmserv killed
db2fodc -hang
DB2 Extend
extend dbpsace $dir
Space is not available to TSM until:
db2 connect to tsmdb1 db2 set schema tsmdb1
db2 alter tablespace SYSCATSPACE rebalance db2 alter tablespace USERSPACE1 rebalance db2 alter tablespace LARGESPACE1 rebalance db2 alter tablespace LARGEIDXSPACE1 rebalance db2 alter tablespace IDXSPACE1 rebalance db2 alter tablespace SYSTOOLSPACE rebalance
db2 ALTER TABLESPACE USERSPACE1 LOWER HIGH WATER MARK db2 ALTER TABLESPACE IDXSPACE1 LOWER HIGH WATER MARK db2 ALTER TABLESPACE LARGESPACE1 LOWER HIGH WATER MARK db2 ALTER TABLESPACE LARGEIDXSPACE1 LOWER HIGH WATER MARK
db2 ALTER TABLESPACE USERSPACE1 REDUCE MAX db2 ALTER TABLESPACE IDXSPACE1 REDUCE MAX db2 ALTER TABLESPACE LARGESPACE1 REDUCE MAX db2 ALTER TABLESPACE LARGEIDXSPACE1 REDUCE MAX
DB2 Corrupt
Vermutlich nach/druch Upgrade der Firmware eines Storage Systems war die Datenbank von TSM korrupt. - TSM crasht - Neustart nicht möglich. - Restore DB nicht möglich, da alte Backups den Fehler ebenfalls enthalten.
Lösungsweg. Nur bei kleinen Datenbanken realisierbar. Sonst dauert der Vorgang zu lange
Prüfen der Datenbank auf Fehler:
tsm1@tsm1:/home/tsm1> db2dart tsmdb1 /db
The requested DB2DART processing has completed successfully!
Complete DB2DART report found in:
/home/tsm1/sqllib/db2dump/DART0000/TSMDB1.RPT
in diesem File stehen die Defekten Indizes und/oder Tabellen. Wenn nur Index betroffen, kann dies repariert werden. Wenn Tabellen betroffen sind kann der Fehler nur durch IBM behoben werden (dauert SEEEEEHR lange)
Drop the corrupt index:
1. db2start
2. db2 Update database configuration for TSMDB1 using indexrec access
3. db2stop force
4. db2dart TSMDB1 /MI /TSI 4 /OI 48 <- MI: Lösche Index, TSI: , OI:
tsm1@tsm1:/> db2dart TSMDB1 /MI /TSI 4 /OI 48
Attempting to mark index object (p=4;o=48) as bad.
Modification for page (obj rel 0, pool rel 2944) of pool ID (4) obj ID (48), written out to disk successfully.
The requested DB2DART processing has completed successfully!
Complete DB2DART report found in:
Regenerate the index:
1. db2start
2. db2 connect to TSMDB1
3. db2 set schema TSMDB1
4. db2 "select count(*) from TSMDB1.ACTIVITY_LOG" <- beliebiger Select baut den Index wieder auf
5. db2stop force
6. Start TSM normally.
Afterwards, verify that nothing else is corrupt via the db2dart utility.
1. Halt TSM. 2. Issue "db2dart TSMDB1 /db". 4. Start TSM again.
