on 2019 Sep 24 8:44 AM
Hello All,
Need to track the IP Address of the system where any login tries to attempts to connect to SAP IQ DB server.
Other logins are using Interactive SQL to connect to the server & making logins to be locked everyday . Need to trace the IP address where logins were attempting wrong password attempts.
Thanks
Y S
You could use a combination of the following events and event parameters to track connections and connection failures. Note that the event parameter 'AppInfo' contains the IP address.
CREATE EVENT "DBA"."TQ_TrackConnection" TYPE "Connect"
ENABLE
HANDLER
BEGIN
DECLARE conid unsigned bigint;
DECLARE usr VARCHAR(128);
DECLARE ai varchar (4096);
SET conid = event_parameter ('ConnectionId');
SET usr = event_parameter ( 'User' );
SET ai = event_parameter ('AppInfo');
// Write out the Connection ID, user name, application information
INSERT INTO TQ_AUDIT.TQ_Connection( Conn_ID, user_name,app_info )
VALUES(conid, usr,ai );
COMMIT;
END;
commit;
CREATE EVENT TQ_ConnFail TYPE ConnectFailed
ENABLE
HANDLER
BEGIN
DECLARE usr CHAR(128);
SET usr = event_parameter( 'User' );
// Put a limit on the number of failures logged.
IF (SELECT COUNT(*) FROM TQ_Audit.ConnectionFailure
WHERE user_name = usr
AND tm >= DATEADD( minute, -30,
CURRENT TIMESTAMP )) < 20 THEN
INSERT INTO TQ_Audit.ConnectionFailure( user_name )
VALUES( usr );
COMMIT;
// Delete failures older than 7 days.
DELETE TQ_Audit.ConnectionFailure
WHERE user_name = usr
AND tm < dateadd( day, -7, CURRENT TIMESTAMP );
COMMIT;
END IF;
END;
commit;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.