Re: Locking TABLES for myisamchk, please help!!

2002-05-27 Thread Stephen Brownlow

I understand all of the reasons given by Alexander.
Yet I think that in 99% of cases, it would be best for myisamchk to do as
Mark suggest, and not run when a MySQL server is active.
Safety would be the default.
There could be a special option (--no-safety) for myisamchk to override that
check.

- Original Message -
From: "Alexander Keremidarski" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.mysql
Sent: Thursday, May 23, 2002 1:54 AM
Subject: Re: Locking TABLES for myisamchk, please help!!


> Mark wrote:
> > Wednesday, May 22, 2002, 9:23:02 AM, louie wrote:
> 
>
> > Personally, I find the behavior of myisasmchk to be a bit "beta" when it
> > comes live tables. It would be real easy for myisasmchk to refuse to run
> > when mysqld is running. That should be a built-in precaution. I can
> > understand possible objections to myisasmchk globally locking tables
> > out of the blue (it might disrupt what some clients are doing), but if
> > myisamchk cannot run on a live table, it should not run on a live table.
> > As simple as that.
>
> Hi,
> It is not that simple.
>
> You can run several mysqld simultaneously. So checking if mysqld is
> running is not enough.
>
> Or you might wish to use myisamchk knowing in advance that mysqld will
> not write to table.
>
> Typical case is to check 'offline' database or table. Backup copy for
> example.
>
> Another case: You want to check table which is read-only for all mysql
> users and for some reason (different priority, buffers used etc.) you
> don't want to do it with REPAIR TABLE.
>
> myisamchk uses tables as files so it is admin responcibility to avoid
> problems. It is dangerous to use it but it is possible.
>
> You can compare it to filesystem checks. It is admin to decide if he can
> handle it with live server or not.



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Locking TABLES for myisamchk, please help!!

2002-05-22 Thread Alexander Keremidarski

Mark wrote:
> Wednesday, May 22, 2002, 9:23:02 AM, louie wrote:


> Personally, I find the behavior of myisasmchk to be a bit "beta" when it
> comes live tables. It would be real easy for myisasmchk to refuse to run
> when mysqld is running. That should be a built-in precaution. I can
> understand possible objections to myisasmchk globally locking tables out of
> the blue (it might disrupt what some clients are doing), but if myisamchk
> cannot run on a live table, it should not run on a live table. As simple as
> that.

Hi,
It is not that simple.

You can run several mysqld simultaneously. So checking if mysqld is running is 
not enough.

Or you might wish to use myisamchk knowing in advance that mysqld will not write 
to table.

Typical case is to check 'offline' database or table. Backup copy for example.

Another case: You want to check table which is read-only for all mysql users and 
for some reason (different priority, buffers used etc.) you don't want to do it 
with REPAIR TABLE.

myisamchk uses tables as files so it is admin responcibility to avoid problems.
It is dangerous to use it but it is possible.

You can compare it to filesystem checks. It is admin to decide if he can handle 
it with live server or not.

-- 
Best regards
-- 
For technical support contracts, visit https://order.mysql.com/
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Mr. Alexander Keremidarski <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Sofia, Bulgaria
<___/   www.mysql.com   M: +359 88 231668




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Locking TABLES for myisamchk, please help!!

2002-05-22 Thread Mark

Wednesday, May 22, 2002, 9:23:02 AM, louie wrote:

lm> Hi, i was thingking about locking the tables first so no connection
lm> could write so i can do myisamchk. Is this process safe?

lm> Procedures:

lm> 1. lockdb
lm> 2. run myisamchk -r or -o
lm> 3. unlock db

lm> Btw, mysqld is running. I want to off it but i can't its a production
lm> server.
lm> Hope anyone could give me more info.


Personally, I find the behavior of myisasmchk to be a bit "beta" when it
comes live tables. It would be real easy for myisasmchk to refuse to run
when mysqld is running. That should be a built-in precaution. I can
understand possible objections to myisasmchk globally locking tables out of
the blue (it might disrupt what some clients are doing), but if myisamchk
cannot run on a live table, it should not run on a live table. As simple as
that.

- Mark


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Locking TABLES for myisamchk, please help!!

2002-05-22 Thread Egor Egorov

louie,
Wednesday, May 22, 2002, 9:23:02 AM, you wrote:

lm> Hi, i was thingking about locking the tables first so no connection
lm> could write so i can do myisamchk. Is this process safe?

lm> Procedures:

lm> 1. lockdb
lm> 2. run myisamchk -r or -o
lm> 3. unlock db

lm> Btw, mysqld is running. I want to off it but i can't its a production
lm> server.
lm> Hope anyone could give me more info.

Don't run myisamchk when MySQL is running!
Use REPAIR TABLE instead of myisamchk:
  http://www.mysql.com/doc/R/E/REPAIR_TABLE.html

lm> ty,
lm> louie...





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Locking TABLES for myisamchk, please help!!

2002-05-21 Thread louie miranda

Hi, i was thingking about locking the tables first so no connection
could write so i can do myisamchk. Is this process safe?

Procedures:

1. lockdb
2. run myisamchk -r or -o
3. unlock db

Btw, mysqld is running. I want to off it but i can't its a production
server.
Hope anyone could give me more info.


ty,
louie...





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php