Re: to backup mysql,what file should I copy?
- From: Jean-David Beyer <jdbeyer@xxxxxxxxxxx>
- Date: Mon, 26 Dec 2005 08:08:29 -0500
somez72 wrote:
> Hi,
> 1)
> I'd like to know,
> to bakcup mysql, which data file is related to mysql?
> what is real data file for mysql?
>
I do not know about mysql, but I do know about other dbms's. It is better to
use the backup tools _in the dbms_ to backup a dbms. For one thing, it is
not always easy to know what files are involved; with IBM's DB2 dbms, for
example, there are roughly two files per relation (one for the data, one for
the index) plus other ones for the ddl, etc.
For another thing, if the dbms is running, your backup will have
synchronization problems (the files backed up will almost certainly be
inconsistent).
Thirdly, there will almost certainly be problems with commitment if you
restore from such backups. Certain transactions marked committed may not be,
or those not marked committed may be, and your data will go to hell and you
will never find it.
I assume you would have the same problems with mysql. So best bet is to find
out how to tell mysql to backup the data base(s).
> 2) if I have table which has two columns.
> for example )
> id int (11)
> name char (20)
>
> How many record can be saved in this table?
> namely, what is max number of record for one table?
Normally you can have any number of tuples (rows, records) in a table. The
main issue on small machines (i.e., 32-bit machines) is the maximum size of
a file (assuming a separate file is used for each table in the database,
which is typical but perhaps not universal). With IBM's DB2, you put tuples
(rows, records) into pages, and pages can be 4K, 8K, 16K, or 32K bytes each,
and a few of those bytes are for overhead, so in the case of 4K pages, only
4005 bytes can be used for the attributes (i.e., columns), not all 4096, and
for variable length attributes, the overhead is higher still.
Now if mysql uses the normal Linux file system for IO, the maximum number of
tuples (rows, records) will be determined by the maximum file size allowed.
I suppose that is 2^32 bytes or so. If mysql uses raw IO (bypassing the ext2
or ext3 file system stuff), the maximum size might be larger because it
might be that the dbms can use the space differently. It would depend on
just what the disk driver in the kernel could do (and I do not know anything
about that) or whether the dbms would divide such a relation into multiple
"files" automatically.
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 07:45:00 up 29 days, 18:17, 5 users, load average: 4.38, 4.28, 4.24
.
- References:
- to backup mysql,what file should I copy?
- From: somez72
- to backup mysql,what file should I copy?
- Prev by Date: Can I throw windows completely?
- Next by Date: Re: Can I throw windows completely?
- Previous by thread: Re: to backup mysql,what file should I copy?
- Next by thread: error in getfullcomps.xml
- Index(es):
Relevant Pages
|