Helpful SQL Scripts

Return to previous page

  • 4/7/2015
  • 1169 Views

Comments

1169 Views

Helpful SQL Scripts

Last updated 5 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Background

Note: Running database scripts that update data against your DotNetNuke database is not a recommended practice. DotNetNuke maintains binary compatibility at the API level but does not do so at the database level, so any script ran against the database can potentially fail (as the database has changed) or runs the risk of updating data in a fashion that is inconsistent with the DotNetNuke API e.g. perhaps a core API function when ran updates data in 2 places, but direct SQL only updates it in 1. This can mean that the database loses data integrity or in the worst case may end up creating invalid data that causes your site to crash/work incorrectly/fail during an upgrade.

Use the following scripts at your own risk!

Clean up unused items

TRUNCATE TABLE {databaseOwner}{objectQualifier}EventLog

GO

TRUNCATE TABLE {databaseOwner}{objectQualifier}ScheduleHistory
GO

TRUNCATE TABLE {databaseOwner}{objectQualifier}SiteLog
GO

TRUNCATE TABLE {databaseOwner}{objectQualifier}SearchItemWordPosition
GO

DELETE FROM {databaseOwner}{objectQualifier}SearchItemWord
GO

DELETE FROM {databaseOwner}{objectQualifier}SearchWord
GO

DELETE FROM {databaseOwner}{objectQualifier}SearchItem
GO

Note: Other Performance best practices can be read on this wiki.


Find and fix scripts

The following are some scripts that can be used to fix invalid data (created under certain conditions). As these directly update data, please back your database up first.


Other script ideas

Contents
No sections defined
Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out