How to Create Clarity Database for Microsoft SQL Server?

Document ID : KB000050562
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Script File that automates database creation for Clarity in a Microsoft SQL Server Environment.

Solution:

Please follow these steps to automatically create a SQL database for use with Clarity.

(Please note you will need 'sa' permissions on the SQL server to perform these steps.)

(Please note this script file is intended for use in a QA or Development environment and is not suitable for production use as it may violate your corporate security standards.)

  1. Please paste the following query into the SQL Server Management Studio query window.

    USE [master]
    CREATE DATABASE [clarity]
    EXEC dbo.sp_dbcmptlevel @dbname=N'clarity', @new_cmptlevel=90
    GO
    IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
    begin
    EXEC [clarity].[dbo].[sp_fulltext_database] @action = 'disable'
    end
    GO
    ALTER DATABASE [clarity] SET ANSI_NULL_DEFAULT OFF
    GO
    ALTER DATABASE [clarity] SET ANSI_NULLS ON
    GO
    ALTER DATABASE [clarity] SET ANSI_PADDING OFF
    GO
    ALTER DATABASE [clarity] SET ANSI_WARNINGS OFF
    GO
    ALTER DATABASE [clarity] SET ARITHABORT ON
    GO
    ALTER DATABASE [clarity] SET AUTO_CLOSE OFF
    GO
    ALTER DATABASE [clarity] SET AUTO_CREATE_STATISTICS ON
    GO
    ALTER DATABASE [clarity] SET QUOTED_IDENTIFIER ON
    GO
    ALTER DATABASE [clarity] SET AUTO_SHRINK OFF
    GO
    ALTER DATABASE [clarity] SET AUTO_UPDATE_STATISTICS ON
    GO
    ALTER DATABASE [clarity] SET CURSOR_CLOSE_ON_COMMIT OFF
    GO
    ALTER DATABASE [clarity] SET CURSOR_DEFAULT GLOBAL
    GO
    ALTER DATABASE [clarity] SET CONCAT_NULL_YIELDS_NULL OFF
    GO
    ALTER DATABASE [clarity] SET NUMERIC_ROUNDABORT OFF
    GO
    ALTER DATABASE [clarity] SET QUOTED_IDENTIFIER OFF
    GO
    ALTER DATABASE [clarity] SET RECURSIVE_TRIGGERS OFF
    GO
    ALTER DATABASE [clarity] SET ENABLE_BROKER
    GO
    ALTER DATABASE [clarity] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
    GO
    ALTER DATABASE [clarity] SET DATE_CORRELATION_OPTIMIZATION OFF
    GO
    ALTER DATABASE [clarity] SET TRUSTWORTHY OFF
    GO
    ALTER DATABASE [clarity] SET ALLOW_SNAPSHOT_ISOLATION ON
    GO
    ALTER DATABASE [clarity] SET PARAMETERIZATION SIMPLE
    GO
    ALTER DATABASE [clarity] SET READ_WRITE
    GO
    ALTER DATABASE [clarity] SET RECOVERY FULL
    GO
    ALTER DATABASE [clarity] SET MULTI_USER
    GO
    ALTER DATABASE [clarity] SET PAGE_VERIFY CHECKSUM
    GO
    ALTER DATABASE [clarity] SET DB_CHAINING OFF
    ALTER DATABASE clarity SET PAGE_VERIFY TORN_PAGE_DETECTION
    GO

  2. Once this script file has completed, please right click on databases and choose 'refresh'

  3. Please paste the following query into the SQL Server Management Studio query window.

    Use clarity

    CREATE LOGIN niku WITH PASSWORD = 'niku'

    ALTER LOGIN [niku] WITH CHECK_POLICY = OFF;
    ALTER LOGIN [niku] WITH CHECK_POLICY = OFF;
    GO

    Use clarity
    CREATE USER niku FOR LOGIN niku
    GO

    CREATE SCHEMA niku AUTHORIZATION niku ;
    GO

    USE clarity
    ALTER USER niku WITH DEFAULT_SCHEMA = niku;
    GO

    Use clarity

    EXEC sp_addrolemember db_owner, niku;
    GO

    Use Master
    GRANT VIEW SERVER STATE TO niku

  4. Once this script file is completed you can proceed with the database installation in the NSA module.