13.07.2015 Views

CA ERwin Model Manager Implementation Guide

CA ERwin Model Manager Implementation Guide

CA ERwin Model Manager Implementation Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reindex the DatabaseExample: Microsoft SQL Server DBMS Reindex ScriptAn example of the MS SQL Server dbms reindex script:-- Drop the Procedure appropriatelyIF EXISTS (SELECT name FROM sysobjects WHERE name = N'usp_ReIndex' AND type = N'P')BeginDROP PROCEDURE usp_ReIndexPrint 'Procedure Dropped'EndGO-------------------------------------------------------------------------------------- Object: usp_ReIndex-- Desc: Use this Procedure to ReIndex the MM SQL REpository whenever a-- Merge/Save of big model is done to MM-- Change History:-- Name Date Reason----------------------------------------------------------------------------------CREATE PROCEDURE usp_ReIndex ASDeclare@Cmd varchar(2000),@Name SysnameDECLARE tmp_Reindex CURSOR LO<strong>CA</strong>L FORSELECT NameFROM SysObjectsWHERE Type = 'U'OPEN tmp_ReindexFETCH NEXT FROM tmp_Reindex INTO @NameWHILE @@FETCH_STATUS = 0BEGINPrint 'Processing Index for Table ' + @NameSet @cmd = 'DBCC DBREINDEX (' + @Name + ', '''', 0)'Exec (@Cmd)If @@Error 0Print 'Error Reindexing Table ' + @NameFETCH NEXT FROM tmp_Reindex INTO @NameENDClose tmp_Reindexgo-- ReIndex the DBExec usp_ReIndexAppendix C: <strong>CA</strong> <strong>ERwin</strong> MM Performance 73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!