If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > delete orphan records form database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-09, 12:39
smilem smilem is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
delete orphan records form database

I think, perhaps I could use SQL script to delete the orphan data in database? Then gallery2 would not get slower and slower. Anyone knows how to make it?

The gallery2 has integrity check module that checks the db but does not repair it.

Last Run Details:

Checked 175 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598

First I need a sql to view the orphan records
Then sql to delete the orphan records.


I attach my AccessMap, AccessSubscriberMap SQL tables here.
I tried to wrte it myself but I'm not a programmer so...

I also attach my fixed tables (I deleted by hand)
Thanks for your help.
Attached Files
File Type: txt gallery2_g2.sql.txt (12.2 KB, 72 views)
File Type: txt orphans_removed_g2.sql.txt (1.7 KB, 60 views)

Last edited by smilem; 10-28-09 at 13:06.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On