" /> Purge scripts for statserver tables - Genesys CTI User Forum

Author Topic: Purge scripts for statserver tables  (Read 4225 times)

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

RN

  • Guest
Purge scripts for statserver tables
« on: July 11, 2008, 03:11:54 PM »
Advertisement
Can some help me with the oracle purge scripts for the statservers tables  Login,QueueInfo,Voice Extension and status .Iam looking to purge the data which is older than 15days.

tnks....rn

RN

  • Guest
Re: Purge scripts for statserver tables
« Reply #1 on: August 10, 2008, 07:03:12 PM »
Can any please help me out on this ???

cheers...rn

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Purge scripts for statserver tables
« Reply #2 on: August 10, 2008, 07:26:07 PM »
Hi,

What version of Oracle database you have?

R.

RN

  • Guest
Re: Purge scripts for statserver tables
« Reply #3 on: August 11, 2008, 05:33:35 AM »
The oracle version is 10G release 2.

thanks,

Marked as best answer by on Today at 10:27:59 AM

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Purge scripts for statserver tables
« Reply #4 on: August 13, 2008, 07:17:54 AM »
  • Undo Best Answer
  • Hi RN,

    Here are the SQL scripts for purging StatServer's tables. You can delete records older then specified date using these scripts. Just replace the date '2008-07-01' (July 1st 2008) in the commands below with different date.

    Please test these scripts carefully before using them on production system!

    R.

    --- purge table "LOGIN" by date
    DELETE LOGIN
    WHERE TIME < ((TO_DATE('2008-07-01','YYYY-MM-DD')-TO_DATE('1970-01-01 00:01:00','YYYY-MM-DD HH24:MI:SS'))*3600*24);

    --- purge table "QINFO" by date
    DELETE QINFO
    WHERE StartTime < ((TO_DATE('2008-07-01','YYYY-MM-DD')-TO_DATE('1970-01-01 00:01:00','YYYY-MM-DD HH24:MI:SS'))*3600*24);

    --- purge table "STATUS" by date
    DELETE STATUS
    WHERE StartTime < ((TO_DATE('2008-07-01','YYYY-MM-DD')-TO_DATE('1970-01-01 00:01:00','YYYY-MM-DD HH24:MI:SS'))*3600*24);

    --- purge table "VOICE_REASONS" by date
    DELETE VOICE_REASONS
    WHERE START_TIME < ((TO_DATE('2008-07-01','YYYY-MM-DD')-TO_DATE('1970-01-01 00:01:00','YYYY-MM-DD HH24:MI:SS'))*3600*24);