1. 程式人生 > 其它 >sql-server的日常操作

sql-server的日常操作

1、登入sqlserver資料庫

[itcloud].[dbo].[res_vm]虛擬機器相關的庫表

select * from [itcloud].[dbo].[res_vm] where serverid = 'c842b893-5fdf-411f-815b-7b8cda55d9ad' #查詢虛擬機器狀態
update [itcloud].[dbo].[res_vm] set status = 'running' where serverid = 'c842b893-5fdf-411f-815b-7b8cda55d9ad' #更新虛擬機器的狀態
update [itcloud].[dbo].[res_vm] set IsEnabled = 0,status = 'terminated' where serverid = '633c54a8-ed18-417a-acca-8a1c1cc8be3c'

#刪除虛擬機器

[itcloud].[dbo].[Res_Port]網絡卡相關的庫表

select * from [itcloud].[dbo].[Res_Port] where PortId = '135c232d-f1c4-4505-b5ff-812c678464dc' #查詢網絡卡狀態
update [itcloud].[dbo].[Res_Port] set VMId = where PortId = '135c232d-f1c4-4505-b5ff-812c678464dc'
update [itcloud].[dbo].[Res_Port] set status = 'running' where PortId = '665638ee-bc63-4684-905c-cd6a86454993'
update [itcloud].[dbo].[Res_Port]set IsEnabled = 0,status = 'deleted' where PortId = '776f8b40-8f91-4228-99d1-73c403943e3a'

#刪除虛擬網絡卡

[itcloud].[dbo].[res_CS] #塊儲存庫