Creating the ASPState session database and assigning roles

This section explains how to create the ASPState session database, add a custom database name, and create a dB_executor role.

Note: Users should perform EITHER step one (1) or step two (2) but not both.
  1. Create the ASPState database. Run this command inside an elevated PowerShell window, with a user that has the necessary rights to the database:
    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
    .\aspnet_regsql.exe -ssadd -sstype p -C "data source=host;Integrated Security=true"
    
  2. Add a custom database name. The command below can be used to create a custom named database. Run this command inside an elevated PowerShell window, with a user that has the necessary rights to the database:
    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319.
    \aspnet_regsql.exe -d ExpereASPState -ssadd -sstype c -C "data source=host;Integrated Security=true" 
    Install the DocViewer application and transform to use the custom named database by adding the bolded values to C:\Program Files\WKFS\DocViewerInterfaceHtml\Configuration\sessionState.config:
    <sessionState sessionIDManagerType="WoltersKluwerFS.Osprey.DocViewerInterface.SessionIdManager, DocViewerInterfaceHtml" allowCustomSqlDatabase="true" mode="SQLServer" 
    sqlConnectionString="data source=hostname;Initial Catalog=ExpereASPState;Integrated Security=true;" cookieless="false" timeout="60"/>
    Note: Users can modify the transforms.xml file if they wish to maintain the dB name change between install and upgrade instances. Additionally, if using a custom database name, use DOCVIEWERINTERFACE_HTML_SQLSESSIONSTATEDB to update the settings file at time of installation. An example of a custom database value would be localhost;Initial Catalog=ExpereASPState.
  3. Create custom database role as the application pool identity user requires the db_datawriter, db_datareader, and db_executor roles. Reference the following URL to create a custom db_executor role and grant permission to the role: https://www.sqlmatters.com/Articles/Adding%20a%20db_executor%20role.aspx.
    CREATE ROLE db_executor
    GRANT EXECUTE TO db_executor
    


    Note: Alternatively, you may assign the db_owner to the identity.