Tuesday, September 17, 2024

Logins History of a particular DB user from audit Tables

 SELECT

   distinct(os_username),username,userhost,timestamp

FROM

    sys.dba_audit_session where username in ('<UserName>')


How to Clear the /tmp file system which is 100% due to Failed Scripts run.

 /tmp File system hit 100% after running some extraction that failed in half-way. The extracted files were deleted but the Space is not released.


Filesystem                                                               Size  Used Avail Use% Mounted on

/dev/mapper/rhel-tmp                                                      20G   20G   20K 100% /tmp


Find the runaway  os process that is not releasing the space.

************************************************

use the below command 

ll -d /proc/[1-9]*/fd/* | grep /tmp/

l-wx------ 1 apps apps 64 Sep 16 06:20 /proc/2200/fd/1 -> /tmp/OracleExtracts/nohup.out (deleted)

l-wx------ 1 apps apps 64 Sep 16 06:20 /proc/2200/fd/2 -> /tmp/OracleExtracts/nohup.out (deleted)

lr-x------ 1 apps apps 64 Sep 16 05:20 /proc/2200/fd/9 -> /tmp/OracleExtracts/Oracle_Extract_Scripts_ALL.sql (deleted)

l-wx------ 1 apps apps 64 Sep 16 06:20 /proc/624/fd/1 -> /tmp/OracleExtracts/nohup.out (deleted)

l-wx------ 1 apps apps 64 Sep 16 06:20 /proc/624/fd/2 -> /tmp/OracleExtracts/nohup.out (deleted)

lr-x------ 1 apps apps 64 Sep 16 06:20 /proc/624/fd/9 -> /tmp/OracleExtracts/Oracle_Extract_Scripts_ALL.sql (deleted)


Kill the os process identified in above  output

************************************

kill -9 624 

kill -9 2200


After killing the os processes the system FS "/tmp" will be back to normal


Filesystem                                                               Size  Used Avail Use% Mounted on

/dev/mapper/rhel-tmp                                                      20G      34M  20G   1% /tmp