TUniDump: views order creation

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alexdmatveev
Posts: 9
Joined: Mon 04 Nov 2013 18:46

TUniDump: views order creation

Post by alexdmatveev » Thu 23 Feb 2017 14:00

Hello collegues,

we have a MySQL database with some views.

I get nice dump after I call:

Code: Select all

FDump.BackupToFile(filename);
Some days before we changed views structure and now I execute the same procedure to create a dump file.

And now I have an interesting problem with views creation order.

We have next views (alphabetical order):

Code: Select all

geraete_full_short
geraete2geraete_view
geraetecounter
grorder
lt32_typen
masteradd
typen_klassen
Problem is geraetecounter view selects some data from geraete_full_short.
So geraetecounter must be create after geraete_full_short.

TUniDump provides me dump file with views creation order as below:

Code: Select all

geraete2geraete_view
geraetecounter
geraete_full_short
grorder
lt32_typen
masteradd
typen_klassen
So we have a problem to load this dump file back to a database.

What should we do?


Thanks.

PS:
mysqldump.exe creates file with correct order.
SQLYog creates file with correct order.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TUniDump: views order creation

Post by ViktorV » Fri 24 Feb 2017 08:56

You can use the TUniDump.TableNames property to specify the concrete tables and views for backup. The tables and views will be backup in the order in which they are listed in this property.

alexdmatveev
Posts: 9
Joined: Mon 04 Nov 2013 18:46

Re: TUniDump: views order creation

Post by alexdmatveev » Fri 24 Feb 2017 09:26

Hello,

thanks for the answer.

In my case it is so:

we have database administrators and developers. It would be good if developers can be independent from DBA actions.

Why should developers know about dependencies between views?
They ONLY want to make dump of the database with correct documented API provided by Unidac.

It is quite possible with other tools.
Maybe have we any workaround here with perfect Unidac?

Thanks.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TUniDump: views order creation

Post by ViktorV » Fri 24 Feb 2017 12:05

UniDAC backups tables and views in the sequence corresponding to their order in the query result to the system tables of MySQL server.
If you want us to change this behavior, please write about it on our User Voice forum: https://devart.uservoice.com/forums/104 ... 939-unidac. If your proposal gains enough votes we will consider a possibility of its change.

alexdmatveev
Posts: 9
Joined: Mon 04 Nov 2013 18:46

Re: TUniDump: views order creation

Post by alexdmatveev » Fri 24 Feb 2017 14:23

ok, it is clear.

Thanks a lot for support.

We have realized it using mysqldump.exe and mysql.exe.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TUniDump: views order creation

Post by ViktorV » Mon 27 Feb 2017 12:12

Thank you for your interest to our product.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.

Post Reply