on 2025 Jan 27 10:22 AM
Dear Colleagues!
I restored to new space database SQL Anywhere with RENAME clause pointing out to new dbspace example:
RESTORE DATABASE '/new place/restored.db' FROM '/old place/backup.01'
RENAME extra to '/new place/extra.db' RENAME extra2 to '/new place/extra2.db' RENAME extra3 to '/new place/extra3.db' RENAME msg to '/new place/msg.db'
After restore I'm trying to start new database server and I'm getting error message
I. 01/27 08:57:04. Opening dbspace 'extra' in file '/old_place/extra.db' for database 'verif_test_restored'
I. 01/27 08:57:04. Opening dbspace 'extra2' in file '/old_place/extra2.db' for database 'verif_test_restored'
In other words -> system is looking to old DB Space even-though RENAME clause was used
Can you, please, help me with my problem?
Request clarification before answering.
Some things to consider
I would likely use, where ENG is a unique server name on the machine running the restore. This will autostart the personal server.
dbisql -nogui -c "UID=dba;PWD=password;ENG=MyBURestore;DBN=utility_db" /restore_files/restore.sql
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Chris!
Thanks for your answer!
Let me comment your considerations.
Consideration #1.
That's why I use different naming conventions. I can share my experience that I managed to restore database on similar server while running another database, the only difference was in successful case - there was only one database file. And there is business requirement to implement my use-case, I mean not to stop running database server.
Consideration #2.
It is the same machine. So the requirement is restoring with such set up
Feel free to provide reasons why "a_restore" error message can appear
Thanks!
You glossed over the details of the "a_restore" error. As I noted, this is a temporary connection that is used during the restore. It may be related to some of the usage issues for the RESTORE. I do not think it is critical in explaining the issue.
During the restore process, the SYSTEM dbspace is loaded on the server performing the restore. If you are already running the "old" SYSTEM dbspace, the restore cannot load the restored SYSTEM dbspace because each database name must be unique and I do not see a way to make that happen with a restore. I do not think that the SYSTEM dbspace can be renamed during the RESTORE. Doing so, the error -717 RESTORE unable to open file %1 is reported. You may be able to provide a distinct database name to the source database so that when the restored database is loaded, the database name will not be in conflict. I suspect that you are simply relying on the default naming rules. i.e., dbsrv17 -n MyServ c:\myPath\MyDatase.db will use the default database name which is the file without pathing and extension or in this case MyDatabase. Instead, you can explicitly name the database dbsrv17 -n MyServ c:\myPath\MyDatabase.db -n MyExplicitDBN.
I have misspoke as you only need the -gu option as its scope is limited to the utility_db. The -gd defines the rule for any connection. The -gu option is required when running a network server and you want to start a database on it.
Hello, Chris!
Thanks for providing the reply
Two comments from my side:
Comment #1.
Comment #2. I'm trying to understand what "a_restore" means -> because it looks like this error happens after restore is completed and database server is trying to complete it.
My next steps will be - Stop database server which is running and try to run my restore with changing file names
Hello, Colleagues!
Maybe it makes sense to register my use-case as the valid use-case for the database management, and implement improvement if there is no solution for it.
As I'm following manual and it looks like current version of restore process doesn't support it!
Thanks!
SAP SQL Anywhere
You cannot perform the restore on the same database server where the source database is currently running. You either need to stop the source database -or- run a different engine during the restore. in short, if you are restoring a database from backup, the source database would be expected to be in a bad state and not be running. There are viable ways to achieve your requirements in the existing implementation, either archive or the more modern image backup methods.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.