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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Reindex the DatabaseExample: Sybase DBMS Reindex ScriptAn example of the Sybase dbms reindex script (MMReIndex.ora):-- 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 Sysname(100) ,@output_str varchar( 255 )DECLARE tmp_Reindex CURSOR FORSELECT nameFROM sysobjectsWHERE type = 'U'OPEN tmp_ReindexFETCH tmp_Reindex INTO @NameWHILE ( @@sqlstatus = 0 )BEGINSELECT @output_str = 'Processing Index for Table '+@NamePrint @output_str--Set @Cmd = 'DBCC REINDEX (' + @Name + ')'--Exec (@Cmd)DBCC REINDEX (@Name )If @@Error 0BeginSELECT @output_str = 'Processing Index for Table1 '+@NamePrint @output_strendFETCH tmp_Reindex INTO @NameENDClose tmp_ReindexgoEXEC usp_ReIndex74 <strong>Implementation</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!