Re: [RadiusNT] pk_calls and ODBC errors.

Brian Dooley ( support@cserv.net )
Tue, 17 Oct 2000 15:12:25 -0400

Eric wrote:

> hello all,
> I know this topic has been talked of many times before, but I have tried
> everything I could think of and still cannot fix the problem. We are
> getting too many entries in our logfile with the following error:
> >Tue Oct 17 12:19:03 2000: ODBC Error:23000:2627:
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY
> > constraint 'PK_Calls'. Cannot insert duplicate key in object 'Calls'.
>
> In a matter of 20 minutes there are over 70 of these errors in the logfile.
> We are running RadiusNT 2.5.267 on NT.0 as a service. The box is an HP LH2
> 266mhz with 128mb ram. We are running SQL 7.0 on the same box.
> We have 16 terminal servers (almost all are PM3's).
>
> Here is what I have tried, what I remember anyways ;o) ...
> -Cleared out the calls table completely.
> -checked to make sure the following order of pk_calls index:
> AcctSessionID
> NasIdentifier
> NasPort
> UserName
> AcctStatusType
> -Also tried several combinations of the above mentioned index properties
> (i.e. removed AcctStatusType or NasPort, etc.)
> -I checked to make sure all terminal servers have the secret set and is set
> same in Emerald/RadiusNT
> -Check and bumped up memory for SQL.
> -Checked "Manual calls update" in RadAdmin.
> -Ran CheckDB on Emerald.
> -probably a couple other things I can't remember at the moment.
>
> Attached is a 20 minute cut of our logfile, and a copy of radius -x15 debug
> output.
>
> Does anyone have any more ideas or suggestions?
> I need to get this fixed, it's causing too many problems.
>
> Thanks,
> Eric Jensen
>
> ------------------------------------------------------------------------
> Name: radprob101700.ZIP
> radprob101700.ZIP Type: Mplayer2 File (application/zip)
> Encoding: base64

I get this problem after I restart my USR TC Hub.
I have come up with a solution but it requires deleting previous call records.
Originally I Trimmed all the old records, only to find it wiped out any prepay
information in my Emerald customer files.
The following fix is what I finally came up with.

THIS WILL DELETE OLD CALL RECORDS. Your billing data will be incorrect if you
use anything associated with the amount of time online. I am not responsible
for loss of data or loss of revenue. Use at your own risk!

In Microsoft SQL Server in your Emerald database create a new stored procedure.

CREATE PROC DeleteStopRecords AS
Delete From Calls Where AcctStatusType <> 1

Then go into Management/SQL Server Agent and create a new job to invoke the
stored procedure.
Do not schedule this.
Simply run the job.
It will delete every existing Stop record in your calls table.
Thus eliminating the duplicate entry error.

----------------------------------------------------------Brian DooleyClassic Servicehttp://www.classicservice.net

`````````````````````````````````````````````````````````` - Man cannot survive except by gaining knowledge, and reason is his only means to gain it.-

Ayn Rand

For more information about this list (including removal) go to:http://www.iea-software.com/support/maillists/liststart