Skip to main content

Posts

Showing posts from January, 2013

SQL Database Mirroring and SQL Logins

After-failing over a databases to the mirror instance, the application couldn’t login to the databases complaining of login issues. It was later identified that the SQL logins were not created when the mirroring sessions were created. So I took the responsibility of creating the logins but didn’t realize the importance of the SID impact on the mirror instance and executed SP_Change_user_login to map the login with the respective database users. After the failover testing was completed on the mirror instance the databases were failed back over to the primary instance at which point we ran into further login issue. Even though the problem was sorted by executing SP_Change_user_login I obviously hadn’t ironed out the problem. After backtracking my steps I realized the importance of creating the SQL login with the same SID   in mirror instance to the same of the primary instance. Following is the syntax for the creation of the loginwith hased SID CREATE LOGIN Mirror

DBCC could not obtain a lock on object 4 because the lock request timeout period was exceeded

Does DBCC CHECKDB perform locks ? No , it doesn’t. What you are seeing here are blocking    Few days ago I got the above error message after performing the weekly consistency checks on one of the client databases. And I was telling myself Paul R has got it wrong, but then there is the two exceptions.   J As you may know from SQL 2005 onwards DBCC CHECK DB does not does not take any locks and then increased concurrency when the running the consistency checks. However, the new approach does considerable reada-heads   which bloats the I/O subsystem causing a large drop in workload that’s consistent with blocking. (sqlserverpro, Locking and DBCC CHECKDB, http://www.sqlmag.com/blog/sql-server-questions-answered-28/database-administration/locking-dbcc-checkdb-143608 )   The two circumstance where DBCC CHECKDB locks are -           If the TABLOCK option is specified when executing DBCC CheckDB   -           The underlying snapshot is not created due to performance rea