Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
43
Добавлен:
18.03.2015
Размер:
684.09 Кб
Скачать

Global Improvements in Firebird 2.1

SQL> alter database add difference file '/tmp/dev_sda7';

To keep the size of the nbak copy within reasonable bounds, it is of benefit to know how much storage on the device is actually occupied. The '-s' switch of nbackup will return the size of the database in database pages:

# nbackup -s -l /dev/sda7 77173

Don't confuse the result here with the block size of the device. The figure returned—77173—is the number of pages occupied by the database. Calculate the physical size (in bytes) as (number of pages * page size). If you are unsure of the page size, you can query it from the database header using gstat -h:

# gstat -h /dev/sda7 Database "/dev/sda7"

Database header page information:

Flags

0

Checksum

12345

Generation

43

Page size

4096 <———

ODS version

11.1

. . . . . . .

Examples of nbackup Usage with a Raw Device

1.A backup can be performed in a script, using the output from the '-s' switch directly. For example,

#DbFile=/dev/sda7

#DbSize=`nbackup -L $DbFile -S` || exit 1

#dd if=$DbFile ibs=4k count=$DbSize | # compress and record DVD

#nbackup -N $DbFile

2.A physical backup using nbackup directly from the command line:

#nbackup -B 0 /dev/sda7 /tmp/lvl.0

Further Advice about Raw Devices

Although no other specific issues are known at this point about the use of raw device storage for databases, keep in mind that

the growth and potential growth of the database is less obvious to end-users than one that lives as a file within a file system. If control of the production system's environment is out of your direct reach, be certain to deploy adequate documentation for any monitoring that will be required!

21

Соседние файлы в папке doc