14-03-2008, 14:13
YEDEKLEME VE GERİ YÜKLEME:
Yedekleme işini ancak “SYSDBA” ya da veritabanını oluşturan kullanıcı hesabı (sahip) yapabilir.
Yedekleme aracı “gbak.exe” dir.
General Options
Backup Options
Restore Options
1 - ) Yedekleme:
Standart yedekleme;
Syntax:
gbak <options> -user <username> -password <password> <source_file(*.fdb)> <dest_file(*.fbk)>
Örnek:
2 - ) Geri Yükleme:
Geri yükleme yaptığınızda veritabanındaki gereksiz yer kaplayan silinmiş verilerden de kurtulmuş
olursunuz. Temizlik, yedek alınırken yapılıyor. Bu yolla veritabanınız sıkıştırılmış olur.
Belirli zamanlarda yapmanızı tavsiye ederim.
Veritabanı kullanımda değilse (tüm kullanıcıların bağlantısı kapalı) doğrudan mevcut veritabanın
üzerine yazdırabilirsiniz.
Syntax:
gbak <options> -user <username> -password <password> <source_file(*.fbk)> <dest_file(*.fdb)>
a - ) Veritabanını Geri Yükle ( Üzerine Yazmasın ):
Bu metot ile veritabanı farklı bir dosya ismi ile geri yüklenir.
b - ) Veritabanını Geri Yükle ( Üzerine Yazılsın ):
Eğer tüm Connection’ lar kapalı ise, doğrudan mevcut veritabanının üzerine yazılması sağlanır.
Yedekleme işini ancak “SYSDBA” ya da veritabanını oluşturan kullanıcı hesabı (sahip) yapabilir.
Yedekleme aracı “gbak.exe” dir.
General Options
Kod:
-pa[ssword] <password> Database password
-role <role> Connect as role
-se[rvice] <hostname>:service_mgr
Backup: Creates the backup file on the database server,
using the Service Manager.
Restore: Creates the database from a backup file on the
server, using the Service Manager.
-u[ser] <username> Database user name
-v[erbose] Verbose output of what GBAK is doing
-y <filename> Redirect all output messages to <filename>
The file must not exist before running GBAK!
-y suppress_output Quiet mode
-z Show GBAK version and server versionBackup Options
Kod:
-b[ackup_database] Back up. This switch is optional.
-co[nvert] Converts external tables to internal tables
-e[xpand] Creates an uncompressed backup
-fa[ctor] n Blocking factor for tape device
-g[arbage collect] Does not perform garbage collection (sweeping) during backup
-ig[nore] Ignores checksum errors while backing up
-l[imbo] Ignores limbo transactions while backing up
-m[etadata] Only backs up metadata (schema). No table data will be stored.
-nt Non-transportable format (use only when you know you will
restore on same platform and database version)
-t[ransportable] Creates a transportable backup (transportable between
platforms and server versions)Restore Options
Kod:
-bu[ffers] Set cache size for restored database
-c[reate_database] Restore to a new database (the target database file MUST NOT exist)
-i[nactive] All indexes will be restored as INACTIVE
-k[ill] Does not create shadows that are defined in the backup
-mo[de] read_write Restores to a read/write database (This is the default)
-mo[de] read_only Restores to a read-only database
-n[o_validity] Does not restore validity constraints.
So you can restore data that does not meet these constraints
and could not be restored otherwise.
-o[ne_at_a_time] Restores one table at a time. You can use this to partially
restore databases with corrupt table data
-p[age_size] <size> Sets page size of new database. <size> can be one of
1024, 2048, 4096, 8192. Default is 1024.
-r[eplace_database] Restores over an existing database. This can only be performed
by SYSDBA or the owner of the database that is overwritten.
Do NOT restore over a database that is in use! [Firebird 1.0, 1.5]
-rep[lace_database] New abbreviation for the old -replace_database [Firebird 2.0]
-r[ecreate_database] o[verwrite] [Firebird 2.0] Restores over an existing database.
This can only be performed by SYSDBA
or the owner of the database that is
overwritten. Do NOT restore over a
database that is in use!
-r is equivalent to -c. Only the "overwrite" option will restore over an existing database.
-use_[all_space] Normally, on restore, database pages will be filled to about 80 %.
With the use_all_space option, database pages will be filled to 100 %.
(Useful for read-only databases which will see no more modifications.)1 - ) Yedekleme:
Standart yedekleme;
Kod:
-t = Yedek dosyasının her platformda geri yüklenebilme özelliği.
-v = gbak.exe'nin yaptığı işlerin detayları
-y <Path> = Detayların yazılacağı dosya adı. ( -v ile birlikte kullanılır.)Syntax:
gbak <options> -user <username> -password <password> <source_file(*.fdb)> <dest_file(*.fbk)>
Örnek:
Kod:
Sub Yedekle()
Dim GBAK As String
GBAK = "C:\Program Files\Firebird\Firebird_2_0\bin\gbak "
Shell GBAK & "-v -y C:\Rapor.txt -t -u SYSDBA -pa masterkey C:\Test.fdb C:\Yedek.fbk"
End Sub2 - ) Geri Yükleme:
Geri yükleme yaptığınızda veritabanındaki gereksiz yer kaplayan silinmiş verilerden de kurtulmuş
olursunuz. Temizlik, yedek alınırken yapılıyor. Bu yolla veritabanınız sıkıştırılmış olur.
Belirli zamanlarda yapmanızı tavsiye ederim.
Veritabanı kullanımda değilse (tüm kullanıcıların bağlantısı kapalı) doğrudan mevcut veritabanın
üzerine yazdırabilirsiniz.
Kod:
-r = ReCreate Database
o = OverWrite (Opsiyonel, -r ile birlikte kullanılır.)
-v = gbak.exe'nin yaptığı işlerin detayları
-y <Path> = Detayların yazılacağı dosya adı. ( -v ile birlikte kullanılır.)Syntax:
gbak <options> -user <username> -password <password> <source_file(*.fbk)> <dest_file(*.fdb)>
a - ) Veritabanını Geri Yükle ( Üzerine Yazmasın ):
Bu metot ile veritabanı farklı bir dosya ismi ile geri yüklenir.
Kod:
Sub Geriyukle()
Dim GBAK As String
GBAK = "C:\Program Files\Firebird\Firebird_2_0\bin\gbak "
Shell GBAK & "-v -y C:\Rapor.txt -r -u SYSDBA -pa masterkey C:\Yedek.fbk C:\Test.fdb"
End Subb - ) Veritabanını Geri Yükle ( Üzerine Yazılsın ):
Eğer tüm Connection’ lar kapalı ise, doğrudan mevcut veritabanının üzerine yazılması sağlanır.
Kod:
Sub Geriyukle()
Dim GBAK As String
GBAK = "C:\Program Files\Firebird\Firebird_2_0\bin\gbak "
Shell GBAK & "-v -y C:\Rapor.txt -r o -u SYSDBA -pa masterkey C:\Yedek.fbk C:\Test.fdb"
End Sub
