Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread VERIFY/REPAIR/OPTIMIZE SCRIPT
Mon, Nov 18 2013 11:09 PMPermanent Link

Pierre du Plessis

Comproware

Hi Folks,

Has anyone developed a nice script to do this elegantly that are willing to share it here?

Many thanks
Pierre
Tue, Nov 19 2013 3:11 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Pierre


I use Delphi so that I can give the users the option of selecting which tables to verify etc.

You're welcome to a copy of the pas & dfm but it will take a few days. I'm currently installing W7 64 bit on my PC and having a few problems.

Roy Lambert
Tue, Nov 19 2013 6:21 PMPermanent Link

Pierre du Plessis

Comproware

Absolutely, thank you so much Roy Smile
Wed, Nov 20 2013 4:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Pierre


OK, it will be a while yet though. Today I try and get D6 & D2006 set up with all the components - wish me luck

Roy Lambert
Wed, Nov 20 2013 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< Has anyone developed a nice script to do this elegantly that are willing
to share it here? >>

Do you want to just do this on all tables in the database ?  This should get
you started:

SCRIPT
BEGIN
  DECLARE CatalogCursor SENSITIVE CURSOR FOR CatalogStatement;
  DECLARE TableName VARCHAR DEFAULT '';
  DECLARE CurrentTable INTEGER DEFAULT 1;

  PREPARE CatalogStatement FROM 'SELECT * FROM Information.Tables';
  OPEN CatalogCursor;

  SET PROGRESS TO 0;
  SET LOG MESSAGE TO '*** Repair of database '+CURRENT_DATABASE()+
                     ' started on '+CAST(CURRENT_TIMESTAMP() AS VARCHAR);

  FETCH FIRST FROM CatalogCursor ('Name') INTO TableName;

  WHILE NOT EOF(CatalogCursor) DO

     SET STATUS MESSAGE TO 'Repairing table '+TableName;

     EXECUTE IMMEDIATE 'REPAIR TABLE '+QUOTEDSTR(TableName,'"');

     FETCH NEXT FROM CatalogCursor ('Name') INTO TableName;

     SET PROGRESS TO TRUNC((CurrentTable/ROWCOUNT(CatalogCursor))*100);

     SET CurrentTable=CurrentTable+1;

  END WHILE;

  SET LOG MESSAGE TO '*** Repair of database '+CURRENT_DATABASE()+
                     ' completed on '+CAST(CURRENT_TIMESTAMP() AS VARCHAR);

END

You could handle user-selection by populating a table with the list of table
names to repair, and querying it instead of the Information.Tables table.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 27 2013 4:32 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Pierre


I've finally loaded my forms to the binaries. The subject is Verify / repair / optimise forms.

They do use my homebrew components (which are also in the binaries) so they won't run straight off in a standard Delphi installation.

Roy Lambert
Thu, Nov 28 2013 11:42 AMPermanent Link

Pierre du Plessis

Comproware

Thanks very much Roy!

I was on a week's holiday, just returned yesterday Smile I will have a look.

Many thanks again
Pierre
Thu, Nov 28 2013 11:45 AMPermanent Link

Pierre du Plessis

Comproware

Hi Tim,

Thanks very much for this - apologies for the tardy response - My wife and I did a road trip for a week.

Kind regards
Pierre
Mon, Dec 2 2013 2:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pierre,

<< Thanks very much for this - apologies for the tardy response - My wife
and I did a road trip for a week. >>

Road trips are fun, hope you had a good time. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image