SCRIPT data for one schema only

1,164 views
Skip to first unread message

Uli

unread,
Sep 20, 2010, 7:29:12 AM9/20/10
to H2 Database
Hi,

I want to implement a kind of backup feature in my application where I
want to store some parts but not all of the database. Therefore I want
to create a new schema where I copy the data for the backup. Now I
have the problem that I want to save the data only from this new
schema and not from the whole database.

As far as I see the SCRIPT command uses the complete database. The
same for the BACKUP command. Any ideas how I solve my problem?

In MySQL it is possible to select the schema in the mysqldump util
(mysqldump <schemaname>).

Uli

Dario Fassi

unread,
Sep 20, 2010, 1:17:33 PM9/20/10
to h2-da...@googlegroups.com
Hi,
In older threads this feature was stated as very desirable for many reasons but mainly:

1) Export database DDL at: database, schema or table/view level with and without data (same actual SCRIPT options), like ddlexport utility in many dbms.
2) Custom export/import of database's sub-sets and partial database backups.

regards,
Dario.


El 20/09/10 08:29, Uli escribió:

Uli

unread,
Sep 21, 2010, 2:52:30 AM9/21/10
to H2 Database
Yeah that's really an important feature. Until this will be fixed I
have to create my own individual filtered SCRIPT functionality in my
application.

Uli

Thomas Mueller

unread,
Sep 24, 2010, 12:30:00 PM9/24/10
to h2-da...@googlegroups.com
Hi,

There is already a related feature request: "Option for SCRIPT to only
process one or a set of schemas or tables, and append to a file.". I
will increase the priority, however I will not have time to implement
it right now. Patches are always welcome!

Regards,
Thomas

Jacob Qvortrup

unread,
May 15, 2012, 8:06:55 AM5/15/12
to h2-da...@googlegroups.com
Hi.

I had the same problem as Uli, so i have made a patch that adds the two selection filters TABLE and SCHEMA to the SCRIPT SQL action. I am not able to complete all the steps in the "submit patch" guide (as explained in another post in the group) so any formatting issues will have to be sorted out. Please have a look and reply any comments.

/Jacob
script_schema_table.patch

Noel Grandin

unread,
May 16, 2012, 6:07:35 AM5/16/12
to h2-da...@googlegroups.com, Jacob Qvortrup
Thanks, committed with these changes:
- added changelog.html entry
- updated grammar and documentation in help.csv

Please confirm that this is contributed under the H2 license.
> --
> You received this message because you are subscribed to the Google
> Groups "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/jsKZf5EWCN8J.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.

Jacob Qvortrup

unread,
May 16, 2012, 6:53:40 AM5/16/12
to h2-da...@googlegroups.com, Jacob Qvortrup
I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the H2 License, version 1.0, and under the Eclipse Public License, version 1.0 (http://h2database.com/html/license.html)

/Jacob

Noel Grandin

unread,
May 16, 2012, 6:54:05 AM5/16/12
to Jacob Qvortrup, h2-da...@googlegroups.com
Thanks Jacob.

Forwarding to mailing list so we have a permanent record.

On 2012-05-16 12:42, Jacob Qvortrup wrote:
Hi Noel

I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the H2 License, version 1.0, and under the Eclipse Public License, version 1.0 (http://h2database.com/html/license.html)

V.h
Jacob Qvortrup

-- 
Jacob Qvortrup, Software Developer, M.Sci.
Arosii Information Systems A/S - http://www.arosii.dk

Mail:    j...@arosii.dk
Mobile:  +45 26 83 82 37

Noel Grandin

unread,
May 16, 2012, 7:45:56 AM5/16/12
to h2-da...@googlegroups.com, Jacob Qvortrup
Note that as per Thomas Muellers' suggestion, I have changed the syntax to not use brackets, since that is more in keeping with the general style of other SQL commands.
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/bPqTjvkQW_EJ.
Reply all
Reply to author
Forward
0 new messages