ASPState database is Full

You cannot get to the ESM Website. The website tells you there is a redirect loop and an app_error. Also, in the event viewer, under Windows Logs > Application Logs, you see a message similar to this: 

Unable to connect to SQL Server session database. The connection string (server='(local),1433', database='ASPState') was returned by an instance of the IPartitionResolver type 'ipConfigure.Web.PartitionResolver, ipConfigure.Web'.


This means that the ASPState database is full and you cannot store anymore sessions.

1. Log into the Management Server.
2. Open Command prompt as administrator and type the following:  'iisreset /stop'  (without quotes).
3. Start > All Programs > SQL Server 2008 R2 > SQL Management Studio
4. Enter a dot '.' into the Server Name field. Press Connect.
5. In the top left corner, click "New Query" This will spawn a box on the left pane that you are able to type in.
6. In that box, enter the following:

truncate table aspstate.dbo.ASPStateTempSessions

7. Now, click the red "! Execute" button at the top of the box. You should see "Query Executed Successfully." at the bottom with a green check.
8. Erase that previous command and enter the following:

truncate table aspstate.dbo.ASPStateTempApplications

9. Now, click the red "! Execute" button at the top of the box. You should see "Query Executed Successfully." at the bottom with a green check.
10. Go back into command prompt and type: 'iisreset /start' (without quotes).

You will now be able to get to the ESM website. To ensure your database does not get this way again, please perform the following for preventative maintenance.

1. Download the attached file "Delete ASPState Expired Sessions.xml." Save it on the management server.
2. Start > search for "Task Scheduler"
3. On the right hand action pane, choose "Import Task..."
4. Navigate to the .xml file and select it.
5. You may now exit Task Scheduler.

This task will run constantly each day and keep that ASPState database small.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


  • Avatar
    Benjamin Curtis

    Full instructions if the user gets an error:

    1. Start Windows Task Scheduler.

    2. Click "Create Task" on the right pane.

    3. Name it "ASPStateCleanup"

    4. Check boxes at the bottom for

    -"Run whether user is logged in or not"

    -"Run with Highest Privileges"

    1. Go to "Triggers" tab -- Click "New.."

    -Begin the task - "On a Schedule"

    -Settings = "Daily", "Recur every '1' Day".

    -Advanced Settings "Repeat Task every 5 minutes for a duration of 1 day"

    1. Go to "Actions" tab -- Click "New.."

    -Action = Start a Program

    -Programs/Script box: C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE

    -Arguments: -S localhost -U webcam -P r34d0nly -d ASPState -Q "exec DeleteExpiredSessions"

    -Click OK.

    1. Go to "Settings" tab. Check the box for

    -"Run task as soon as possible after a scheduled start is missed"

    -"Allow task to be run on demand"

    -"Stop task if it runs longer than 1 Hour"

    -"If the running task does not end when requested, force it to stop

    -"Dropdown box - Stop the existing instance"