Sponsored Content
Top Forums Programming DB2 z/os How to Track table delete Activities Post 303026863 by Neo on Tuesday 4th of December 2018 06:45:35 AM
Old 12-04-2018
This is my second warning... do not post by cutting and pasting formatting "junk" from another web site here.

You need to get rid of all this "other invalid formatting" before posting.
Code:
[FONT=Corbel]Dear Team 
[/FONT][FONT=Corbel]I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) 
[/FONT][B][FONT=Corbel]Scenario [/FONT][/B][FONT=Corbel]
[/FONT][FONT=Corbel]We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted entire table . Since its test environment - the privileges are given as expected. [/FONT][FONT=Corbel]
[/FONT][B][FONT=Corbel]Expectations[/FONT][/B][FONT=Corbel]: Is there a way to capture/track at user level ? Can we track which user deleted this table or updated/inserted etc. 
[/FONT][B][FONT=Corbel]What I Tried[/FONT][/B][FONT=Corbel] : Trigger was my first thought . Second was temporal tables ( Not explored) 
[/FONT][FONT=Corbel]I created a trigger with table that captures insert records with below example . I am able to figure out whenever insert/update/delete happens . however I am unable to capture which user did this . How can be track this ? Can we use SYSIBM.SYSTABAUTH ( Grantee column has user name ) But how can this be mapped 
Example of insert logic[/FONT][FONT=Corbel]

CREATE TRIGGER TEST_SAMPLE_INSERT
AFTER INSERT ON TEST_SAMPLE
REFERENCING NEW AS N
FOR EACH ROW
BEGIN ATOMIC
INSERT INTO X_TEST_SAMPLE ( action_timestamp,action_type,before_or_after, Other attributes of table )
Values (current timestamp,'I','A',Other attributes of table )
[/FONT][FONT=Corbel]
[/FONT][FONT=Corbel]
[/FONT][FONT=Corbel]Any help appreciated . Would love to learn new ways to capture this at user level[/FONT]

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Track changes to Oracle table

Hi, I'm trying to write a program with unix shell scripting to track the changes of a particular table in the Oracle database. I've try reading up on sql TRIGGER function, but I'm not sure if its feasible here. Any idea what kind of syntax should I use to track the changes in the table? Can... (0 Replies)
Discussion started by: mervinboyz
0 Replies

2. Shell Programming and Scripting

How to connect DB2 table using shell script

Hi All, I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field. Could any one please help me in connecting database tables using Unix and retriving data from the same. Thanks, Durwas (0 Replies)
Discussion started by: dtidke
0 Replies

3. Shell Programming and Scripting

Export data from DB2 table to .txt file(space delimited)

Hi I need help on this. Its very urgent for me.. please try to help me out.. I have data in tables in DB2 database. I would like to export the data from DB2 tables into a text file, which has to be space delimited. so that I can carry out awk, grep operations on that file. I tried to export... (2 Replies)
Discussion started by: ss3944
2 Replies

4. Shell Programming and Scripting

Connect to DB2 table using Shell scripts

Can anyone please help me with an unix shell script to connect a DB2 database. My requirement is just to display the no of records present in a table of a DB2 database through Unix Shell script. Thx - Ram (1 Reply)
Discussion started by: onlyraja
1 Replies

5. Shell Programming and Scripting

select values from db1 table and insert into table of DB2

Hi I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.) I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Discussion started by: aemunathan
2 Replies

6. Shell Programming and Scripting

Read parameter file in a shell script to unload a DB2 Table???

Hi , I Have following requirement: DB2 Sql query to pass from a parameter file for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies

7. Programming

DB2 Query to check table counts,start end time

Dear team I am using DB2 and wish to capture the ETL status on daily basis so that i can run the query and share the details in xls format to respective mail ids . Currently i am using below query but this displays table name and counts for latest run. select name ,CARD from... (0 Replies)
Discussion started by: Perlbaby
0 Replies

8. Programming

DB2 - Tracking Table history

HI team Is it possible to track DB2 table on the data insertion,deletion and updates on daily basis . Do we have any inbuilt feature to handle audit analysis ? Any help appreciated (1 Reply)
Discussion started by: Perlbaby
1 Replies

9. Shell Programming and Scripting

Python Script to take file count and insert into DB2 table

Team I have files in different directories . How can i take the count of latest file and insert into Db2 table . I am using awk 'END{print NR+1-ARGC}' (File name) to get the counts. How can i take 1.The count of latest file 2.Insert into Db2 table( File Name and Counts) . cd... (4 Replies)
Discussion started by: Perlbaby
4 Replies

10. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies
VCONSOLE.CONF(5)                                                   vconsole.conf                                                  VCONSOLE.CONF(5)

NAME
vconsole.conf - configuration file for the virtual console SYNOPSIS
/etc/vconsole.conf DESCRIPTION
The /etc/vconsole.conf file configures the virtual console, i.e. keyboard mapping and console font. The basic file format of the vconsole.conf is a newline-separated list environment-like shell-compatible variable assignments. It is possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported, allowing applications to read the file without implementing a shell compatible execution engine. Note that the kernel command line options vconsole.keymap=, vconsole.keymap.toggle=, vconsole.font=, vconsole.font.map=, vconsole.font.unimap= may be used to override the console settings at boot. Depending on the operating system other configuration files might be checked for configuration of the virtual console as well, however only as fallback. OPTIONS
The following options are understood: KEYMAP=, KEYMAP_TOGGLE= Configures the key mapping table of for they keyboard. KEYMAP= defaults to us if not set. The KEYMAP_TOGGLE= can be used to configured a second toggle keymap and is by default unset. FONT=, FONT_MAP=, FONT_UNIMAP= Configures the console font, the console map and the unicode font map. FONT= defaults to latarcyrheb-sun16. EXAMPLE
Example 1. German keyboard and console /etc/vconsole.conf: KEYMAP=de-latin1 FONT=latarcyrheb-sun16 SEE ALSO
systemd(1), loadkeys(1), setfont(8), locale.conf(5) AUTHOR
Lennart Poettering <lennart@poettering.net> Developer systemd 10/07/2013 VCONSOLE.CONF(5)
All times are GMT -4. The time now is 01:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy