Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Archive Logs Growing to Fast

RE: Archive Logs Growing to Fast

From: Anne Yu <AYu_at_sos.state.tx.us>
Date: Wed, 22 Nov 2000 11:15:16 -0600
Message-Id: <10688.122739@fatcity.com>


Saroj,

I archived my logs to the tape before remove them; Here is the script = for
you:

#!/bin/ksh

TMP=3D"/tmp"
ARCHOME1=3D"/u01/redoback/sid"
ARCHOME2=3D"/u02/redoback/sid"
ARCHOME3=3D"/u03/redoback/sid"

cd $ARCHOME1
if [ -r /tmp/ARCHIVELOCK ]=20
then

   exit
else

   touch /tmp/ARCHIVELOCK
   df -k . | tail -1 > ${TMP}/check.tmp
   sizeof=3D`awk '{print substr($5,1, 2)}' ${PROGTMP}/check.tmp`    if [[ "$sizeof" > "5" ]]; then
    NUM=3D$((`ls -l *.arc | wc -l` - 1))     ls *.arc | head -$NUM > /tmp/$$.lst
    save -b DLT SERVER_NAME `cat /tmp/$$.lst`     cd $ARCHOME2
    df -k . | tail -1 > ${TMP}/dest.tmp =20     destsize=3D`awk '{print substr($5,1, 2)}' ${TMP}/dest.tmp`     cd $ARCHOME1
    if [[ "$destsize" > "70" ]]; then

      print "Filesystem /xxx/xxx is full, Moving files..."=20
      for FILE in `cat /tmp/$$.lst`
      do
        mv $FILE ${ARCHOME3}/.
      done
      cd $ARCBK2
      compress *.arc
    else
      print "Moving files to /xxx/xxx..."
      for FILE in `cat /tmp/$$.lst`
      do
        mv $FILE ${ARCHOME2}/.
      done
      cd $ARCHOME2
      compress *.arc

    fi
    rm /tmp/$$.lst
   fi
   rm /tmp/ARCHIVELOCK
fi
exit
}

Happy holiday to you'll,

Anne

-----Original Message-----

From: Dash, Saroj (CAP,CEF) [mailto:Saroj.Dash_at_gecapital.com] Sent: Tuesday, November 21, 2000 10:45 PM To: Multiple recipients of list ORACLE-L Subject: ?: Archive Logs Growing to Fast

How to remove the old archive file in NT.In unix it is ok.

Any body has idea how to delete old 2day or 3 days archive files in NT = .

-----OE=B3'=CCf=81fbfZ=81[fW-----

=8D=B7=8Fo=90l: Suhen Pather [mailto:Suhen.Pather_at_strandbags.com.au] '-=90M"=FAZz: Wednesday, November 22, 2000 PM 12:45 ^=B6=90=E6: Multiple recipients of list ORACLE-L OE=8F-=BC: RE: Archive Logs Growing to Fast

Hi Larry

Are you doing physical backups on your database??? If not then the archives may be of no use. You can switch off archiving.

If you are doing hot/cold backups and need the archives then you need to backup the logs before deleting them. The reason for so many archives is either the system=20 is very busy (lots of write activity) or the online redo=20 logs are too small. Try to resize the redo logs larger.

Write a cron job to remove the old archives (older than 3 days). I do not have a script with me though.
I have written a script like this and it is quite simple to write. Do a man on find and there are examples of how to write the ksh script to remove the old files.

HTH Best Regards

Suhen Pather
Oracle DBA
Strandbags (Australia)
02 9479 7791
email suhen.pather_at_strandbags.com.au

-----Original Message-----

Sent: Wednesday, 22 November 2000 12:18
To: Multiple recipients of list ORACLE-L

Hi All,

I need a script that will delete (rm) a file(s) if the file(s) is 3 = days
old.
My archive logs are filling up my disk at a rapid pace.

Does anyone have any suggestions?

This is what the files look like:

-rw-r----- 1 oracle dba 209715712 Nov 19 19:27 0000097621.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 19:38 0000097622.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 19:48 0000097623.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 19:59 0000097624.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 20:10 0000097625.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 20:20 0000097626.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 20:31 0000097627.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 20:42 0000097628.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 20:53 0000097629.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 21:04 0000097630.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 21:15 0000097631.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 21:26 0000097632.arc
-rw-r----- 1 oracle dba 209715712 Nov 19 21:38 0000097633.arc

Thanks in advance

larry
--=20

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--=20

Author: Larry Taylor
  INET: ltaylor_at_iq.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--=20

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--=20

Author: Suhen Pather
  INET: Suhen.Pather_at_strandbags.com.au
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--=20

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--=20

Author: Dash, Saroj (CAP,CEF)
  INET: Saroj.Dash_at_gecapital.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L Received on Wed Nov 22 2000 - 11:15:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US