|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Need help with restoring from bak
Hi folks,Imperial, Robert 07/03/08 12:56 P Imperial, Robert wrote:Jochem van Dieten 07/03/08 02:36 P Thanks for the quick reply Jochem, but after trying to run the following IBob Imperial 07/03/08 03:06 P > Thanks for the quick reply Jochem, but after trying to runDave Watts 07/03/08 03:26 P Thanks for the heads up Dave, now that I've take care of that I have aImperial, Robert 07/03/08 03:54 P Ok it's late in the day and I've obviously overlooked the obvious hereImperial, Robert 07/03/08 04:12 P > Thanks for the heads up Dave, now that I've take care of thatDave Watts 07/03/08 04:26 P 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 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 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 > 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! 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 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 ----- 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!
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||