Technical posts/Oracle

오라클 lmd0 .trc 삭제 / 오라클 파일삭제 후 파일용량 미반환 / 용량큰 .trc 파일 삭제 / 용량 큰 trace 파일 삭제

ODB 2015. 2. 27. 17:28

오라클 lmd0 .trc 삭제 / 오라클 파일삭제 후 파일용량 미반환 / 용량큰 .trc 파일 삭제 / 용량 큰 trace 파일 삭제 


어떤 제목이 어울릴까 한참 생각을 했다... 결론은 어울리는 제목이 없다!


금일

2node RAC로 구성된 특정사이트에서 1번노드에 여유공간이 부족하여 장애분석을 했다


[asisdb01:/oracle]$df -k

Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on

/dev/hd4          3145728   2744712   13%    15652     3% /

/dev/hd2          5242880   1839368   65%    61249    13% /usr

/dev/hd9var       5242880   2186476   59%     7261     2% /var

/dev/hd3          4194304   2605708   38%      948     1% /tmp

/dev/hd1          5242880   5223928    1%       61     1% /home

/dev/hd11admin      262144    261648    1%       10     1% /admin

/proc                   -         -    -         -     -  /proc

/dev/hd10opt      1048576    817364   23%    10263     6% /opt

/dev/new_archlv   103809024  54727360   48%     4610     1% /ora_arch

/dev/oraclerac    52428800   7013344   87%   106210     6% /oracle


[asisdb02:/oracle]$df -k

Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on

/dev/hd4          3145728   2708428   14%    14305     3% /

/dev/hd2          5242880   1996692   62%    61241    12% /usr

/dev/hd9var       5242880   2172428   59%     7208     2% /var

/dev/hd3          2097152    406640   81%     1918     3% /tmp

/dev/hd1          5242880   5223964    1%       61     1% /home

/dev/hd11admin      262144    261648    1%       10     1% /admin

/proc                   -         -    -         -     -  /proc

/dev/hd10opt      1048576    817868   23%    10263     6% /opt

/dev/oraclerac    52428800  33669992   36%    92947     2% /oracle

/dev/new_archlv   103809024  93418056   11%       22     1% /ora_arch


보시다시피

1번노드가 더 많이 사용하고 여유공간이 7기가 밖에 없다!


파일을 지워야지!


[asisdb01:/oracle]$du -sk *

40      TT_DB

86708   admin

14788   app

4       install.platform

0       lost+found

7120    oraInventory

10945100        product

2624    sh

88      sql

4       sqlnet.log

7472680 stage


합계 : 18,529,156 KB (약 18기가)


[asisdb02:/oracle]$du -sk *

40      TT_DB

332000  admin

0       core

0       imsi

0       lost+found

1076    oraInventory

12567608        product

4       restore_arch

5557680 stage


합계 : 18,458,408 KB (약 18기가)


잠깐?

읭?


특별하게 큰 파일이 없다!


리스너로그나 트레이스 과다생성으로 특정경로의 용량이 어마어마 할 줄 알았지만 아니다


음..

fuser가 프로세스를 알려주기는 하는데...


fuser Command


Purpose


       Identifies processes using a file or file structure.


Syntax


       fuser [ -c | -d | -f ] [ -k | -K { SignalNumber | SignalName }] [ -u ] [ -x ] [ -V ]File ...


Description


       The fuser command lists the process numbers of local processes that use the local or remote files specified by the File parameter.

       For block special devices, the command lists the processes that use any file on that device.


       Each process number is followed by a letter indicating how the process uses the file:

       c

            Uses the file as the current directory.

       e

            Uses the file as a program's executable object.

       r

            Uses the file as the root directory.

       s

            Uses the file as a shared library (or other loadable object).


       The process numbers are written to standard output in a line with spaces between process numbers. A new line character is written to

       standard error after the last output for each file operand. All other output is written to standard error.


       The fuser command will not detect processes that have mmap regions where that associated file descriptor has since been closed. Also,

       processes using FIFOs (named pipes) will not be detected until the FIFO is fully opened. For example, a process waiting for an open

       system call to complete will not be seen by the fuser command.


Flags


       -c

            Reports on any open files in the file system containing File.

       -d

            Implies the use of the -c and -x flags. Reports on any open files which have been unlinked from the file system (deleted from

            the parent directory). When used in conjunction with the -V flag, it also reports the inode number and size of the deleted file.

       -f

            Reports on open instances of File only.

       -K SignalNumber | SignalName

            Sends the specified signal to each local process. Only the root user can kill a process of another user. Signal can be specified

            as either a signal name, such as -9 or KILL for the SIGKILL signal. Valid values for SignalName are those which are displayed by

            the kill -l command.

       -k

            Sends the SIGKILL signal to each local process. Only the root user can kill a process of another user. Note: fuser -k or -K

            might not be able to detect and kill new processes that are created immediately after the program starts to run.

       -u

            Provides the login name for local processes in parentheses after the process number.

       -V

            Provides verbose output.

       -x

            Used in conjunction with -c or -f, reports on executable and loadable objects in addition to the standard fuser output.


