FBIRD_RESTORE
Purpose
Use the fbird_restore function to initiate a
backup task on the server system through the FB Services Manager.
Syntax
<restore>
::= fbird_restore(svc_hndl, src_file, dest_db,
[, options [, verbose]])
Element
|
Type
|
Description
|
svc_hndl
|
resource
|
A valid service handle
|
dest_db
|
string
|
Alias / path of DB to restore
|
src_file
|
string
|
Path on server of backup file
|
options
|
integer
|
Backup options (see below)
|
verbose
|
bool
|
Verbose flag
|
<return>
|
mixed
|
False on failure; True or string for success
|
Semantics
Use this function to request the Services Manager
to perform a restore operation. This is a programmatic method to
invoke the gbak tool.
Paths to the backup files are relative to the
server. Since the Services Manager executes backup and restore tasks
on the server host, the Services Manager reads and writes backup
files on the server host.
The following table lists the options that can be
specified for this restore operation:
Flag
|
Meaning
|
|
IBASE_RES_DEACTIVATE_IDX
|
Do not build user indexes during restore;
corresponds to 'gbak -inactive'
|
|
IBASE_RES_NO_SHADOW
|
Do not recreate shadow files during restore;
corresponds to 'gbak -kill'
|
|
IBASE_RES_NO_VALIDITY
|
Do not enforce validity conditions (for
example,NOT NULL) during restore; corresponds to 'gbak
-no_validity'
|
|
IBASE_RES_ONE_AT_A_TIME
|
Commit after completing restore of each
table; corresponds to 'gbak -one_at_a_time'
|
|
IBASE_RES_REPLACE
|
Replace database, if one exists; corresponds
to 'gbak -replace'
|
|
IBASE_RES_CREATE
|
Restore but do not overwrite an existing
database; corresponds to 'gbak -create'
|
|
IBASE_RES_USE_ALL_SPACE
|
Do not reserve 20% of each data page for
future record versions; useful for read-only
databases; corresponds to 'gbak -use_all_space'
|
If the verbose flag is
specified, the Services Manager prepares output to return as a
string. This output corresponds to “gbak -verbose”.
The return value is
True for a succesful initiation of the backup process or a string in
case verbose is specified. The return value is False for a failed
initiation.
Example
The below example initiates a resore of 'mydb' on
the local machine, and reports back on the backup process steps:
$svc_hndl = fbird_service_attach
('localhost', 'username', 'password'); echo
fbird_restore($svc_hndl, 'c:\bckup\mydb.fbk',
'mydb.fdb', 0,
true); ibase_service_detach ($resource_service_handle);
See also
fbird_service_attach,
fbird_restore
|