This tool is designed to execute update and delete queries in the client environment by connecting to the database through the database configuration file (database_params.conf).
Disclaimer:
- This tool has been tested only in the PostgreSQL environment.
- It is not recommended for executing sensitive queries in the production environment directly. For complex queries, testing should first be performed on a test setup.
- Please ensure to take a backup of the data before running this tool.
Prerequisites:
- Attached QueryExecutor.zip file.
- Edit access to the application folder and files on the application server.
- Administrator privileges for the Command Prompt.
Procedure:
Download and extract the QueryExecutor.zip file from the attachment and extract into the <Drive>:\ManageEngine\ServiceDeskPlus MSP directory. This will create a "QueryExecutor" folder at the specified location.
Start the MSP Application service.
Open the queryToExecute.txt file located in <MSP Home>\QueryExecutor and paste the query which needs to be executed.
Open the Command Prompt as an administrator and execute the run.bat or run.sh command from the same path to apply the changes specified in the query.
Check the queryExecutor.log file, in the <MSP Home>\QueryExecutor folder, for results and analysis.
Illustration:
Below is an illustration of using the QueryExecutor tool to delete a backup approver without manually connecting to the database:
Query: delete from backupapproverdetails where backup_config_id in (1);
queryToExecute.txt file:
Before execution: There are two backup approvers, as shown in the screenshot below.
After execution: The specified approver with user ID '1' has been deleted via the query.
QueryExecutor log:
Therefore, as mentioned, DB queries can now be executed directly from the application folder, without the need for direct database connections.