July 2011 Entries

If you aren't sure what is actually in the backup file, or even if you think you are sure--execute this statement from a fresh query window:

RESTORE FILELISTONLY
FROM DISK = 'X:\MDD\Clients\Lg\H4\H4L.bak'

 The information about the mdf/ldf files will show up looking like this:

 

In this example, I was restoring a database to a different server with different filegroups, directory setups, etc.--so I had to 'MOVE' the location paths to represent the drives I had available. If I were restoring to the same location, I would NOT have needed the 'MOVE' condition. BTW, this assumes you are restoring from a full backup--and that the database already exists.  If this isn't your case, go to SQL Server Books Online for more information about your combination of circumstances.

-- Look before you leap to be sure you know what you have.

restore filelistonly
 from disk = 'e:\backups\MetroDesign.bak'
 
-- Dump everyone off of the database

ALTER DATABASE [MetroDesign] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

-- We are asking SQL Server to replace what is there and to place specific files to a new location

 RESTORE DATABASE MetroDesign
  FROM DISK =  'e:\backups\MetroDesign.bak'
   WITH REPLACE,MOVE 'MetroDesign' TO 'e:\sql\data\mdf\MetroDesign.mdf',
   MOVE 'MetroDesign_log' TO 'l:\sql\data\ldf\MetroDesign_log.ldf'

    
-- Allow users back on to the database when through with the backup.

ALTER DATABASE [MetroDesign] SET MULTI_USER WITH NO_WAIT


Posted On Monday, July 11, 2011 7:34 PM | Comments (0)
Filed Under [ SQL ]

The message may also say something line:

Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=metro-stockwatch&version=1&
409 Conflict

Another transaction by user Your.Name is already in progress for app: your-appName, version: x. That user can undo the transaction with "appcfg rollback".

Basically this means that in the midst of your previous deployment of the application, the process was interrupted. The Google SDK interprets this as a deployment that must be rolled back. There is no resolution to this without locating where your \bin directory containing the appcfg.sh or appcfg.cmd file exists in order to rollback the corrupt deployment.

Since I was working on a windows box when this happened to me, here is where I found the appcfg.cmd file:

C:\Program Files\Eclipse\eclipse\plugins\com.google.appengine.eclipse.sdkbundle.1.3.8_1.3.8.v201010161055\appengine-java-sdk-1.3.8\bin\

Look for your application--more specfically, look for a directory called WEB-INF. In my app, WEB-INF resides under the \war directory. Here it is as an example:

C:\Documents and Settings\Administrator\workspace\StockWatcher\war

Open up a windows command window or execute cmd from Run (Start>All Programs; Run; type: cmd).  Execute the command:  appcfg rollback your-appName by wrapping the location of where the appcfg.cmd file exists, and wrapping the location of root of where you found the WEB-INF directory. This should correct your  previously corrupt deployment. See the screenshot below as an example of the command line and of the expected message displays. BTW, if you don't work with dos windows much, remember to include the quotation marks "" as you see them. Windows needs the quote to deal with "Documents and Settings" and "Program Files". If you forget the quotation marks, you may see an error message that indicates a file or directory is not found.

 Eclipse Google App SDK deployment