[mythtv-users] Problem with latest run of optimize_mythdb.pl

Mike Perkins mikep at randomtraveller.org.uk
Mon Dec 28 22:56:18 UTC 2015


On 28/12/15 21:29, Hika van den Hoven wrote:
> Hoi Mark,
>
> Monday, December 28, 2015, 10:14:50 PM, you wrote:
>
>
>
>
>
>>> On 29 Dec 2015, at 7:36 am, Hika van den Hoven <hikavdh at gmail.com> wrote:
>>>
>>> Hoi Jerome,
>>>
>>> Monday, December 28, 2015, 9:05:02 PM, you wrote:
>>>> Just how robust is MySQL at handling a major table rewrite like
>>>> this on a live database? I see it's available in 0.27.5 and I wonder
>>>> if I have to alter the twice-weekly cron-and-forget way I use it now
>>>> (without the defraggng) or I can just drop it in and it will play
>>>> nice with an active backend that might be recording at any time of the day.
>>>
>>> I don't have the answer to your question, but those scripts I run at
>>> night. 4:10 the backup 5:30 optimize and 5:50 my grabber starts, being
>>> ready around 7. Maybe once a year or less I'm recording at those
>>> times!
>>> Like on every IT system, the night is for maintenance!
>>>
>>> Tot mails,
>>>   Hika                            mailto:hikavdh at gmail.com
>>>
>>> "Zonder hoop kun je niet leven
>>> Zonder leven is er geen hoop
>>> Het eeuwige dilemma
>>> Zeker als je hoop moet vernietigen om te kunnen overleven!"
>>>
>>> De lerende Mens
>>>
>>> _______________________________________________
>
>> So getting OT now, but should I backup then optimize or optimize
>> then backup? My cron is set so optimize runs before the backup.
>> _______________________________________________
>
> I choose to backup first, which with the original crash in this topic
> on optimize would be the right choice. I guess backup would be faster
> and smaller though after a successful optimize, but if you run it
> daily not by much. Also I think it wise to run optimize after a
> restore, so ...
> You however definitely have to check the duration of both, so they can
> never coincide!!!
>
Backups are doing a sequential read of the database, so shouldn't be particularly inefficient. If 
you're running overnight while little else is happening the time taken shouldn't be of much 
consequence. It's when you are running complex SQL operations that you need to have the resources 
and memory available.

I agree, do the backup before any operations on the database. That way, you can roll back to a know 
state without losing a day's activities.

-- 

Mike Perkins



More information about the mythtv-users mailing list