File: README.online_validation

package info (click to toggle)
firebird4.0 4.0.6.3221.ds6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,964 kB
  • sloc: ansic: 393,248; cpp: 356,542; sql: 15,263; yacc: 8,713; fortran: 5,645; sh: 5,184; pascal: 3,328; makefile: 1,342; asm: 271; perl: 194; xml: 55; csh: 15; awk: 1
file content (90 lines) | stat: -rw-r--r-- 3,994 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

  Database validation allows to run low-level checks of consistency of on-disk 
structures and even to fix some minor corruptions. It is recommended procedure
for any valuable database, i.e. DBA should validate database from time to time
to make sure it is healthy. But validation process requires exclusive access to 
database, i.e. it forbids any kind of concurrent access to database while 
validation runs. It could be a big problem to stop user access, especially when 
database is large and validation takes notable amount of time. 

  Online validation is a new feature which allows to perform some consistency
checks without exclusive access to database. Online validation allows to:
- validate some (or all) user tables in database
- validate some (or all) indices
- system tables are not validated
- other ODS checks (such as Header\PIP\TIP\Generators pages) are not run by
  online validation
- while table (and/or its index) is validated user attachments are allowed to 
  read this table. Attempt to INSERT\UPDATE\DELETE will wait until validation 
  finished or will return lock timeout error (depends on lock timeout of user 
  transaction)
- while table (and/or its index) is validated any kind of garbage collection at
  this table is disabled - background and cooperative garbage collection will 
  just skip this table, sweep will be terminated with error.

  When online validation starts to check table it makes few actions to prevent 
concurrent modifications of table's data:
- acquires relation lock in PR (protected read) mode
- acquires (new) garbage collection lock in PW (protected write) mode.
Both locks are acquired using user-specified lock timeout. If any lock request
fails error is reported and table is skipped.
Then table and its indices are validated in the same way as full validation does.
Then locks are released and next table is validated.

  Online validation is implemented as Firebird service and accessible via Services 
API. Therefore gfix utility can't run online validation. fbsvcmgr utility has
full support for new service, syntax is:

fbsvcmgr [host:]service_mgr [user <...>] [password <...>]
	action_validate dbname <filename>
	[val_tab_incl <pattern>]
	[val_tab_excl <pattern>]
	[val_idx_incl <pattern>]
	[val_idx_excl <pattern>]
	[val_lock_timeout <number>] 

where
	val_tab_incl		pattern for tables names to include in validation run
	val_tab_excl		pattern for tables names to exclude from validation run
	val_idx_incl    	pattern for indices names to include in validation run, 
						by default %, i.e. all indices
	val_idx_excl		pattern for indices names to exclude from validation run
	val_lock_timeout 	lock timeout, used to acquire locks for table to validate,
						in seconds, default is 10 sec
						 0 is no-wait
						-1 is infinite wait

  Patterns are regular expressions, they are processed by the same rules as 
"SIMILAR TO" expressions. All patterns are case-sensitive (despite of database 
dialect!). 
If pattern for tables is omitted then all user tables will be validated. 
If pattern for indices is omitted then all indices of tables to validate will 
be validated. 
System tables are not validated.

Examples:

1. fbsvcmgr.exe service_mgr user SYSDBA password masterkey 
		action_validate dbname c:\db.fdb
		val_tab_incl A% 
		val_idx_excl % 
		val_lock_timeout 0

this command will validate all tables in database "c:\db.fdb" with names 
starting with "A". Indices are not validated. Lock wait is not performed.

2. fbsvcmgr.exe service_mgr user SYSDBA password masterkey 
		action_validate dbname c:\db.fdb
		val_tab_incl "TAB1|TAB2"

this command will validate tables TAB1 and TAB2 and all their indices. 
Lock wait timeout is 10 sec.

Note, to specify list of tables/indices it is necessary to:
a) separate names by character "|"
b) don't use spaces : TAB1 | TAB2 is wrong
c) whole list should be enclosed in double quotes to not confuse command 
   interpreter


Vlad Khorsun, <hvlad at users sourceforge net>