473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

ok to delete ib_data1 after power outage?

Hi.

We're running mysql 4.1.2-alpha on a Redhat linux box. Every time we
have a power outage, or the machine shuts down w/o shutting down the
database, I always have the error

InnoDB: Unable to lock DATADIR/ibdata1 with lock 1, error: 11: fcntl:
Resource temporarily unavailable

(edited location of DATADIR to protect the innocent)

If I rename (or delete) the ib_data1, ib_logfile0, ib_logfile1 files,
then mysql recreates them and I'm up and running again. I don't seem to
be losing any data, as our databases are pretty static; mostly queries
after the tables are loaded.

Is this safe to do? What should I be doing?

Thanks.

Jul 23 '05 #1
4 3206
ti**************@nvl.army.mil wrote:
Hi.

We're running mysql 4.1.2-alpha on a Redhat linux box. Every time we
have a power outage, or the machine shuts down w/o shutting down the
database, I always have the error

InnoDB: Unable to lock DATADIR/ibdata1 with lock 1, error: 11: fcntl:
Resource temporarily unavailable

(edited location of DATADIR to protect the innocent)

If I rename (or delete) the ib_data1, ib_logfile0, ib_logfile1 files,
then mysql recreates them and I'm up and running again. I don't seem to
be losing any data, as our databases are pretty static; mostly queries
after the tables are loaded.

Is this safe to do? What should I be doing?

Thanks.


I found a thread discussing this symptom at:
http://forums.mysql.com/read.php?22,...2344#msg-22344

It seems to happen regularly if the MySQL server host goes down, and the
MySQL data directory is on an NFS-mounted filesystem. It might be
specific to the Linux NFS implementation.

The ibdata1 file is the default file that contains all InnoDB tables and
indexes. If you don't use the InnoDB table storage type for any of your
databases, then clobbering this file is probably okay for now.

I recommend the better fix is to store your datadir on a local
filesystem, a drive physically local to the server running MySQL.

I always prefer to use a local datadir instead of NFS-mounted, for the
following reasons:
- Performance - a direct SCSI or ATA interface to the hard drive is
faster than a network;
- Reliability - the NFS host or the network could become unavailable or
congested;
- Data integrity - if another MySQL daemon tries to write to the same
datadir, it would be Very Bad.

Regards,
Bill K.
Jul 23 '05 #2
Bill Karwin wrote:
ti**************@nvl.army.mil wrote: (snip)
I found a thread discussing this symptom at:
http://forums.mysql.com/read.php?22,...2344#msg-22344

It seems to happen regularly if the MySQL server host goes down, and the
MySQL data directory is on an NFS-mounted filesystem. It might be
specific to the Linux NFS implementation.

The ibdata1 file is the default file that contains all InnoDB tables and
indexes. If you don't use the InnoDB table storage type for any of your
databases, then clobbering this file is probably okay for now.

I recommend the better fix is to store your datadir on a local
filesystem, a drive physically local to the server running MySQL.

I always prefer to use a local datadir instead of NFS-mounted, for the
following reasons:
- Performance - a direct SCSI or ATA interface to the hard drive is
faster than a network;
- Reliability - the NFS host or the network could become unavailable or
congested;
- Data integrity - if another MySQL daemon tries to write to the same
datadir, it would be Very Bad.

Regards,
Bill K.


I'll have to look into putting the data on a local drive. Problem with
that is, those drives don't get backed up. They're considered
'scratch'. I don't have root access, and I'd have to get our sysadmins
to give us access.

I uncommented the innodb lines in the my.cnf file, but what besides
that determines if you are using InnoDB? Maybe I should just put the
comments back in and not bother with it?

Thanks.

Jul 23 '05 #3
ti**************@nvl.army.mil wrote:
I'll have to look into putting the data on a local drive. Problem with
that is, those drives don't get backed up. They're considered
'scratch'. I don't have root access, and I'd have to get our sysadmins
to give us access.
I would create backups with mysqldump and write those to the NFS
filesystem. It's tricky using the live database files as a backup
method anyway. Because MySQL caches some changes in memory and may
write them to the physical file later, you aren't guaranteed that the
file on disk has the latest view of your data unless you have shut down
the MySQL service.
I uncommented the innodb lines in the my.cnf file, but what besides
that determines if you are using InnoDB? Maybe I should just put the
comments back in and not bother with it?


Hmm. You should know this if you were the one who created the databases
and tables. You can also view the properties of a table this way:

mysql> show table status;

The "Engine" field of the output tells you whether each table is MyISAM
or InnoDB. You have to do this command while connected to each database
on your system to make sure you have no InnoDB tables anywhere.

Regards,
Bill K.
Jul 23 '05 #4
I checked, and the tables are MyISAM. There were created using mysqlcc.
That being the case, should I just comment back those lines in the
my.cnf file?
Thanks for the help. One of these days I should take a course in MySQL.

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: ajikoe | last post by:
Hello, If I use os.remove(fileName), does it always assure that the code will move to the next code only if the fileName is deleted completely? Pujo
0
by: Brian Chan | last post by:
hi, the power outage in ontario caused my server to crash. after i booted up again it was as if the past 18 hrs never happened. all the changes to the database were gone. is there anyway to...
0
by: Alex | last post by:
Hi all, I've been running a db2 V8.1 databasle to store my radius server accounting info for a *long* time and have never had any problems with it. Last week we had a power outage in our...
3
by: Michael Schindler | last post by:
Hello NG How I can delete a specific cell in my Datagrid. I would like if the user is in the column 6 the value changed, after automaticly the value in the column 7 in the same row to delete....
3
by: Mullin Yu | last post by:
As subject. How can an main application delete/reset a thread at the ThreadPool? There's no method provided by ThreadPool? Thanks!
4
by: yxq | last post by:
Hello everyone, I want to delete some especial power Registry key(i.e. HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider), but...
7
by: Anil Gupte | last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu2Exit.Click Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName) ...
3
by: waheed iqbal | last post by:
I am working on Power Point Automation and i just want to disable Delete Slide Option , Is there any way to disable delete slides option from right click menu and using delete key.
36
by: pearl146 | last post by:
Hi, I have some database files (.MDF, .LDF,...) on the server. When I try to delete them, the warning "Cannot delete file: There has been a sharing violation. The source or destination file may...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.