Deleted VDA's from Studio But Still Showing In Citrix Director
book
Article ID: CTX330795
calendar_today
Updated On:
Description
- Customer deleted few VDA's from Studio but they still reflect in Citrix Director.
- Customer found references of deleted VDA's in MonitorData.Machine table and encountered the below error:
The DELETE statement conflicted with the REFERENCE constraint "Session_Machine". The conflict occurred in database "MonitoringDBName", table "MonitorData.Session", column 'MachineId'.
The statement has been terminated.
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Resolution
Always take database backup before making any changes as editing the database manually can leave it unstable.
- Look for the entries for the deleted machine in MonitorData.Machine table in monitoring database using following query and make a note of the ID of the Deleted machine
SELECT * FROM [<MonitoringDBName>].[MonitorData].[Machine] WHERE Name Like '%Name of Machine%'
- Make a note of the MachineID of the Deleted machine and remove the reference of the machine from MonitorData.Session Table first using the below SQL Statement:
Delete FROM [MonitorDB].[MonitorData].[Session] WHERE MachineId = ‘DeletedMachineId'
- Then use the below SQL statement to remove the reference of the Deleted VDA's using the MonitorData.Machine table using the MachineID copied earlier from Monitordata.Session table.
DELETE FROM [MonitorDB].[MonitorData].[Machine] WHERE ID = ‘DeletedMachineID’
Problem Cause
There was a reference for the deleted VDA in MonitorData.Session table as well and hence the customer was getting the above error while deleting the machine from MonitorData.Machine table.
Was this article helpful?
thumb_up
Yes
thumb_down
No