Clear the database log

ORACLE_Guide_Clear the database log

1. Clean the ASM log

oracle11g:

oracle@host1:~> cd $ORACLE_BASE/diag/asm/+asm/<ASM_SID>/alert

oracle@host1:~> find ./ -name "log_*.xml"|xargs rm  -rf

oracle@host1:~> cp $ORACLE_BASE/diag/asm/+asm/<ASM_SID>/trace/alert_<ASM_SID>.log  /tmp/alert_<ASM_SID>.log.bak    <====== Must finish the backup

oracle@host1:~> echo ‘’ > $ORACLE_BASE/diag/asm/+asm/<ASM_SID>/trace/alert_<ASM_SID>.log

2. Clean the clients log

oracle11g:

oracle@host1:~> cd $ORACLE_BASE/diag/clients/<USER_NAME>/<HOST_NAME>/alert

oracle@host1:~> find ./ -name "log_*.xml"|xargs rm  -rf

oracle@host1:~> cp $ORACLE_BASE/diag/clients/<USER_NAME>/<HOST_NAME>/sqlnet.log  /tmp/sqlnet.log.bak    <====== Must finish the backup

oracle@host1:~> echo ‘’ > $ORACLE_BASE/diag/clients/<USER_NAME>/<HOST_NAME>/sqlnet.log

3. Clean the rdbms log

oracle11g:

oracle@host1:~> cd  $ORACLE_BASE/diag/rdbms/<DB_NAME>/<ORACLE_SID>/alert

oracle@host1:~> find ./ -name "log_*.xml"|xargs rm  -rf

oracle@host1:~> cp $ORACLE_BASE/diag/rdbms/<DB_NAME>/<ORACLE_SID>/trace/alert_<ORACLE_SID>.log  /tmp/alert_<ORACLE_SID>.log.bak    <====== Must finish the backup

oracle@host1:~> echo ‘’ > $ORACLE_BASE/diag/rdbms/<DB_NAME>/<ORACLE_SID>/trace/alert_<ORACLE_SID>.log

4. Clean the listener log

oracle11g:

oracle@host1:~> cd $ORACLE_BASE/diag/tnslsnr/<HOSTNAME>/<LISTENER_NAME>/alert

oracle@host1:~> find ./ -name "log_*.xml"|xargs rm  -rf

oracle@host1:~> cp $ORACLE_BASE/diag/tnslsnr/<HOSTNAME>/<LISTENER_NAME>/trace/listener.log  /tmp/listener.log.bak     <====== Must finish the backup

oracle@host1:~> echo ‘’ >  $ORACLE_BASE/diag/tnslsnr/<HOSTNAME>/<LISTENER_NAME>/trace/listener.log

 

5. Removethe audit log file

oracle11g:

oracle@host1:~>cd  $ORACLE_BASE/admin/<SID_NAME>/adump

oracle@host1:~>find ./  -name "*.aud"|xargs rm -rf

 

 

 

你可能感兴趣的:(Clear the database log)