Database Dumps
Last modified by Nikhil Singh on 2026/07/03 08:25
Step 1: Execute the PowerShell Script
Prepare the Parameters:
- Set up the parameters needed for the script. These include:
- clientCode: The code for the client (e.g., 'KUL').
- envCode: The environment code (e.g., 'Live' or 'Staging').
- server: The server name, including the port number and instance.
- instance: The SQL instance name (e.g., 'default').
- database: The database to be backed up (e.g., 'KUL_Live_Everest').
- auth: Authentication type (e.g., "Active Directory Interactive").
The command to run the script will look like this:
powershell
.\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"
- Set up the parameters needed for the script. These include:
Run the Script:
- Once you have set up the correct parameters, execute the script by running the above command in PowerShell.
- The script should print "Hello World" to the console and open Microsoft Edge for verification.
Verification:
- 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.
- Verify Locations:
- Azure Storage Account: Check if the dumps (stored procs, tables, triggers, schemas, functions) have been sent to your Azure Storage Account.
- Temp Folder: Check if the dumps have been placed in the temporary folder on your PC.
- 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.
Step 2: Validate the Results
- Check in Azure Storage:
- 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.
- Check Local Temp Folder:
- Navigate to the temp folder on your PC (e.g., C:\Temp) and confirm that the necessary files are present.
- Check Database (devops_sqlhashes Table):
- Connect to the ebs_devops_live database in SQL Server Management Studio (SSMS) or using PowerShell.
- Query the devops_sqlhashes table:
SELECT * FROM devops_sqlhashes;
Step 3: Debugging (If Needed)
- 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.
- Error Messages: Review any error messages printed to the PowerShell console or Microsoft Edge window for debugging.