Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: RN on July 11, 2008, 03:11:54 PM

Title: Purge scripts for statserver tables
Post by: RN on July 11, 2008, 03:11:54 PM
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
Title: Re: Purge scripts for statserver tables
Post by: RN on August 10, 2008, 07:03:12 PM
Can any please help me out on this ???

cheers...rn
Title: Re: Purge scripts for statserver tables
Post by: René on August 10, 2008, 07:26:07 PM
Hi,

What version of Oracle database you have?

R.
Title: Re: Purge scripts for statserver tables
Post by: RN on August 11, 2008, 05:33:35 AM
The oracle version is 10G release 2.

thanks,
Title: Re: Purge scripts for statserver tables
Post by: René on August 13, 2008, 07:17:54 AM
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);