House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 03, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home /  Groups /  ColdFusion Talk (CF-Talk)

Need help with restoring from bak

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Imperial, Robert
07/03/2008 12:56 PM

Hi folks, Scrambling here trying to restore a db on a ms sql server and cannot connect with Enterprise Manager (another story). Is there a command line utility out there anywhere that will let me restore a db from a .bak file on a windows box? Or is there a way to do this from a CF query? TIA Bob

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jochem van Dieten
07/03/2008 02:36 PM

Imperial, Robert wrote: > Scrambling here trying to restore a db on a ms sql server and cannot > connect with Enterprise Manager (another story). Is there a command line > utility out there anywhere that will let me restore a db from a .bak > file on a windows box? Or is there a way to do this from a CF query? TIA <cfquery ...> RESTORE DATABASE [database_name] FROM  DISK = N'path_to_full_backup_file' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10 </cfquery> Make sure you connect to a database that is not the one you are trying to restore. Jochem

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bob Imperial
07/03/2008 03:06 PM

Thanks for the quick reply Jochem, but after trying to run the following I get an error(see below) <cfquery name="dorestore" datasource="grandRounds"> RESTORE DATABASE [DCCRegistry] FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\DCCRegistry_db_200806110200.BAK' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10 </cfquery> Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. The error occurred in D:\WebNew\centers\dump.cfm: line 1 1 : <cfquery name="dorestore" datasource="grandRounds"> 2 : RESTORE DATABASE [DCCRegistry] 3 : FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\DCCRegistry_db_200806110200.BAK' Don't know if it makes any difference here but this MSSQL Server 2k and running CF Standard 7,0,2,142559 Any ideas? Bewildered Bob Imperial, Robert wrote: > Scrambling here trying to restore a db on a ms sql server and cannot > connect with Enterprise Manager (another story). Is there a command line > utility out there anywhere that will let me restore a db from a .bak > file on a windows box? Or is there a way to do this from a CF query? TIA <cfquery ...> RESTORE DATABASE [database_name] FROM  DISK = N'path_to_full_backup_file' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10 </cfquery> Make sure you connect to a database that is not the one you are trying to restore. Jochem

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
07/03/2008 03:26 PM

> Thanks for the quick reply Jochem, but after trying to run > the following I get an error(see below) > > ... > > Invalid SQL statement; expected 'DELETE', 'INSERT', > 'PROCEDURE', 'SELECT', or 'UPDATE'. You need to make sure your CF datasource allows the operation. This is in your datasource settings within the CF Administrator. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Imperial, Robert
07/03/2008 03:54 PM

Thanks for the heads up Dave, now that I've take care of that I have a new error. Progress I guess :) now I get  [Macromedia][SQLServer JDBC Driver][SQLServer]Exclusive access could not be obtained because the database is in use.  I'm a little confused here, is the reference in the error to the db I am attempting use to initiate the connection with, or the db I am trying to restore? As far as I can see the db I'm using here to initiate the connection is not being used by anybody at the moment. Bob

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Imperial, Robert
07/03/2008 04:12 PM

Ok it's late in the day and I've obviously overlooked the obvious here :) I was trying to run this query via https and this box had a selSSL cert installed on it, which is what was giving me trouble connecting via the Enterprise Manager. I'll deal with that later but at least the RESTORE ran under http. Thanks again Jochem and Dave. By the way Dave, I haven't had the chance to work with anything I picked up in your class last week. Cam back and as always after a week away, the to-do-list was a mile long. Bob Imperial Thanks for the heads up Dave, now that I've take care of that I have a new error. Progress I guess :) now I get  [Macromedia][SQLServer JDBC Driver][SQLServer]Exclusive access could not be obtained because the database is in use.  I'm a little confused here, is the reference in the error to the db I am attempting use to initiate the connection with, or the db I am trying to restore? As far as I can see the db I'm using here to initiate the connection is not being used by anybody at the moment. Bob

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
07/03/2008 04:26 PM

----- Excess quoted text cut - see Original Post for more ----- Are you using a datasource which points to the empty database in which you're trying to restore? That might cause a problem. I'll qualify this by saying I've never tried to restore a database from CF. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information!


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists