vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   freddie's Repair & Optimize Database (vB integration) (https://vborg.vbsupport.ru/showthread.php?t=38144)

TECK 05-01-2002 10:00 PM

freddie's Repair & Optimize Database (vB integration)
 
As we all know, there is a great tool included in the /extras folder, called [high]repair.php[/high].
I think not alot of people use it, because probably they don't know the gold mine hidden on it, related to tables optimisation.

freddie's script will repair your database, but ALSO will optimize the tables. So what is that means? It will remove all the empty spaces that clutter the database. The result? A smaller database size.

I ran the script on my localhost. At the beggining my database was 1.63MB. After I completed the repair&optimize process, my database was shrinked to 0.82MB!! That's almost half of the original size!!

So I decided to integrate this tool directly into my admin CP.
NOTE: The script is made by freddie, I only adapt it to the VB security and made it look like part of your CP. Also, my goal was to be able to optimize easy my database (with one click), not to repair it.

You can use this script in combination with another hack, also made freddie:
Admin Quick Stats


[high]INSTALL PROCEDURE[/high]
In /admin/index.php, find:
Code:

makenavoption("vBulletin Options","options.php?t=0","<br>");
BELOW THIS, add:
Code:

makenavoption("Repair & Optimize Data","repair.php?action=start","<br>");
Now, upload repair.php into your /admin folder. You are done. :)

[high]UPDATE[/high]
Quoted from freddie's post:
Quote:

Originally posted by freddie
I wrote repair.php as something that I could run nightly on my forum as it was getting periodic corruption. It has run nightly for probably a year now and I have not had a corrupt table since.

I thought that perhaps it might help out others and be an easier than telling everyone to go run myisamchk on their databases to fix problems. That being said, I only tested it on my forum so that is why it says "Not Supported". It won't work on non MyISAM tables and it won't work if the user table is corrupted.

TECK 05-02-2002 05:12 AM

"getting ready to run the script" screenshot...

UPDATE: refresh to see the new text warning...

TECK 05-02-2002 05:12 AM

"Repair & Optimize (in action)" screenshot...

Kaelon 05-02-2002 05:27 AM

This is a great script! I never knew it existed.

I ran it a couple of times, and here's a problem that I ran into:

Quote:

Checking table post
TABLE OPERATION TYPE TEXT
post check warning Table is marked as crashed and last repair failed
post check warning Size of indexfile is: 1652736 Should be: 1024
post check error Can't read indexpage from filepos: -1
forums.post check error Corrupt
Repairing table post
post repair error 28 when writing to datafile
Any ideas how to fix this?

Thanks!

Kaelon

Kaelon 05-02-2002 05:29 AM

Oh, boy - not good. After the above error, I'm unable to access my forums.

I get the following error:

Quote:

Database error in vBulletin 2.2.5:

Invalid SQL: SELECT COUNT(*) AS posts FROM post
mysql error:

mysql error number: 0

Date: Wednesday 01st of May 2002 11:24:24 PM
Script: http://www.alleria.com/forums/forums/index.php?s=
Referer: http://www.alleria.com/forums/admin/...hp?action=head
Any thoughts?

TECK 05-02-2002 05:30 AM

i quote from freddie:
Quote:

This script will attempt to repair corrupted databases. While it can repair most common errors, it can not repair everything.
he probably can give us more information related to this issue.

Kaelon 05-02-2002 05:31 AM

Yes, however, this problem didn't exist until I ran the repair.php script. It seems to have generated this problem. Do we know anything about the post Table that I could do to fix it by running several queries on it?

Here it is again:

Quote:

Checking table post
TABLE OPERATION TYPE TEXT
post check warning Table is marked as crashed and last repair failed
post check warning Size of indexfile is: 1652736 Should be: 1298432
post check error Found 31835 keys of 31834
forums.post check error Corrupt
Repairing table post
post repair error 28 when writing to datafile

Kaelon 05-02-2002 05:37 AM

That's really unfortunate. The forums were working as intended and it seemed to be running just fine prior to my running this script. It appeared that however it attempted to correct one of the tables ended up creating a problem sufficient enough to cause the forums to stop working.

I recommend that users not use this script until we know a bit more about it.

Kaelon

scsa20 05-02-2002 05:49 AM

or at least make a backup of the database before running the script

TECK 05-02-2002 05:52 AM

good point.. i will add this in the info.. in the repair.php file.
i only put the text that freddie had in there...


All times are GMT. The time now is 12:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01216 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete