Wiki source code of Database Dumps

Last modified by Nikhil Singh on 2026/07/03 08:25

Hide last authors
Nikhil Singh 2.1 1 === **Step 1: Execute the PowerShell Script** ===
Nikhil Singh 1.1 2
3 1. (((
4 **Prepare the Parameters**:
5
6 * Set up the parameters needed for the script. These include:
7 ** clientCode: The code for the client (e.g., 'KUL').
8 ** envCode: The environment code (e.g., 'Live' or 'Staging').
9 ** server: The server name, including the port number and instance.
10 ** instance: The SQL instance name (e.g., 'default').
11 ** database: The database to be backed up (e.g., 'KUL_Live_Everest').
12 ** auth: Authentication type (e.g., "Active Directory Interactive").
13
14 The command to run the script will look like this:
15
16 {{{
17 }}}
18
19 powershell
20
21 .\sql-script-db.ps1 -clientCode 'KUL' -envCode 'Live' -server 'sqlmi-ebs-prod.public.2a5fe6cde9a7.database.windows.net,3342' -instance 'default' -database 'KUL_Live_Everest' -auth "Active Directory Interactive"
22 )))
23 1. (((
24 **Run the Script**:
25
26 * Once you have set up the correct parameters, execute the script by running the above command in PowerShell.
27 * The script should print "Hello World" to the console and open Microsoft Edge for verification.
28 )))
29 1. (((
30 **Verification**:
31
32 * **Microsoft Edge**: Once the script runs, a window will pop up in Microsoft Edge for verification purposes. Ensure that this window pops up and confirms the success.
33 * **Verify Locations**:
34 ** **Azure Storage Account**: Check if the dumps (stored procs, tables, triggers, schemas, functions) have been sent to your Azure Storage Account.
35 ** **Temp Folder**: Check if the dumps have been placed in the temporary folder on your PC.
36 ** **devops_sqlhashes Table**: Log in to your ebs_devops_live database and query the devops_sqlhashes table to verify if the data was inserted correctly.
37 )))
38
39 ----
40
Nikhil Singh 2.1 41 === **Step 2: Validate the Results** ===
Nikhil Singh 1.1 42
43 1. **Check in Azure Storage**:
44 1*. Go to your Azure Storage Account (use Azure portal or Azure Storage Explorer) and check if the necessary files (stored procedures, tables, functions, triggers, etc.) have been uploaded to the designated container.
45 1. **Check Local Temp Folder**:
46 1*. Navigate to the temp folder on your PC (e.g., C:\Temp) and confirm that the necessary files are present.
47 1. **Check Database (devops_sqlhashes Table)**:
48 1*. Connect to the ebs_devops_live database in SQL Server Management Studio (SSMS) or using PowerShell.
49 1*. Query the devops_sqlhashes table:
50
51 {{{
Nikhil Singh 2.1 52 }}}
53
54 (((
Nikhil Singh 1.1 55 SELECT * FROM devops_sqlhashes;
56 )))
57
58 ----
59
Nikhil Singh 2.1 60 === **Step 3: Debugging (If Needed)** ===
Nikhil Singh 1.1 61
62 * **Check Logs**: If the process didn't work as expected, look for any logs generated by the script or check the Azure logs for any issues during the file upload.
63 * **Error Messages**: Review any error messages printed to the PowerShell console or Microsoft Edge window for debugging.