I execute this Turbo Query from host/Sql and I got an error:
FOR THIS FILE: TurboDNN733.sql
System.Data.SqlClient.SqlException (0x80131904): Could not allocate a new page for database 'shaghayegh2_com_' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
ClientConnectionId:b92d2bfe-bfe6-41e9-94bd-6e0a14e49007
CREATE CLUSTERED INDEX [IX_UserProfile_UserID] ON dbo.[UserProfile]
([UserID] ASC, [PropertyDefinitionID] ASC)
System.Data.SqlClient.SqlException (0x80131904): Could not allocate a new page for database 'shaghayegh2_com_' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
ClientConnectionId:d08c8a26-64e7-41dc-951b-38b42aaa3e2c
CREATE UNIQUE NONCLUSTERED INDEX [IX_UserProfile_PropertyDefinitionID] ON dbo.[UserProfile]
([PropertyDefinitionID] ASC, [UserID] ASC)
INCLUDE ([ProfileId], PropertyValue)
FOR THIS FILE: TurboDBConfig733.sql
System.Data.SqlClient.SqlException (0x80131904): User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
User does not have permission to alter database 'shaghayegh2_com_', the database does not exist, or the database is not in a state that allows access checks.
ALTER DATABASE statement failed.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
ClientConnectionId:8ad89323-7d66-46d9-8400-d90683897844
/* DNN TurboDBConfig Version 0.9.5 (2014-10-08)
================================================================================
(c) Sebastian Leupold, dnnWerk/gamma concept mbH 2014
Run this Script to configure your database for optimal performance with DNN 7.
== Please make sure to use latest version from http://dnnscript.codeplex.com ===
Instructions:
=============
- Install by running as script from SQL item in Host menu inside DNN or run in
SQL Server Management Studio.
- Make sure that the currently used account is member of dbOwner database role.
License and Disclaimer:
=======================
Published under Microsoft Open Source Reciprocal License (Ms-RL). For details,
please read http://dnnscript.codeplex.com/license.
Feel free to use this script as you need, but there is no warranty or liability
for any damage or effort, eventually been caused.
Please report issues at https://dnnscript.codeplex.com/WorkItem/Create
================================================================================
*/
DECLARE @dbVersion Int;
DECLARE @ServerVersion Int;
DECLARE @dbName nVarChar(100);
DECLARE @is_auto_create_stats_on Bit;
DECLARE @is_auto_update_stats_on Bit;
DECLARE @is_auto_update_stats_async_on Bit;
SELECT
@dbName = Name,
@dbVersion = compatibility_level,
@is_auto_update_stats_on = is_auto_update_stats_on,
@is_auto_create_stats_on = is_auto_create_stats_on,
@is_auto_update_stats_async_on = is_auto_update_stats_async_on
FROM sys.databases
WHERE name = db_name();
SET @ServerVersion = Convert(Int, left(Convert(nVarChar, SERVERPROPERTY('ProductVersion')), 2) * 10);
DECLARE @VersionStr nVarChar(4) = CAST(@ServerVersion AS VarChar(4));
IF @dbVersion < @ServerVersion Exec ('ALTER DATABASE [' + @dbName + '] SET COMPATIBILITY_LEVEL = ' + @VersionStr);
IF @is_auto_create_stats_on = 0 Exec ('ALTER DATABASE [' + @dbName + '] SET AUTO_CREATE_STATISTICS ON');
IF @is_auto_update_stats_on = 0 Exec ('ALTER DATABASE [' + @dbName + '] SET AUTO_UPDATE_STATISTICS ON');
IF @is_auto_update_stats_async_on = 0 Exec ('ALTER DATABASE [' + @dbName + '] SET AUTO_UPDATE_STATISTICS_ASYNC ON');
Exec ('ALTER DATABASE [' + @dbName + '] SET ANSI_Null_DEFAULT OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET ANSI_NullS OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET ANSI_PADDING OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET ANSI_WARNINGS OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET ARITHABORT OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET CONCAT_Null_YIELDS_Null OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET QUOTED_IDENTIFIER OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET NUMERIC_ROUNDABORT OFF');
Exec ('ALTER DATABASE [' + @dbName + '] SET RECURSIVE_TRIGGERS OFF');
FOR THIS FILE: TurboOptimizeDNNSettings733.sql
System.Data.SqlClient.SqlException (0x80131904): The transaction log for database 'shaghayegh2_com_' is full due to 'ACTIVE_TRANSACTION'.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
ClientConnectionId:1884d52f-682c-4bb8-a22b-76e7fed98e57
-- evaluate Size of EventLog table:
DECLARE @totalCount Int;
DECLARE @YearCount Int;
DECLARE @QuarterCount Int;
DECLARE @MonthCount Int;
DECLARE @MinID Int;
SELECT @MonthCount = Count(1) FROM dbo.[EventLog] WHERE LogCreateDate > DateAdd(Month, -1, GetDate());
SELECT @QuarterCount = Count(1) FROM dbo.[EventLog] WHERE LogCreateDate > DateAdd(Month, -3, GetDate());
SELECT @YearCount = Count(1) FROM dbo.[EventLog] WHERE LogCreateDate > DateAdd(Year, -1, GetDate());
SELECT @TotalCount = Count(1) FROM dbo.[EventLog];
IF @TotalCount > 1000 AND @TotalCount > @YearCount -- delete items older than a year
DELETE FROM dbo.[EventLog] WHERE LogCreateDate < DateAdd(Year, -1, GetDate());
SELECT @TotalCount = Count(1) FROM dbo.[EventLog];
IF @TotalCount > 3000 AND @TotalCount > @QuarterCount -- delete items older than a quarter
DELETE FROM dbo.[EventLog] WHERE LogCreateDate < DateAdd(Month, -3, GetDate());
SELECT @TotalCount = Count(1) FROM dbo.[EventLog];
IF @TotalCount > 5000 AND @TotalCount > @MonthCount -- delete items older than a month
DELETE FROM dbo.[EventLog] WHERE LogCreateDate < DateAdd(Month, -1, GetDate());
-- just keep last 5000 rows
SELECT @TotalCount = Count(1) FROM dbo.[EventLog];
IF @TotalCount > 5000 BEGIN
SELECT @MinID = Min(LogEventID) FROM (SELECT Top (5000) LogEventID FROM dbo.[EventLog] ORDER BY LogEventID DESC) S;
DELETE FROM dbo.[EventLog] WHERE LogEventID < @MinID;
END;
I could not execute them and I got these errors.... How can I do?