---
title: "Database Setup"
slug: "database-setup"
updated: 2024-08-09T13:17:16Z
published: 2024-08-09T13:17:16Z
canonical: "help.symphonysummitai.com/database-setup"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.symphonysummitai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Setup

## Database Setup

Setting up the Database involves steps to ensure that the database is properly configured, secured and ready to support the application's data storage and retrieval needs. The Database setup consists of the following steps.

1. Login to the database server.

2. Create a DB backup from the blob for which the QA has given the signoff.

### Restore Database

3. Go to Microsoft SQL Server Management Studio (SSMS), right click on **Database** and click **Restore Database**.

![](https://cdn.document360.io/62351b42-cfbd-43ad-8ce1-82b8f455337f/Images/Documentation/image-1721718829687.png)

Figure: SSMS

4. Select the path of the backup file under **Device**. Provide the Database name as per the instance name. Click **OK** and the Database is created.

![](https://cdn.document360.io/62351b42-cfbd-43ad-8ce1-82b8f455337f/Images/Documentation/image-1721719053231.png)

Figure: Restore Database

5. When restored, we get the following message. Refresh the Database to see if the database has been restored.

![](https://cdn.document360.io/62351b42-cfbd-43ad-8ce1-82b8f455337f/Images/Documentation/image-1721719227560.png)

Figure: Message

### **Create User and map to Database**

6. Create a user (new login for the newly created instance). Right click on **Security** > **Logins**.

7. Under the General page, provide a valid **Login name,** select **SQL Server authentication,** and provide a **Password**.

8. Under **Server Roles** page, enable the checkbox for **public**.

9. Under **User Mapping**, select the database under **Users mapped to this login** and select db_owner under **Database role membership**. Click **OK**.

### Update URL and Vault

10. URL Change scripts is available in Blob. Perform URL changes by executing this script when setting up a new instance.

11. Update Vault details and DB connection string details by executing the script provided in the Plt_app_setting.

NoteVault name is created while setting up the application (angular and core). It has to be the same while updating vault details like Vault Name, Token, and Vault Endpoint URL and DB Connection string. 

To know more about URL change script, refer to [URL Change Script](https://help.symphonysummitai.com/summit-platform/docs/url-change-script).

To know more about Dynamic Query to Update Vault, refer to [Dynamic Query to Update Vault](https://help.symphonysummitai.com/summit-platform/docs/dynamic-query-to-update-vault).

NoteThe server IP depends on the host IP where the server is running. It may from customer to customer. 

### Generate a Password and assign to User

12. Run the query "select * from plt_users where email_id like'%Fred$'.

13, Select the run and run the query 'update plt_users set password = 'xx' where id = 143;"

### Create Maintenance Jobs

14. Create the job on the preinstalled System Stored Procedures on Create Missing Index, Maintenance, and Update Statistics

NoteEnsure that the database name (SQL login name) and login name are entered correctly.

15. Right-click on System Stored procedure **Maintenance** > **Properties** > **Steps** > Delete A**G_Check.**

**To know more about USP DB Maintenance, Update Statistics and Missing Index, refer to [USP DB Maintenance, Update Statistics and Missing Index](https://help.symphonysummitai.com/summit-platform/docs/usp-db-missing-index-maintenance-update-statistics).**

### **Create a Missing Job Index**

16. To create the Missing Index job, right-click **Jobs** > **New Job.**

17. Enter the **Name** for the Missing Index.

18. In the Steps page, provide a **Step Name**. Select the **Database** on which it needs to run and type 'EXEC dbo.USP_CREATEMISSINGINDEX GO' in the **Command.** Click **OK.**

19. Go to **Schedule** > **New**. Provide the **Name** and set up **Frequency** and **Daily Frequency** timings. Click **OK**.

### Run the Jobs

To run the newly created Maintenance and Missing Job Index, perform the following steps.

20. Right-click the **Jobs** > **Start** **Job at Step**.

NoteEnsure SQL Server Agent is running in the services.