Security


       Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged

       operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of


       privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

 

옵션 그대로 -dV를 주고 문제가 되는 /oracle 경로를 확인한다


fuser -dV /oracle로

[asisdb03:/oracle]$fuser -dV /oracle

/oracle: 

inode=57710  size=0            fd=9      3145970

inode=57710  size=0            fd=9      4587700

inode=486328 size=4809         fd=2      5439506

inode=486330 size=6026         fd=2      6095048

inode=486326 size=1743935393   fd=2      6291546

inode=57710  size=0            fd=9      6553760

inode=60621  size=0            fd=7      6881502

inode=57710  size=0            fd=9      6946978

inode=57710  size=0            fd=9      7012552

inode=60621  size=0            fd=7      7078036

inode=486327 size=4813         fd=2      7143540

inode=486334 size=4366         fd=2      7274640

inode=486333 size=2310         fd=2      7405724

6291546 프로세스가 문제라는 것을 확인하였으며


pid 6291546 인


[asisdb03:/oracle]$ps -ef |grep 6291546

  oracle  6291546        1   1   Dec 18      - 1164:06 ora_lmd0_ASIS1

  oracle 30277808 15729112   0 15:56:10  pts/3  0:00 grep 6291546


grep을 하니 lmd0 프로세스가 물고 있네요!


흠.. 그럼 바로 kill -9 6291546 하면 ???????

기대 했던대로 디비가 내려간다 ㅎㅎ

오라클 background process는 막죽이면 안된다 


결론은 lmd0에서 trace파일에다 기록을 하는데 그 trace파일의 용량이 반환안되면서

현재 17기가 까지 마구 쓰고 있다


trc 파일은 이미 지워졌는데..

trc 파일은 이미 지워졌는데..

trc 파일은 이미 지워졌는데..

trc 파일은 이미 지워졌는데..

trc 파일은 이미 지워졌는데..


oradebug님을 소환 해당 프로세스에서 만들어내는 trc 파일을 그만 기록 하도록 조치하도록 하자


[asisdb03:/oracle]$sqlplus


SQL*Plus: Release 10.2.0.4.0 - Production on Fri Feb 27 16:32:07 2015


Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Enter user-name: /as sysdba


Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options


SQL> oradebug setospid 6291546

Oracle pid: 6, Unix process pid: 6291546, image: oracle@asisdb03 (LMD0)

SQL> oradebug tracefile_name

/oracle/admin/ASIS/bdump/asis1_lmd0_6095048.trc

SQL> !ls /oracle/admin/ASIS/bdump/asis1_lmd0_6095048.trc

/oracle/admin/ASIS/bdump/asis1_lmd0_6095048.trc not found

SQL> oradebug close_trace

Statement processed.

SQL>  

ls로 tracefile_name 을 조회해도 그런 파일 없다!

파일이 없다고!

파일이 없는데 용량이 계속 커진다고!

나좀 살려달라고! 라고 생각하고 

해당 trace file을 oradebug close_trace로 사뿐히 닫아주도록 하자


그럼 끝.......


아참 lmd0이 만드는 trace파일이 계속 커지는 이유는

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x7a30ad6a][0x7809d7d1],[ET].110131433 0x7000004e4530c98 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0xf611ca38][0xd944874b],[LB].71842971 0x7000004e45437d8 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x896a767e][0x4f1adb8d],[LB].69430739 0x7000004e451e158 [held 3][req 3]

kjxocdr: drop duplicate open [0x8ae88d8b][0xf374e5ea],[LE].70539788 0x7000004cabaf930 [held 3][req 3]

kjxocdr: drop duplicate open [0x8ae88d8b][0xf374e5ea],[LE].70539788 0x7000004cabaf930 [held 3][req 3]

kjxocdr: drop duplicate open [0x8ae88d8b][0xf374e5ea],[LE].70539788 0x7000004cabaf930 [held 3][req 3]

kjxocdr: drop duplicate open [0x8ae88d8b][0xf374e5ea],[LE].70539788 0x7000004cabaf930 [held 3][req 3] 

때문에 그렇다 ^^

버그니 패치를 하거나 무시하도록 하자







"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."