.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
ASPEvil
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Post New Web Links

Restore a DB in new DB server and have problems with Master Key

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server
 

Hello,

 

I recently start in new job here decide to move all database from different servers to a new db server.  The previously person was working here doesn't documented any password was used for the master keys in the multiples db servers. It is possible to recover, restore, change or do something with the master keys?

 

When I restore a database using backup method or attach I get the following error:

Msg 15581, Level 16, State 3, Line 4

Please create a master key in the database or open the master key in the session before performing this operation.

I really appreciate any help, suggestion to complete this task as soon as possible. 

 

Thanks,




View Complete Post


More Related Resource Links

SQL Server Backup and Restore (video)

  
Restore your full backup, then run a few queries before you keep restoring transaction logs. Brent shows how to use the Standby option for restores.

In this five minute video, Brent demonstrates how to do it by creating a database, populating data, and then showing what disaster recovery is like by doing RESTORE WITH STANDBY.

Problems building 32-bit .NETapplication that uses 64-bit COM server

  
I have a .NET application that uses a 3rd party 32bit DLL, so I need to build it using the x86 platform instead of 'Any CPU'. I also have a 64bit out-of-proc COM server that I reference the EXE directly in the project.  The project builds fine for 'Any CPU' but can't run on 64bit Windows because of the 32-bit dll.  This is expected.  But when I specify 'x86' the build fails and I get: TlbImp : error TI0000: A single valid machine type compatible with the input type library must be specified. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1558,9): warning MSB3283: Cannot find wrapper assembly for type library "Engine_ATLServiceLib". Basically this tells me that it failed to build the Interop Dll for the COM server object.  First off I am puzzled that I get this message when a platform is specified, I would've expected this when I build for 'Any CPU'.  That aside, I am thinking the TlbImp needs a '/Win32' or something, but I can't see how to do this in the IDE based on the platform.  Furthermore I am wondering if the marshalling in said Interop dll will be correct when the 32bit managed code talks with the 64bit COM object. Does anybody know what to do here?

Problems migrating 32-bit SQCLR routine to 64-bit SQL Server

  
Greetings. I have written a 32-bit SQLCLR routine that uses the 10.2g Oracle.DataAccess library to draw Oracle data through SQLServer queries. (This tool was necessary due to issues we had with the Oracle native client). This has been in place and working without issue for about two years. This tool required the independent registration of about six (?) other system assemblies, which worked without incident (various warnings about using unsupported assemblies aside). We use permission_set = unsafe for all these DLL's. We are now in the process of migrating this tool to the newer 64-bit version of SQL Server 2008 on our Windows 2008 Server R2, and we have a problem. We took our list of base assemblies from the 32-bit installation and registered them against the Framework64 version of the same DLL's on the SQL Server 2008 box, and that step worked. We found that the Oracle.DataAccess library we had could not be registered in the 64-bit SQL Server because it was an x86-specific version. We then discovered that the 64-bit version of the Oracle.DataAccess library was available only in the 10.2.0.4 update patchset, which we obtained and installed. Unfortunately, adding the assembly now fails: When I attempt the CreateAssembly on the 64-bit Oracle.DataAccess.dll within the 64-bit instance of SQL Server, I now receive a new error, to-wit: "Assembly '

Having problems installing/setting up SQL Server 2008 Express/R2 for ASP.NET user management on deve

  
I'm a bit new to installing and configuring, well, just about anything regarding databases, so please bear with me. I'm currently building a couple of ASP.NET MVC 2 sites.  I'm following along with the MVCMusicStore tutorial, and am trying to set up user management using ASP.NET's configuration tool.  The problem is that ASP.NET can't 'see' the database. I have SQL Server 2008 installed on my laptop.  It's the version which is available on the Web Platform Installer (I believe it's Express).  When I try running the aspnet_sqlreg.exe program to set up my user management database, it can't tell that I'm running any version of SQL Server at all.  I get an exception about 'named pipes', and some other things I don't understand at the moment. Obviously, this is all a bit over my head.  Is there an idiot proof guide or tutorial available that describes, step-by-step, how to: 1. Install SQL Server 2008 on a development PC 2. How to configure it to be used by Visual Studio 2010 Professional 3. How to properly upload/modify the db on the production server with what's on the development PC Essentially, all the things that the ASP.NET tutorials gloss over.  Any suggestions, links to documentation, or other nudges in the right direction would be immensely appreciated.

Windows 7 CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 26

  
Hi I have migrated to a new computer using Windows 7, 6 gig memory, I7 chip (old machine had xp) and have installed Visual Studio 2008 and  SQL Server 2008 R2.  I get CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) when I try to create a new database.  Other posts (example:http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/28fee0ed-c7e2-40df-8f79-f513c9848f09/) work for Vista but I cannot find how to grant permissions.  Run as administrator (vista fix) does not work. I have admin privaleges on my machine.  There are no other accounts.    What do I need to do to update privaleges? Thanks and have a nice day.    

