Either edit the script to remove the part that creates the SA user, or create a database using a username that is not in the script.
On Thu, Jul 9, 2015 at 5:07 PM, <[email protected]> wrote: > Long shot that this will get a reply, but I'm having an issue recovering a > corrupted database. I'm running into the created by SA problem where CREATE > USER SA fails on running the sql with Runscript. I see the explanation, but > I don't understand what "Consider running the script against a database that > was created with a user name that is not in the script." actually means. Do > I create a new database with the same name as the one I tried to recover > manually with a different user and then try to run the script against it? > > Thanks, > Alex > > On Monday, May 25, 2009 at 2:59:19 PM UTC-4, Thomas Mueller wrote: >> >> Hi, >> >> I suggest to upgrade to a newer version of H2. In version 1.1.108, a >> bug was fixed that could cause data corruption (see also >> http://www.h2database.com/html/changelog.html "When the shutdown hook >> closed the database, the last log file was deleted too early. This >> could cause uncommitted changes to be persisted. In some cases, this >> could cause data corruption."). >> >> You are right, the recovery tool create the foreign keys before >> inserting data. This doesn't work in some cases. I will fix this >> problem in the next release. >> >> > It also fails trying to add the "sa" user, which I also think is a bug. >> >> This is documented at >> http://www.h2database.com/html/advanced.html#using_recover_tool : "If >> you run the script against a database that was created with the same >> user, or if there are conflicting users, running the script will fail. >> Consider running the script against a database that was created with a >> user name that is not in the script." >> >> Regards, >> Thomas >> >> 2009/5/25 MarĂa Arias de Reyna <[email protected]>: >> > >> >> If I run the recovery tool and then >> >> do a runscript, the database will be recovered? >> > >> > Anyway, I tried this and the recovery tool doesn't work well. It >> > extracts the data on a wrong order, making the runscript fail because >> > it tries to add data before the foreign keys are fully inserted on >> > their referenced tables. >> > >> > Table A has a foreign key referencing Table B >> > The RunScript tries to add the data on table A before adding the data >> > on table B, so it fails (the foreign key doesn't have a proper >> > reference). >> > > >> > > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
