Tuesday, August 20, 2013

This backend version is not supported to design database diagrams or tables. (MS Visual Database Tools)

You may receive the below error and couple of other errors while working with SQL Server 2012

This backend version is not supported to design database diagrams or tables. (MS Visual Database Tools)
Index was outside the bounds of array (Microsoft.SQLServer.SMO)

Workaround

The errors may happen because you are trying to access SQL Server 2012 databases from SQL Server 2008 or SQL Server 2008 R2 management tools. To fix the issue you need to download SQL 2012 management tools.
 

New Folder is missing from right click menu


I spent many hours on the Internet to find the solution for this, Finally I find solution in microsoft site, below link shows the perfect solution provided by Linda Yan in technet windows forums

http://social.technet.microsoft.com/Forums/windows/en-US/9ee6ecdf-5958-4af4-b640-c659ada57bc4/option-to-create-new-folder-on-desktop-is-missing

Please logoff or restart the machine after completion of steps
 

Friday, August 9, 2013

Adding Secondary Data File To Mirrored Database Steps

Steps to add secondary data file to Mirrored Database

1. Make sure mirrored database is in synchronized state using below query - at principal server

SELECT db_name(database_id) as database_name, mirroring_state_desc,
mirroring_role_desc,  mirroring_partner_name,  mirroring_partner_instance
FROM sys.database_mirroring where mirroring_state_desc = 'SYNCHRONIZED'
2. Disable backup jobs at principal server if any

3. Run the below command to stop the mirroring -- at principal server
  Alter database MirrorNew set partner off

Now you can observe db mirroring will be removed and mirror server database state becomes restoring

4. Add secondary data file / filegroup to principal server database - at principal server
alter database mirrornew add file
 (name='second_datafile',
  filename='E:\Program Files\Microsoft SQL Server\DATA\MirrorNew_second.ndf',
  size = 50mb)
5. Make sure file got added to principal server database -- at principal server
select * from MirrorNew..sysfiles

6. Generate log backup of principal database  -- at principal server
backup log mirrornew to disk='e:\backups\mirrornewwithsecondary.trn' with init

7. You can verify whether log backup has newly added file or not using the below command
restore filelistonly from disk='e:\backups\mirrornewwithsecondary.trn'

8. Copy the log backup to mirror server

9. Run the below command to verify the file location of the database
select * from sysaltfiles where dbid = DB_ID('mirrornew')

10. Restore the log file on mirror server database using with move option -- at mirror server

restore log mirrornew from disk='e:\backups\mirrornewwithsecondary.trn'
with norecovery, move 'second_datafile' to 'E:\Program Files\Microsoft SQL Server\\DATA\MirrorNew_second.ndf'
11. Verify newly created file added to database or nore   -- at mirror server
select * from sysaltfiles where dbid = DB_ID('mirrornew')

12. Reinitiate the mirroring from mirror server -- at mirror server
alter database mirrornew set partner ='tcp://kalyanmirror:5022' -- It moves database into Inrecovery mode

13. Finally initiate mirroring step from principal server -- at principal server
alter database mirrornew set partner='tcp://kalyanprimary:5023'

Now database mirroring will established between principal and mirror, Execute the step 1 to make sure both databases are in sync state.