problems with using SQLEXPRESS database on a server

  
I made an application that reads a KML file every few minutes and puts the data in a SQLEXPRESS database. It works perfectly on my laptop, but when I move everything to the server where it has to run, the application doesn't find the database anymore. I tried lots of connectionstrings already, but none works. I have to admit that my knowledge of connectionstrings is not that big, so I think the answer will be very simple. In my program I point to the app.config file who looks like this atm (remember, I changed the connectionstring a couple of times already, and I have no idea anymore where I started): <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="ships" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\ftproot\eu006202\www.ortelius.icso.be\AIS\ships.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> </configuration> I pasted the error I get on http://www.webbouwers.be/error.png Any idea what I need to do to get it work? Thank you in advance, L.

Can't restore database backup file in my database ? using sql server 2005. please help

  
VERY IMPORTANT i am trying to restore database.bak in sql server 2005 (i know the database.bak was also generated in sql 2005 server) i am trying to restore back up database .bak into the new database i just created in sql server 2005 i have saved my database .bak into c drive and when i select database .bak "From Device", it doesn't get populated in the list below and i see nothing and it keeps on prompting a message "You must select a restore source" Here's the screen shot:   PLEASE HELP..it's really important (i tried restoring database in sql server 2008 and it was sucessful but i am facing this problem in sql server 2005 only)  

Backup SQL Server 2008 R2 Restore on SQL 2008

  
I have a SQL Server 2008 R2 instance that I need to backup and restore onto a SQL 2008 instance. When I attempt to restore the back up (.bak) database from the R2 SQL server onto the SQL 2008 server I get the following message: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.2531. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo) How can i backup the SQL 2008 R2 database to be compatible with SQL 2008?Ian Ceicys

I am getting some problems to install the sql server ....Plz help me,....

  
System Configuration Check - WMI Service Requirement (Success)  Messages  * WMI Service Requirement    * Check Passed   - MSXML Requirement (Success)  Messages  * MSXML Requirement    * Check Passed   - Operating System Minimum Level Requirement (Success)  Messages  * Operating System Minimum Level Requirement    * Check Passed   - Operating System Service Pack Level Requirement. (Success)  Messages  * Operating System Service Pack Level Requirement.    * Check Passed   - SQL Server Edition Operating System Compatibility (Success)  Messages  * SQL Server Edition Operating System Compatibility    * Check Passed   - Minimum Hardware Requirement (Success)  Messages  * Minimum Hardware Requirement    * Check Passed   - IIS Feature Requirement (Success)  Messages  * IIS Feature Requirement    * Check Passed   - Pending Reboot Requirement (Success)  Messages  * Pending Reboot Requirement    * Check Passed   - Performance Monitor Counter Requirement (Success)  Messages  * Performance Monitor Counter Requirement    * Check Passed   - Default Installation Path Permission Requirement (Success)  Messages  * Default Installation Path Permission Requirement &n

SQL Reporting Server connection problems?

  
I tried setting up SQL Server Reporting Services (per TFS Guide) and having issues connecting to the server. When i try to go to : http://MyyServer/Reports I get following error:   User 'MyServer\Admin' does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed. When i try to go to: Http://MyServer/ReportServer i get the folowing error: The permissions granted to user 'MyServer\Admin' are insufficient for performing this operation. (rsAccessDenied)  I get a login dialog when i try to connect and i always use the machine admin/SQL Server sysadmin account I have of course searched on this problem and found a variety of blogs but none of them have resolved my problem. For example i tried to run IE in admin privileges and i still get the same error. I've try to uninstall/reinstall (even deleted sql server directories to make sure there was no cruft left over) and it didn't help. I don't know exactly how the http connections to reporting server happen but i tried to go into IIS expecting some reporting services virtual folders or something like that and i don't see anything. 

Problems with linked server to Analysis Services (SQL 2008)

  
I have problem with creating linked server from SQL database to Analsis services. BOth services are running on same machine. Operating system is Windows 2008. I create linked server (I use windows authentication and I am administrator on AS):  EXEC sp_addlinkedserver @server= 'OLAP_PRETOKI', @srvproduct = '', @provider='MSOLAP', @datasrc='localhost', @catalog='DWDatabase'  But when I try to test connection I get error (in the event log) and in the error log/dump I get this: 2010-09-03 13:48:28.41 Server Error: 17310, Severity: 20, State: 1. 2010-09-03 13:48:28.41 Server A user request from the session with SPID 57 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory. 2010-09-03 13:48:32.53 spid58 Open of fault log C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\log\exception.log failed. 2010-09-03 13:48:32.65 spid58 Using 'dbghelp.dll' version '4.0.5' 2010-09-03 13:48:32.66 spid58 SqlDumpExceptionHandler: Process 58 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. 2010-09-03 13:48:32.66 spid58 * ******************************************************************************* 2010-09-03 13:48:32.66 spid58 * 2010-09-03 13:48:32.66 spid58 * BEGIN STACK DUMP: 2010-09-03 13:4

Problems with linked server to Analysis Services (SQL 2008)

  
I have problem with creating linked server from SQL database to Analsis services. BOth services are running on same machine. Operating system is Windows 2008. I create linked server (I use windows authentication and I am administrator on AS):  EXEC sp_addlinkedserver @server= 'OLAP_PRETOKI', @srvproduct = '', @provider='MSOLAP', @datasrc='localhost', @catalog='DWDatabase'  But when I try to test connection I get error (in the event log) and in the error log/dump I get this: 2010-09-03 13:48:28.41 Server Error: 17310, Severity: 20, State: 1. 2010-09-03 13:48:28.41 Server A user request from the session with SPID 57 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory. 2010-09-03 13:48:32.53 spid58 Open of fault log C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\log\exception.log failed. 2010-09-03 13:48:32.65 spid58 Using 'dbghelp.dll' version '4.0.5' 2010-09-03 13:48:32.66 spid58 SqlDumpExceptionHandler: Process 58 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. 2010-09-03 13:48:32.66 spid58 * ******************************************************************************* 2010-09-03 13:48:32.66 spid58 * 2010-09-03 13:48:32.66 spid58 * BEGIN STACK DUMP: 2010-09-03 13:4

SQL Server database restore with multiple logicalfiles by using t-sql

  
Hi,   I have set of database backups created in the production sql server 2005. I need restore these backups into another sql server 2005 by using t-sql script(stored procedure). Each database will have different number of logical files in it. The physical location of the target server may be different for these logical files. I know that i should use WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf' clause. Now i want to know how would i put it in a t-script stored procedure such a way that it automatically identifies all the logical files and create a physical file on the target server. User will supply source of bakup file and target folder for mdf,ldf, etc files. Do i need to populate the sql query as string by looping through all the logical files? If so how would i execute the populated sql query as string ?  Mr Genius

Problems with SSRS 2008 Install when configuring a back-end database on a SQL Server 2008 R2 environ

  
We are tyring to configure SQL Server Reporting Services (SSRS 2008) not the R2 version with a SQL Server 2008 R2 version of database. We are facing error when the configuration manager within SSRS tries to execute its scripts against the database. Do you think that SSRS 2008 may have trouble using a SQL Server 2008 R2 version as the back-end? Also, what kind of permissions does the ID installing SSRS needs to have on the SQL Server database ?  Not much is available in the documenation or online.

Problems with url rewriting when using the ASP.NET development server

  
I've inherited a website which has been developed for IIS server. The hyperlinks in this website have a href attribute with the human readable form that appears in the url in the browser's searchbar. In Application_BeginRequest(), there is a method which will convert this into the acutal location of the page within the website's file structure.This works fine when running the website on IIS. However, when I am using the ASP.NET development server, the links do not work and I get a page not found error.I have noticed that Application_BeginRequest() is never called for the links when run using the ASP.NET development server. I have read that the ASP.NET development server will not serve pages that are outside of the application scope (http://msdn.microsoft.com/en-us/library/58wxa9w5%28VS.80%29.aspx), as the human-readable urls would appear to be when first processed by the server.Bear in mind that the urls in the aspx files are in human readable form, so I can't just use ResolveUrl(), because they don't correspond to files in the internal file structure until they have been re-written.I want to get the website running on the ASP.NET development server so that I can test it locally on my machine, which I can't really do if I can't get the url re-writing to work. Is there a way around this problem?

SQL Server 2005 Installation problems

  
I have SQL Server 2005 Developer Edition 9.00 1399.06 running on Windows XP.  I have upgraded to a Windows 7 64-bit computer, and have attempted to install SQL Server on this machine.  The install procedure failed, probably because I was installing from a copy of the install disks on a USB drive rather than the original CDs.  (I am carrying out the upgrade in a different country to my office and I did not want to risk losing the original install CDs). The install failed, and I realised that I had to install from CDs.  I then uninstalled all the SQL Server programs.  However, the uninstall procedure told me the program was already uninstalled.  However, when I try to reinstall from CDs, I am told that SQL Server Database Services, Analysis Servics, Notification Services and Integration Services are already installed. Therefore I am at an impasse.  I cannot uninstall the programs and I cannot reinstall the programs.  I have tried a registry cleaner (CCleaner) to get rid of registry settings and removed all SQL Server folders, but to no avail. How do I progress without having to reformat my entire computer?  I cannot believe that an installation procedure can be so limited - why isn't a reinstall option offered even if the computer records the programs to be present? I look forward to some suggestions on how to fix this. &n

Error when running an SQL script to restore a database on SQL Server 2008 R2 Express

  
Hi, At work, I use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. At home, I also use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. Whenever I do work on the database at work, I usually restore the database at home (or vice versa) I have been using the following SQL scripts to back up the database and to restore the same database (at work or at home). BackupRealEstate.sql USE Master BACKUP DATABASE [RealEstate] TO DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH NOFORMAT, INIT, NAME = N'RealEstate-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO RestoreRealEstate.sql USE Master RESTORE DATABASE [RealEstate] FROM DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10 GO Everything worked fine until I replaced my 8yo home computer with a newer and faster one. My new home computer is running Windows 7 Home Premium and I use the latest SQL Server 2008 R2 Express. When I tried to run the above restore SQL script, I got the following error message: Msg 3101, Level 16, State 1, Line 2 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. There was no other application/process using this database. Can someone please help me? Regards,
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend