Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New gbak option to ignore specific tables data during the backup [CORE2208] #2636

Closed
firebird-automations opened this issue Nov 25, 2008 · 19 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @WarmBooter

Is duplicated by CORE4343
Is related to QA637

Votes: 12

I would like to ask for a new gbak switch to avoid data from the specified tables to be included in the backup. It would be useful, for example, to generate backup without data from log tables, etc. In situations like downloading customer DB for debug, those tables may not be necessary, so ignoring its data usually makes the backup file much smaller.

Of course, in standard situations, user needs to take care to not "ignore" data from tables with referential integrity that could make the restore to fail. If you guys think this can be a problem, gbak could be enhanced to check if there would be broken dependencies and return an errorcode.

Commits: 523c55f FirebirdSQL/fbt-repository@033458e

====== Test Details ======

It was found that there is NO ability (in fbtest only! not in command interpreter)
to skip data from backup for table with non-ascii name, neither if we specify its name
as literal nor via pattern. For that reason one of checks currently is commented
(see inside .fbt, code block titled as: `Run-3: try to skip BACKUP of data for table "опечатка"`).

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Errors happening when gbak restores foreign key with missing data are not fatal since 2.0 - given foreign key becomes inactive in such case. Restored database remains in shutdown state, i.e. nobody except DBA can access it.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

If this feature can get approved, BroadView already has code in its private tree, which enables a "-Skip_Data" options for both backups and restores via GBak.

We would be happy to contribute the code to the project.

@firebird-automations
Copy link
Collaborator Author

Commented by: @samofatov

The feature is in fact in B2_0_BV_Stable6 branch of Firebird public tree

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I see no reason why it cannot be approved :-)

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ] => Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Open [ 1 ]

Target: 3.0.0 [ 10048 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @WarmBooter

Any progress on this request? I also would like to see this feature backported to 2.1.x and 2.5.x if possible.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Target: 3.0.0 [ 10048 ] => 3.0 Beta 1 [ 10332 ]

status: Open [ 1 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Taking into an account that it definitely does not require any ODS change, I plan to get it ready before beta1.
Backporting to appropriate releases of old branches sooner of all possible.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE4343 [ CORE4343 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

B2_0_BV_Stable6 was taken as a base for that feature. Switch -SKIP_D(ATA) accepts regular expression, i.e. to skip (for example) 2 tables one can:
gbak -skip_d '(sales|customer)' employee e1.fbk
One may skip data not only during backup, but also during restore - SKIP_DATA works in both cases the same way.

What about backporting - sorry, backporting even simple switch it's too easy to break accidetially something around, which is not good for stable releases.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @WarmBooter

No problem, Alex. At last, feature will be present in FB 3.
PS: The ticket is almost 6 years old! Time flies <g>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA637 [ QA637 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done with caveats

Test Details: It was found that there is NO ability (in fbtest only! not in command interpreter)
to skip data from backup for table with non-ascii name, neither if we specify its name
as literal nor via pattern. For that reason one of checks currently is commented
(see inside .fbt, code block titled as: `Run-3: try to skip BACKUP of data for table "опечатка"`).

@firebird-automations
Copy link
Collaborator Author

Commented by: Franz J Fortuny (frafor49)

I have installed 3.0, latest version (Ubuntu) and gbak has no switch skip_xx or similar.

gbak:Usage:
gbak -b <db set> <backup set> [backup options] [general options]
gbak -c <backup set> <db set> [restore options] [general options]
<db set> = <database> | <db1 size1>...<dbN> (size in db pages)
<backup set> = <backup> | <bk1 size1>...<bkN> (size in bytes = n[K|M|G])
-recreate overwrite and -replace can be used instead of -c
gbak:legal switches are:
-B(ACKUP_DATABASE) backup database to file
-C(REATE_DATABASE) create database from backup file (restore)
-R(ECREATE_DATABASE) [O(VERWRITE)] create (or replace if OVERWRITE used)
database from backup file (restore)
-REP(LACE_DATABASE) replace database from backup file (restore)
gbak:backup options are:
-CO(NVERT) backup external files as tables
-E(XPAND) no data compression
-FA(CTOR) blocking factor
-G(ARBAGE_COLLECT) inhibit garbage collection
-IG(NORE) ignore bad checksums
-L(IMBO) ignore transactions in limbo
-NOD(BTRIGGERS) do not run database triggers
-NT Non-Transportable backup file format
-OL(D_DESCRIPTIONS) save old style metadata descriptions
-T(RANSPORTABLE) transportable backup -- data in XDR format
gbak:restore options are:
-BU(FFERS) override page buffers default
-FIX_FSS_D(ATA) fix malformed UNICODE_FSS data
-FIX_FSS_M(ETADATA) fix malformed UNICODE_FSS metadata
-I(NACTIVE) deactivate indexes during restore
-K(ILL) restore without creating shadows
-MO(DE) <access> "read_only" or "read_write" access
-N(O_VALIDITY) do not restore database validity conditions
-O(NE_AT_A_TIME) restore one table at a time
-P(AGE_SIZE) override default page size
-USE_(ALL_SPACE) do not reserve space for record versions
gbak:general options are:
-FE(TCH_PASSWORD) fetch password from file
-M(ETA_DATA) backup or restore metadata only
-PAS(SWORD) Firebird password
-RO(LE) Firebird SQL role
-SE(RVICE) use services manager
-SKIP_D(ATA) skip data for table
-ST(ATISTICS) TDRW show statistics:
T time from start
D delta time
R page reads
W page writes
-USER Firebird user name
-V(ERIFY) report each action taken
-VERBI(NT) <n> verbose information with explicit interval
-Y <path> redirect/suppress status message output
-Z print version number
gbak:switches can be abbreviated to the unparenthesized characters

No skyp_xx switch here. What happened?

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

-SKIP_D(ATA) skip data for table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants