• No results found

Firebird database recovery: tools and techniques

N/A
N/A
Protected

Academic year: 2021

Share "Firebird database recovery: tools and techniques"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Firebird Conference 2014 (c) IBSurgeon, 2014 1

Firebird database recovery: tools and

techniques

Alexey Kovyazin

IBSurgeon

www.ib-aid.com

www.ibsurgeon.com

www.ibase.ru

(2)

Firebird Conference 2014 (c) IBSurgeon, 2014 2

(3)

Firebird Conference 2014 (c) IBSurgeon, 2014 3

About IBSurgeon

Firebird and

InterBase recovery

and optimization:

tools and services

Platinum sponsor of

Firebird Foundation

Since 2002

(4)

Firebird Conference 2014 (c) IBSurgeon, 2014 4

Typical corruption «environment»

No backups

No administrator

Unreliable hardware or wrong configuration of

hardware

Big database and 24/7 workmode – can’t do

backup/restore

Corruption never happened before or no

(5)

Firebird Conference 2014 (c) IBSurgeon, 2014 5

Behind the corruption

Hardware failure

Administrators/developers failures

Server bugs

(6)

Firebird Conference 2014 (c) IBSurgeon, 2014 6

Corruption from user's point of view

Unavailable database — i.e., cannot connect

there, with various errors

Errors while trying

SELECT/UPDATE/INSERT/DELETE

Low performance

(7)

Firebird Conference 2014 (c) IBSurgeon, 2014 7

Corruption from the server point of

view

Cannot build internal database image

System data lost?

Transactions pages lost?

Cannot read some records

Record is corrupted?

(8)

Firebird Conference 2014 (c) IBSurgeon, 2014 8

Symptoms of corruptions

Corruptions appear at:

1.

Users screen (“internal Firebird software consistency

check” error message)

(9)

Firebird Conference 2014 (c) IBSurgeon, 2014 9

Heavy and Easy corruptions

Easy corruptions

Users data are corrupted (partially)

User’s indices corrupted

Heavy corruptions

(10)

Firebird Conference 2014 (c) IBSurgeon, 2014 10

Examples

Cannot find TIP page

Lost TIP pages

Wrong transaction number in record header

What we can do

Recreate TIP

Delete records

(11)

Firebird Conference 2014 (c) IBSurgeon, 2014 11

Wrong record length

Record length does not correspond to declared

size

(12)

Firebird Conference 2014 (c) IBSurgeon, 2014 12

Attempted to read more segments..

BLOB corruption — loss of BLOB parts

What we can do?

Export as is

(13)

Firebird Conference 2014 (c) IBSurgeon, 2014 13

Cannot find record fragment

Fragment of record disappeared

Usually on another data page

(14)

Firebird Conference 2014 (c) IBSurgeon, 2014 14

Nbackup delta won't merge

Database delta won't merge

What we can do

Delete delta (it hurts!)

Manual merge with special tools

Export data

(15)

Firebird Conference 2014 (c) IBSurgeon, 2014 15

(16)

Firebird Conference 2014 (c) IBSurgeon, 2014 16

Standard means

Stop Firebird server.

Make a copy of Firebird database.

Start Firebird server and run the following commands:

gfix.exe -v -full

gfix.exe -mend –ig

gbak -b –g -v

If backup completed successfully, restore database: gbak -c -v

(17)

Firebird Conference 2014 (c) IBSurgeon, 2014 17

Not very well known, but still

standard means

1.R

un them all, even if gfix shows errors.

2.

Always use switch –ig for gbak to ignore checksum errors

3.

Always use switch –g for gbak to suppress garbage collection

(and to workaround index errors)

4.

Use –v switch to have detailed output

(18)

Firebird Conference 2014 (c) IBSurgeon, 2014 18

Restore errors

•After fixing corruptions it's a often to see "Cannot commit

index" error at restore step.

In Firebird 2.0 and later this comes as a warning and database will be not

brought on-line

How to workaround

IBDataPump

Bug with circular links

(19)

Firebird Conference 2014 (c) IBSurgeon, 2014 19

Effectiveness

Gbak+Gfix can recover almost all easy corruptions

What they cannot fix:

Heavy corruptions with a lot of losses

System data corruptions

(20)

Firebird Conference 2014 (c) IBSurgeon, 2014 20

(21)

Firebird Conference 2014 (c) IBSurgeon, 2014 21

IBSurgeon Tools for Recovery and

data protection

FirstAID

Direct

Extractor

FBDataGuard

Protection

Backups

(22)

Firebird Conference 2014 (c) IBSurgeon, 2014 22

IBSurgeon FirstAID: Direct

Scan internal structure and finds inconsistencies

Replace/restore lost system pages where it is

possible

Delete wrong pages and dead records

Fast!

(23)

Firebird Conference 2014 (c) IBSurgeon, 2014 23

IBSurgeon FirstAID: Extractor

Reads metadata from database and read records

bypassing server

Free preview of records is available

Export all good records to the new database

Resolve dependencies

Foreign Keys, Triggers, UDFs

Speed is 1Gb/hour

(24)

Firebird Conference 2014 (c) IBSurgeon, 2014 24

External metadata

Extractor can borrow metadata from good

healthy database with the same structure and

export data from corrupted one, even if all

system data lost

(25)

Firebird Conference 2014 (c) IBSurgeon, 2014 25

(26)

Firebird Conference 2014 (c) IBSurgeon, 2014 26

Increased recovery rate

Metadata repository increase recovery rate up

to 99%

FBDataGuard is a tool to create metadata

(27)

Firebird Conference 2014 (c) IBSurgeon, 2014 27

Better prevent when fix!

FBDataGuard vs FirstAID?

Easy licensing options

Special offer for attendees of Firebird

(28)

Firebird Conference 2014 (c) IBSurgeon, 2014 28

Thank you!

Www.ib-aid.com

Www.ibsurgeon.com

www.ib-aid.com www.ibsurgeon.com www.ibase.ru Www.ib-aid.com Www.ibsurgeon.com

References

Related documents

Payments by iforex com complaints or experience about forex trading platform from your personally identifiable information depth information share your date of india!. Results but if

No paid reviews Get concrete on Denny's real problems Customer service an support information File a complaint at ComplaintsBoardcom.. If you're 55 or church save some success

Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions. Start

80 TOP SELENIUM webdriver interview Questions for 5 years experience

Want to select aaa com insurance really covers can access your home insurance more reasons to select coverages, insurance coverage and are a treasure.. Milestone that go www

Pre-operative lateral cephalogram Post-operative lateral cephalogram D IAGNOSIS : Class III malocclusion (underbite), maxillary anterior-posterior hypoplasia,.

The paper scopes across a range of matters while focusing on building sustainability, specifically site development, life cycle assessment, cost of demolition, cost

Many important factors influencing imbibition, such as pore structure, pore size distribution, wettability, types of flowing space (organic pores/inorganic pores/ micro