Home > Archive > SQL Anywhere database > October 2005 > problem when recovering









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem when recovering
zs

2005-10-27, 7:41 am

hi people,
I'm trying to recover my anywhere server with this:
<
string ls_sql, ls_err

ls_sql = "restore database 'c:\\data\\sys2.db' from
'c:\\data\\backup\\s
ysbak2.db'"
execute immediate :ls_sql using sqlca;
if sqlca.sqlcode <> 0 then
ls_err = string(sqlca.sqlcode)+sqlca.sqlerrtext + string(sqlca.sqldbcode)
rollback;
end if
>


it turns out "-1

SQLSTATE = 08001

[Sybase][ODBC Driver][Adaptive Server Anywhere]Unable to connect to database
server: Database name not unique-77"

any ideas?
TIA


Chris Keating(iAnywhere Solutions)

2005-10-27, 7:41 am

Do you have a running database engine that is hosting a database named
'syb2'?
--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

********************
********************
********************
*****************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

********************
********************
********************
*****************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

********************
********************
********************
*****************
Breck Carter [TeamSybase]

2005-10-27, 7:41 am

What database are you *connected* to? I don't think it can be the one
you are trying to restore.

On 25 Oct 2005 21:04:19 -0700, "zs" <q2dm1@sina.com> wrote:

>hi people,
> I'm trying to recover my anywhere server with this:
><
>string ls_sql, ls_err
>
>ls_sql = "restore database 'c:\\data\\sys2.db' from
> 'c:\\data\\backup\\s
ysbak2.db'"
>execute immediate :ls_sql using sqlca;
>if sqlca.sqlcode <> 0 then
> ls_err = string(sqlca.sqlcode)+sqlca.sqlerrtext + string(sqlca.sqldbcode)
> rollback;
>end if
>
>it turns out "-1
>
>SQLSTATE = 08001
>
>[Sybase][ODBC Driver][Adaptive Server Anywhere]Unable to connect to database
>server: Database name not unique-77"
>
>any ideas?
>TIA
>


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
zs

2005-10-27, 7:41 am

well,
the 'sys2.db' is up as server(server name is 'sys2') I've had a backup
by using 'dbbackup' utility. just wondering how to recover it from the
backup file on the fly, is it possible? thanks again.


Chris Keating(iAnywhere Solutions)

2005-10-27, 7:41 am

Have you tried stopping that engine (and the database that it is hosting)?
--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

********************
********************
********************
*****************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

********************
********************
********************
*****************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use Case Express to report bugs http://case-express.sybase.com

********************
********************
********************
*****************
Greg Fenton

2005-10-27, 7:41 am

zs wrote:
> well,
> the 'sys2.db' is up as server(server name is 'sys2') I've had a backup
> by using 'dbbackup' utility. just wondering how to recover it from the
> backup file on the fly, is it possible? thanks again.


You haven't specified which version and build number of SQLAnywhere you
are using.

Can you describe what you mean by "recover on the fly"?
Are you attempting to have as small a downtime as possible?
Have you looked at the Live Backup feature?

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Bruce Hay

2005-10-27, 9:23 am

If you created the backup with DBBACKUP, then the backup copy is an "image"
backup, i.e. it is essentially a file copy of the original database. The
RESTORE DATABASE statement is meant to be used with an "archive" backup,
created with "BACKUP DATABASE TO ...".

To restore an image backup, you simply copy the backup file(s) to your
working directory and start the database.

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

"zs" <q2dm1@sina.com> wrote in message news:43602729$1@foru
ms-1-dub...
> well,
> the 'sys2.db' is up as server(server name is 'sys2') I've had a

backup
> by using 'dbbackup' utility. just wondering how to recover it from the
> backup file on the fly, is it possible? thanks again.
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com