I am trying to connect to SQl server but getting this issue.
connect to Database Activity: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
in provider name passing as “System.Data.SqlClient” , in connection string passing as “Data Source=”+ in_Datasource+“;Initial Catalog=”+ in_Database+“;User ID=”+ dbUserName+“;Password=”+ dbPassword+“;Connect Timeout=30” using this syntax
i m running this is in dev VM once it is successfully i will use in PROD VM
Might be this error happens when the sql server or instance is not reachable from the vm, so check the data source format with correct server\instance or server,port, ensure sql server and sql browser services are running, remote connections are enabled, firewall allows the sql port, and the vm has network access, then retry the same connection string.
Let’s first see the setup of your database server. Is the DB server setup on the same server that you are trying to connect to (or) is it hosted on a different application server and your DB server is only allowed to be reached via that app server.
some orgs dont allow DB servers to be directly accessible, hence they use the above setup.
In that case you cannot connect to the DB server unless you whitelist your machine’s IP
We have an Orchestrator machine where the Jobs and Logs tables are getting full frequently. This Orchestrator is hosted on a different VM, and UiPath Studio is not installed on that machine. we usually do this manually currently but sometimes when the logs are the process is stopped so we are thinking to run this query automatically, so any other thought.
Therefore, I am trying to use the PROD VM (a different VM) to connect to the Orchestrator SQL database using SSMS and run the DELETE queries. However, while trying to connect to the database from the PROD VM, the Connect to Database activity is showing a connection error.
you can reach out to your IT networking team.
i don’t think we cannot do it on our own.
i would also check if there any cross environment restrictions.. like lets say the VMs from dev environment cannot access prod VM or applications that talk to prod servers etc.
We have an Orchestrator machine where the Jobs and Logs tables are getting full frequently. This Orchestrator is hosted on a different VM, and UiPath Studio is not installed on that machine. we usually do this manually currently but sometimes when the logs are the process is stopped so we are thinking to run this query automatically, so any other thought.
Therefore, I am trying to use the PROD VM (a different VM) to connect to the Orchestrator SQL database using SSMS and run the DELETE queries. However, while trying to connect to the database from the PROD VM, the Connect to Database activity is showing a connection error.
you have an on prem setup, where you are using your own DB for storing UiPath process logs.
so 1 different app server for orchestrator,
1 different DB server for logs storage.(these 2 servers will have ability to talk to each other since the logs are getting stored).
and you are trying to access DB server directly from 1 of the prod VMs.
now i think i got the issue, i think there is a firewall blocking direct conntions to your DB server, but if you log in to your app server where UiPath orchestrator is hosted, you wont see this issue because DB server and APP servers are whitelisted already.
so what you need to do is contact IT n/w team to whitelist the PROD server that you are using to talk to your DB server.
Thanks for understanding..
But in the same server were my Orchestrator is hosted and i have SQL server i m using this cmd ping SDEFDWA***\SQLEXPR*** but still it is showing error ,Ping request could not find host SDEFDWA***, Please check the name and try again.
do you have SSMS on your app server?
if yes, you can try to open DB connection directly from it..
Your DB server might be added as a remote sever to SSMS. check that.
No in the App server we dont have SSMS. and in Orchestrator DB server where we have SSMS we dont have UiPath studio to run the delete query.
So this is the issue.. So any other thought how to trigger a process automatically to check if any jobs are running in orch then once all jobs stops the delete process will start automatically, so we are using Get jobs from the orch and connecting to db to delet the jobs and logs automatically will set through trigger. If any other details you need plz let me know. Thankyou for your quick response
understood. i think we need to dig more on how your platform is setup. I’m quite sure accessing DB via robot would be restricted in most organizations, its the same case with your org. so you need some alternative here.
Is there a specific reason that you are deleting the logs?
for logs:
you know there are log retention policies that can be enforced to do this job easily for you.
for jobs:
you can use orchestrator api to get the existing jobs and stop them, based on your criteria.
see if the above works because, i wouldn’t recommend deleting the logs directly.
if you really want to delete logs, its better to do it from SSMS on DB server.
you can setup a Stored procedure on SSMS and trigger it on some condition.
not sure which orchestration version allows this to set the retention policy for logs but it should be there in this file UiPath.Orchestrator.dll.config file..
but the best way to manage logs as of now seems to be like i suggested to have a SSMS SQL agent to be triggered on some specific condition over night.
please see the discussion in this thread : Deleting Logs