Advertisement
Guest User

SQL Server Data Collector performance_counter_instances fix

a guest
Aug 27th, 2013
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.05 KB | None | 0 0
  1. ALTER DATABASE DataCollectorWarehouse SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  2. GO
  3. DROP INDEX [IDX_performance_counter_instances1] ON [snapshots].[performance_counter_instances]
  4. ALTER TABLE [snapshots].[performance_counter_instances] DROP CONSTRAINT [UN_performance_counter_path]
  5. ALTER TABLE [snapshots].[performance_counter_instances] DROP CONSTRAINT [PK_performance_counter_instances]
  6. GO
  7. ALTER TABLE [snapshots].[performance_counter_instances] ALTER COLUMN [performance_counter_id] [bigint] NOT NULL
  8. GO
  9. ALTER TABLE [snapshots].[performance_counter_instances] ADD CONSTRAINT [PK_performance_counter_instances] PRIMARY KEY CLUSTERED  ([performance_counter_id]) ON [PRIMARY]
  10. ALTER TABLE [snapshots].[performance_counter_instances] ADD CONSTRAINT [UN_performance_counter_path] UNIQUE NONCLUSTERED  ([path]) WITH (IGNORE_DUP_KEY=ON) ON [PRIMARY]
  11. CREATE NONCLUSTERED INDEX [IDX_performance_counter_instances1] ON [snapshots].[performance_counter_instances] ([object_name], [counter_name]) ON [PRIMARY]
  12. GO
  13. ALTER DATABASE DataCollectorWarehouse SET MULTI_USER
  14. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement