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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

I have to do it manually or is there any other way...?to transfer the users in database mirroring

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :Sql Server
One issue in database mirroring: In Primary server every week 2-3 users will additionally added.How will these users gone to Mirror Server database?I have to do it manually or is there any other way...? One more thing is that Primary server is llve  and 24 hours users connected, If I want to migrate users on other server then I have to make mirror server as primary server and then run SP_rev_login , it is automatic failover then  the newly created users will not be at the mirror server??then problem"SQLSERVER DBA" "INDIA"

View Complete Post

More Related Resource Links

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

TDE key rotation in the database mirroring situation.

I have set up database mirroring for TDE enabled database and they worked fine as far as I got all the key infrastructure identical on both Principal and mirrored SQL servers. Now it is coming to our yearly key rotation practice for compliance.  After I regenerate the DEK on principal server and also encrypt it with a newer certificate,  the mirroring is suspended and I am not able to resume it any more.  (Although I have added this newer certificate to the mirrored server too.) It is understandable because now the DEK is out of sync.  However, what are the correct steps to do the key rotation in the mirroring scenario? The bottom line is:  I DO NOT want to set up mirroring again since our backups are huge and take very long time to copy the backups from principal server to mirrored server. thanks for any input in advance.  

How can i transfer a database between to computers

How do i move a database that i use for my webbapplication from my old computer to my new? I tried backing up the db on the old computer createing  a.bak file and then restoring it in the new computer using "restore database". This is the error i get:"TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ ADDITIONAL INFORMATION: The media family on device 'G:\Douments and files\Web Project\Finlandsinstitutet\App_Data\dbFinin.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------  The media family on device 'G:\Douments and files\Web Project\Finlandsinstitutet\App_Data\dbFinin.bak' is incorrectly formed. SQL Server cannot process this media family.RESTORE HEADERONLY is terminating abnormally. (.Net SqlClient Data Provider)------------------------------For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer

SSRS2005: Is it safe to manually remove instances from the Keys table in the report server database?

I have a problem with redundant reporting services instances still hanging around in the initialization pane of the RS configuration wizard and I can't get rid of them. The problem arose when we had new webfarms and before I had removed all references to the old ones from the initialization screen, the old webfarms had been switched off, removed from the network and dismantled. Therefore when I try to 'de-initialize' them, I get an error stating that reporting services cannot connect to them and when I run reports, a fair few are trying to run on the old webfarms which no longer exist and are disappearing into the void. There's a table in the report server database called Keys whch contains details of these intances and i'm wondering if its safe to remove these via SQL commands without breaking reporting services on other machines.   As a side note: All this stems from the fact that when you uninstall Reporting Services, not all of the files / references are removed. So as a general word of warning, if you do an uninstall of RS2005, you'll need to make sure everything's gone before re-installing, throwing away old machines etc. These include folders in IIS and these old instances as mentioned above.  

Custom Contact List: has to be auto-populated with users and manually insert others contact

Hi All, is it possible to create a custom contact list that automatically insert user as contact? I have to use it to send auto-email to the people in the contact list... (ant they can be user or not) Thanks All Vit

If one database goes down in database mirroring then other will come up but because there is no Virt

In database Mirroring can I have a virtual IP... Please tell fast.. Actually we were trying to install the sql server cluster but thats not possible bcoz it is in production of Domino Server.My confusion is "If one database goes down in database mirroring then other will come up but because there is no Virtual IP type of thing in this then how my application will connect to another without manual interruption of IP change..."     "SQLSERVER DBA" "INDIA"

SQL Server 2008 Database Restore(Database Mirroring)

HI,I tried to impliment Database mirrorin in SQL Server 2008.I have 3 Sqlserver 2008 Eneterprise Edition in 3 diiferent computers with same domain.Pricnicipal server =TCP://SPHDev.sphinet.com.sg:5022.Mirror=TCP://SPHPrimary.sphinet.com.sg:5022 and witness =TCP://wsc211.sphinet.com.sg:5022.But when i click start mirroring button i got an error TITLE: Database Properties------------------------------ An error occurred while starting mirroring. ------------------------------ADDITIONAL INFORMATION: Alter failed for Database 'SPH_MSCRM'.  (Microsoft.SqlServer.Smo) ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ The server network address "TCP://SPHPRIMARY.sphinet.com.sg:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418).This is the error message i got from Error Log"2009-06-03 17:01:08.89 spid27s     Database mirroring connection error 2 'DNS lookup failed with error: '11001(No such host is known.)'.' for 'TCP://SPHPRIMARY.sphinet.com.sg:5022"I restored Principal server DB  by using RESTORE WITH NORECOVERY and now this  database in mirror server is now look like as DBName(Restoring....).How i can identify

In database Mirroring:

In database Mirroring: I have found that there is a "mirror Server" option in System DSN ,Sql Native Client configuration but one confusion is here that : Should I have to create the same DSN configuration on Mirror server without giving "mirror Server" name in this case??"SQLSERVER DBA" "INDIA"

Database Mirroring: How To Set Up Servers?

  Hi, I am currently reading into Database Mirroring... A few questions regarding the transaction log came up my mind when trying to find a setup/disaster recovery strategy:   Imagine this situation: I am already running a SQL Server database... Now I want to add synchronized database mirroring by adding a mirror database to the setup. Which prerequisites are required on the mirror database? Is it sufficient to use an empty database? Or do I need to restore a backup of the principal database first?   Same for disaster recovery: Imagine the primary database goes offline and the Witness designates the mirror database as the principal database. After re-installing Windows/SQL Server on the former principal machine, which prerequisites are required to let it become the mirror of the new principal database? Do I need to create a current backup of the new principal database? Or will an old backup of the old principal database do? Or will even an empty database on the new machine do the job?   Finally, this is a more general question I have, regarding the transaction log: The mirror database is fed from the principal database's transaction log... How can I make sure that all necessary transaction log records are still available in the transaction log? I couldn't find information on how records are deleted from the transaction log file... Does the transaction

C# Database created but does not show up in Server Management Studio unless I manually attach it.


I used C# Linq to Sql to create a database. I look on the hard drive and the database .mdf and .ldf files are there. I open Server Management Studio 2008, attach to SQL express and the database is not there unless I actually attach the database.


First, is this correct behavior?

Second, is it possible to create a Sql Express database that is automatically registered(?) in Management Studio? If so, please give pointer.


Thanks very much.



How to ensure that all users are logged off the sql database and that they can't access when the SQ


We are trying to restore a SQL Server 2005 (all the databases). We have failed with the restore for a couple of times and the vendor says that we have to ensure that all database users are logged off the database. A restore will fail if other users try to use the database while the restore operation is in

How could this be acomplished. There is no way that we can control if any user or app access the server while we are restoring.

The problem is that when when we are restoring the databases if someone access any of them while the restore is taking place the process fails.

The question is how should the restore be performed? Is there any way to change the state of the database so that the databases can be restored?

Any thoughts?

Users, Sessions, Processes, Instances, Database Engine

Can you depict me the existing relation between Users, Sessions, Processes, Instances and Database Engine of SQL Server?

Forms based authentication allow only specific users from database table


I have the following implementation and I'm sure there is an easy way to do what I want to do but I can't figure it out. 

1. I use forms based authentication to authenticate to my site

2.  I use active directory to authenticate the users

3.  I use the Allow Users="xxx" tag to authorize the users limited to the list that can access my site. (e.g.. even though Mary is an AD user she can't access my site unless I put her credentials in the allow users tag in the web.config file)

All is working well but I want to move the users access list (e.g.. <allow users="john" />" from the web.config to a database table so that I can create a user maintenance page for my admins to add and delete user access.   For the life of me I can't figure out how to do this and I can't seem to find an article on it either.  I'm sure I'm just not looking for the right thing, so help is greatly appreciated. 

Here is my web.config file..

        <add name="DBConnectionString" connectionString="Data Source=PRIMSRV;Initial Catalog=MAINDB;Persist Security Info=True;User ID=svc.Test;Password=password

disconnect all the users from database


Hi gurus

Is there any command to disconnect all the users from the database. I don't want to set it in single user mode.



transfer database task error



I have created a SSIS package that does nothing more than loop through all DBs and copies the userDBs to another server. However, I keep getting an error after the task has created the database during its execution of "Create Role" statements. Here is the error:

Error: The Execute method on the task returned error code 0x80131500 (ERROR : errorCode=-1073548784 description=Executing the query "CREATE ROLE [aspnet_WebEvent_FullAccess] " failed with the following error: "User, group, or role 'aspnet_WebEvent_FullAccess' already exists in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.  helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}). The Execute method must succeed, and indicate the result using an "out" parameter.


Now it appears to me that the Transfer DB task keeps using master as the current database even after it has created the new DB? Why would it does this when at the source the database role is under the usersDB?



How to manually populate a listview control without a database connection?


Hi to all,

I'm currently developing an ASP.net application w/ VB as the code behind. I have a page that shows all the user name currently assigned to the system. The problem now is that the page does not communicate directly to the database. Instead, I use HTTPrequest to get all the user names from a different sever. Now I want to populate the listview control w/ the response that I got (and not directly from the database).

How should I do it? Please help.



Change the default users for a new database?

Is there any way to customise the default users that have access to a newly created database? I have an Active Directory group that has been granted logon rights to the SQL server, but I need it to have read/write access to any new databases that are created on the server. I don't want to use the Mgmt Studio to grant the permissions. This is because we have an app that creates the databases, but it doesn't set the security. I want an easy way for the security to be granted.
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