Topic
No replies
IsabellSchwertle(IBM)
4 Posts
ACCEPTED ANSWER

Pinned topic Deletion of reporting records based on the domain name

‏2012-05-11T06:43:29Z |
During EOTC, we discussed housekeeping of our reporting tables - and the question came up how to delete reporting records of old automation domains, so they no longer appear in the reporting selection dialogs.
We would like to share the solution with you:
Log in to the system where your end-to-end automation database is installed or ask your DB2 admin to perform the necessary steps for you.
1)Open a command prompt.
2) Issue the following command to connect to the end-to-end automation database: db2 -v CONNECT TO <eautodb_name> USER <your_db2_user> USING <your_db2_password>
3) Issue the following command to get all domain names for which records exist in the database: db2 -v "select distinct domainname from eautousr.eezcommonevents"
Sample output
db2inst1@<hostname>:~> db2 -v "select distinct domainname from eautousr.eezcommonevents"
select distinct domainname from eautousr.eezcommonevents

DOMAINNAME

FriendlyE2E
SAAppManBVT
as
db2domain
p6dom
test

6 record(s) selected.

Pick the domain names for which you want to delete records and run the delete command (*NOTE - all records for the specific domain will be gone after that command!*) - db2 -v "DELETE FROM eautousr.eezcommonevents WHERE domainname='name1' OR domainname='name2'" - the "OR ..." statement can be dropped (for only one domainname) or repeated as often as required.

Sample output
db2inst1@<hostname>:~> db2 -v "delete from eautousr.eezcommonevents WHERE domainname='as' OR domainname='p6dom'"
delete from eautousr.eezcommonevents WHERE domainname='as' OR domainname='p6dom'
DB20000I The SQL command completed successfully.

Verify the result
db2inst1@<hostname>:~> db2 -v "select distinct domainname from eautousr.eezcommonevents"
select distinct domainname from eautousr.eezcommonevents

DOMAINNAME

FriendlyE2E
SAAppManBVT
db2domain
test

4 record(s) selected.