ScrewTurn Wiki Maintenance

Modified on 2014/10/15 07:04 by Administrator — Categorized as: Uncategorized

There is not much you have to do once your wiki is up and running.

We suggest you to perform the following tasks:

Data Backup

We suggest you to regularly backup your data, for example each night or evening. This task is very easy yet extremely important.

File-System Data Storage

A backup simply consists of a xcopy of the entire web application folder.

SQL Server Data Storage

A backup consists in a xcopy of the entire web application folder plus a backup of your database.

Misc

Some random help tips and tricks.

Changing Database Collation in SQL Server

ScrewTurn Wiki requires the database to be set with a case-insensitive collation. You can use the following script to change it.

alter database [ScrewTurnWiki] set single_user with rollback immediate
alter database [ScrewTurnWiki] collate <your collation>
alter database [ScrewTurnWiki] set multi_user

Replace with a case-insensitive collation, for example Latin1_General_CI_AS.

Defragmenting Indexes in SQL Server

The indexes of a high-write-traffic database can become fragmented, affecting performance. Run this script to defragment indexes in SQL Server 2005/2008.

/* BACKUP YOUR DATABASE BEFORE EXECUTING THIS SCRIPT */
/* If you run Enterprise Edition, you can rebuild the index with 'online = on' option */
/* In all other versions, this script locks tables being processed, so execute it when the system is not in use */

/* Pages */
alter index all on [ScrewTurnWiki].[dbo].[Namespace] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Category] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Page] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[CategoryBinding] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[PageContent] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[PageKeyword] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Message] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[NavigationPath] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Snippet] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[ContentTemplate] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[IndexDocument] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[IndexWord] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[IndexWordMapping] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);

/* Users */
alter index all on [ScrewTurnWiki].[dbo].[User] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[UserGroup] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[UserGroupMembership] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[UserData] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);

/* Files */
alter index all on [ScrewTurnWiki].[dbo].[Directory] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[File] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Attachment] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);

/* Settings */
alter index all on [ScrewTurnWiki].[dbo].[Setting] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[Log] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[MetaDataItem] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[RecentChange] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[PluginAssembly] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[PluginStatus] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[OutgoingLink] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);
alter index all on [ScrewTurnWiki].[dbo].[AclEntry] rebuild with (sort_in_tempdb = on, statistics_norecompute = on);