Monday, March 26, 2012
Restoring SQLServer 7 backup to MSDE
backup the data and resrote it at the client's running MSDE. When
restoring the backup to MSDE I get this message from SQL-DMO:
Location:upgraddb.cpp:214
Instruction:tableIndex < ARRAY_LEN(upgradeMap)
I've tried it with two backups, one of a 40+ table database and one
with 3 tables, and get the same message both times.
Do you know what this means and how to work around it? Thanks.
hi Larry,
"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
news:095do0da3qccc93i4c59mmc396akdd9tbh@.4ax.com
> I want to develop an app on my computer running SQLServer 7, then
> backup the data and resrote it at the client's running MSDE. When
> restoring the backup to MSDE I get this message from SQL-DMO:
> Location: upgraddb.cpp:214
> Instruction: tableIndex < ARRAY_LEN(upgradeMap)
> I've tried it with two backups, one of a 40+ table database and one
> with 3 tables, and get the same message both times.
> Do you know what this means and how to work around it? Thanks.
you should get that exception when restoring SQL Server/MSDE 2000 databases
on SQL Server 7.0 servers..
you can restore on version 2000 from version 7.0, but not the contrary
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||You indicate I can restore a SQLServer 7.0 backup to an MSDE 2000
database, but that is where I'm getting the error. Am I reading your
reply wrong?
The bigger problem seems to be developing on my computer with
SQLServer 7.0 while my clients are using MSDE. I need to be able to
move the data back and forth easily but it sounds like that's not
really possible. Since I can't (I dont' think) run both SQLServer 7.0
and MSDE on the same machine, it looks like that development concept
won't work. Is that correct, or am I missing something?
On Mon, 1 Nov 2004 21:55:44 +0100, "Andrea Montanari"
<andrea.sqlDMO@.virgilio.it> wrote:
>hi Larry,
>"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
>news:095do0da3qccc93i4c59mmc396akdd9tbh@.4ax.com
>you should get that exception when restoring SQL Server/MSDE 2000 databases
>on SQL Server 7.0 servers..
>you can restore on version 2000 from version 7.0, but not the contrary
|||hi Larry,
"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
news:nabfo0l29tk7i9bhaa0ndsbktgki3nf9s0@.4ax.com
> ...
> The bigger problem seems to be developing on my computer with
> SQLServer 7.0 while my clients are using MSDE. I need to be able to
> move the data back and forth easily but it sounds like that's not
> really possible. Since I can't (I dont' think) run both SQLServer 7.0
> and MSDE on the same machine, it looks like that development concept
> won't work. Is that correct, or am I missing something?
actually you can... you can have a "default" SQL Server 7.0 instance and a
SQL Server 2000 named instance on the same pc..
keep in mind that, if you only install MSDE 2000 named instance side by side
a SQL Server 7.0 instance, you won't be able to use the SQL Server 7.0
client tools, as MSDE only installs "part of" them, that's to say the type
lybs, dlls, COM dependencies and so on, but not the tools (Enterprise
Manager, Profiler, Query Analyzer).. so you'll be stuck with no tool but
oSql.exe...
if you install SQL Server 2000, the newer tools (and realated dependencies)
will be able to manage SQL Server 7.0 ...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I have to apologize...I am running SQLServer 2000. Too much going on.
What difference does that make?
On Tue, 2 Nov 2004 17:55:36 +0100, "Andrea Montanari"
<andrea.sqlDMO@.virgilio.it> wrote:
>hi Larry,
>"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
>news:nabfo0l29tk7i9bhaa0ndsbktgki3nf9s0@.4ax.com
>actually you can... you can have a "default" SQL Server 7.0 instance and a
>SQL Server 2000 named instance on the same pc..
>keep in mind that, if you only install MSDE 2000 named instance side by side
>a SQL Server 7.0 instance, you won't be able to use the SQL Server 7.0
>client tools, as MSDE only installs "part of" them, that's to say the type
>lybs, dlls, COM dependencies and so on, but not the tools (Enterprise
>Manager, Profiler, Query Analyzer).. so you'll be stuck with no tool but
>oSql.exe...
>if you install SQL Server 2000, the newer tools (and realated dependencies)
>will be able to manage SQL Server 7.0 ...
|||hi Larry,
"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
news:7phgo0dtkn0rppaa0ee4nhjrv329n47500@.4ax.com
> I have to apologize...I am running SQLServer 2000. Too much going on.
> What difference does that make?
>
:D
ok... this sometimes occur when restoring database across servers that do
not share the same service pack level too..
I'd suggest to upgrade both (or all) servers instances to service pack 3..
please have a look at http://www.microsoft.com/sql/downloads/2000/sp3.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks very much. I'll be able to work on it Thursday and will let you
know the results.
On Wed, 3 Nov 2004 12:24:08 +0100, "Andrea Montanari"
<andrea.sqlDMO@.virgilio.it> wrote:
>hi Larry,
>"Larry Johnson" <larry@.gjerager.com> ha scritto nel messaggio
>news:7phgo0dtkn0rppaa0ee4nhjrv329n47500@.4ax.com
>:D
>ok... this sometimes occur when restoring database across servers that do
>not share the same service pack level too..
>I'd suggest to upgrade both (or all) servers instances to service pack 3..
>please have a look at http://www.microsoft.com/sql/downloads/2000/sp3.asp
|||Once I got the same versions installed the restore worked perfectly.
Thanks for the assistance.
Tuesday, March 20, 2012
Restoring multiple TRN files to another computer
periodically with transaction logs backed up every 5
minutes. In the event that I need to restore the backup
and apply a large number of TRN files on another computer
(for example if the server dies), is there an easy way?
If I do the restore on the original server, the interface
is easy because it knows about all the recent backups,
but when I do the restore to another server, the backups
are not listed in the interface so it seems I have to
choose "restore from device" and then select the backup
file and each TRN file individually which is very tedious.
Rick Harrison.In EM 2000, you can generate backup history from the contents of the backup
device. I've never used it (I prefer to do RESTORE though TSQL command), but
my guess that the feature was put there for this type of situations.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"rick@.knowware.com" <anonymous@.discussions.microsoft.com> wrote in message
news:0bd901c3bb52$2cbc0da0$a501280a@.phx.gbl...
> I have a backup process that does full backups
> periodically with transaction logs backed up every 5
> minutes. In the event that I need to restore the backup
> and apply a large number of TRN files on another computer
> (for example if the server dies), is there an easy way?
> If I do the restore on the original server, the interface
> is easy because it knows about all the recent backups,
> but when I do the restore to another server, the backups
> are not listed in the interface so it seems I have to
> choose "restore from device" and then select the backup
> file and each TRN file individually which is very tedious.
> Rick Harrison.|||We recently recovered from a total disk array failure to
another SQL server. We were fortunate enough to have all
the .BAK & .TRN files on tape. But without a little
program I wrote to automate the restore, it would have
taken an unreasonable amount of time to apply each TLog
using the GUI.
If you're interested, I can send you some VB code. It
uses the SQL DMO objects to restore DB's & files. I still
need to finalize some things, because I had to step
through the code & make minor adjustments to restore
everything. But I'm supposed to finalize the tool soon.
If you have VB knowledge, or someone at your company does,
you could take what I have now & make alterations to suit
your needs. Just let me know,
Gene Daigle
>--Original Message--
>I have a backup process that does full backups
>periodically with transaction logs backed up every 5
>minutes. In the event that I need to restore the backup
>and apply a large number of TRN files on another computer
>(for example if the server dies), is there an easy way?
>If I do the restore on the original server, the interface
>is easy because it knows about all the recent backups,
>but when I do the restore to another server, the backups
>are not listed in the interface so it seems I have to
>choose "restore from device" and then select the backup
>file and each TRN file individually which is very tedious.
> Rick Harrison.
>.
>
Saturday, February 25, 2012
restoring db from web applications..
i am a computer sciences engineering student and and we have an assignment to create a web project with a database.
Our lecturers will store our submissions on a db server but they want our projects enable the restoring our own databases..
that is, they wanna be able to have a copy of our databases to a new db that they have just created.. and they want us to enable this feature in an install.aspx page in our project.. the new db is guaranteed that will have the same name as ours..
so now what i am supposed to include in install.aspx?
Hey,
What database type are we talking about, Oracle, SQL Server, etc?
|||the database type is SQL Server 2005 database.. .. and the project is a Visual Studio 2005 ASp .NET 2.0 web application..
|||Hey,
Look at the SMO API, which does have the ability to backup and restore. You can find plenty of resources on the web. Is it SQL 2005 or SQL Express? I don't know if you can with Express...
|||it is SQL Express ...|||Hey,
I did find something that used SMO API with SQL Express.
Brian
restoring databse
I've tried to restore my database from other computer. I have my database
backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
I've made backup on has name SKLEP\INSERTGT, the one I want to restore data
on-DOM\INSERTGT. While restoring occurs an error "The backu set holds a
backup of a database other than existing 'sklepdata' database".
Now, what should I do to restore data from this file .bak?
Thanks and regards,
Mike.Hi Mike,
This error occurs because the media (the bfk file) you want to restore
doesn't match the existing database. So you can :
1 - Delete the existing database before doing it
2 - Do it in T-SQL and use the REPLACE option of the RESTORE command
3 - Check the 'Overwrite the existing database' parameter (options)
I guess you'll use the third one...
jacek wrote :
> Hi,
> I've tried to restore my database from other computer. I have my database
> backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> I've made backup on has name SKLEP\INSERTGT, the one I want to restore data
> on-DOM\INSERTGT. While restoring occurs an error "The backu set holds a
> backup of a database other than existing 'sklepdata' database".
> Now, what should I do to restore data from this file .bak?
> Thanks and regards,
> Mike.
>|||Since the backup was taken on a different server and the target databases
exists, you need to specify the "overwrite the existing database" option.
This corresponds to the WITH REPLACE option of the RESTORE DATABASE command.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"jacek" <jacek@.o.pl> wrote in message
news:fd3cou$sg2$1@.nemesis.news.tpi.pl...
> Hi,
> I've tried to restore my database from other computer. I have my database
> backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> I've made backup on has name SKLEP\INSERTGT, the one I want to restore
> data on-DOM\INSERTGT. While restoring occurs an error "The backu set holds
> a backup of a database other than existing 'sklepdata' database".
> Now, what should I do to restore data from this file .bak?
> Thanks and regards,
> Mike.
>|||> This error occurs because the media (the bfk file) you want to restore
> doesn't match the existing database. So you can :
> 1 - Delete the existing database before doing it
> 2 - Do it in T-SQL and use the REPLACE option of the RESTORE command
> 3 - Check the 'Overwrite the existing database' parameter (options)
> I guess you'll use the third one...
Heh... I was so easy... I'm dumb;)
Thanks mate!|||Hi, I got the same problem .Here is the solution i found You have to
specify the "overwrite the existing database" option and Set the Database
files(mdf and _Log.ldf properly) by Restore as Column and click ok.
To set Mdf and _log.ldf files
1. Click Browser button provided with Columns Original File Name and Restore
as .
Regards,
Malini Jain
"Dan Guzman" wrote:
> Since the backup was taken on a different server and the target databases
> exists, you need to specify the "overwrite the existing database" option.
> This corresponds to the WITH REPLACE option of the RESTORE DATABASE command.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "jacek" <jacek@.o.pl> wrote in message
> news:fd3cou$sg2$1@.nemesis.news.tpi.pl...
> > Hi,
> > I've tried to restore my database from other computer. I have my database
> > backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> > I've made backup on has name SKLEP\INSERTGT, the one I want to restore
> > data on-DOM\INSERTGT. While restoring occurs an error "The backu set holds
> > a backup of a database other than existing 'sklepdata' database".
> > Now, what should I do to restore data from this file .bak?
> > Thanks and regards,
> > Mike.
> >
>
Tuesday, February 21, 2012
Restoring Database using SQL-DMO gives me an error on another DB Server
Exclusive access could not be obtained. Database is in use.
Do I have to do anything in particular? Here is my snippet of code (VB.net). Thanks.
Dim my_srv As SQLDMO._SQLServer = New SQLDMO.SQLServerClass
my_srv.Connect(my_config.get_ServerName(), my_config.get_DBUserID(), my_config.get_Password)
'COPY FILE TO SPECIFIC DIRECTORY ON SERVER
Dim my_file As File
my_file.Copy(Me.txtFilePath.Text, "\\" + my_config.get_ServerName + my_config.get_backupfolder_string + "tempcas.bak")
Dim my_restore As SQLDMO.Restore = New SQLDMO.RestoreClass
'my_restore.Devices = my_restore.Files
my_restore.Action = SQLDMO_RESTORE_TYPE.SQLDMORestore_Database
my_restore.Files = "[" & my_config.get_backupdrive_string & my_config.get_backupfolder_string & "tempcas.bak]"
my_restore.Database = my_config.get_Database()
my_restore.ReplaceDatabase = True
my_restore.SQLRestore(my_srv)
MsgBox("Database restored successfully.", MsgBoxStyle.Information)
'DELETE TEMP FILE FROM SPECIFIC DIRECTORY ON SERVER
my_file.Delete("\\" + my_config.get_ServerName + my_config.get_backupfolder_string + "tempcas.bak")Make sure you are not using the same database which using the DMO script.
Try using MASTER database instead.|||Hi, sorry, I'm not following you. Could you elaborate more?
Thanks!|||When you connect, what is the database you are connecting to ?|||I'm connecting to a database named CAS. Anyway the database name would vary on what I have set in an xml file. As you can see from my code, I am getting the database name from a class.
I've found that it is because my query analyser is open and pointed to CAS, this causes a process to be created. I can see this process with a status RUNNABLE, dbName CAS and program name SQL Query Analyser when I run sp_who2. When I change query analyzer to point to another database, this process will disappear and I would be able to restore my CAS database.
Is this what you were trying to tell me? Thanks for your replies.
I am now concerned about what would happen if there are multiple users using the application.