Ads

14 December 2011

Difference between a Cumulative Update and Service Pack for SQL Server

Cumulative Update


Cumulative Updates are primarily released for hotfix purposes.



Service Pack


Service Pack is they include actual changes or new enhancing features.

It is being used by another process

The process cannot access the file 'C:\Windows\SysWOW64\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll' because it is being used by another process

Type: Bug
ID: 576412
Opened: 7/19/2010 8:34:44 AM
Access Restriction: Public
1
Workaround(s)
3
User(s) can reproduce this bug
Watch List
Watch List
Windows 7 x64, SQL 2008 SP1 CU8 upgrade to SQL 2008 R2 RTM. i get this error message everytime:

The following error has occurred:

The process cannot access the file 'C:\Windows\SysWOW64\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll' because it is being used by another process.

Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.50.1600.1&EvtType=0x60797DC7%25400x24C2C4E7

I tried to use process explorer to determine what has this locked, but i am starting to suspect some type of redirection is not occurring?

WORKAROUND :- 


1) Stop SQL Services.
2) Rename the file
Original name: perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll
Renamed: OLD_perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll
and was able to 'Retry' the Repair SQL 2008 R2 installation and continue.

This works.

13 December 2011

Delete Secondary File

To shrink a data or log file

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.
  2. Expand Databases and then right-click the database that you want to shrink.
  3. Point to Tasks, point to Shrink, and then click Files.
  4. Select the file type and file name.
  5. Optionally, select the Release unused space check box.
    Selecting this option causes any unused space in the file to be released to the operating system and shrinks the file to the last allocated extent. This reduces the file size without moving any data.
  6. Optionally, select the Reorganize files before releasing unused space check box. If this is selected, the Shrink file to value must be specified. By default, the option is cleared.
    Selecting this option causes any unused space in the file to be released to the operating system and tries to relocate rows to unallocated pages.
  7. Optionally, enter the maximum percentage of free space to be left in the database file after the database has been shrunk. Permissible values are between 0 and 99. This option is only available when Reorganize files before releasing unused space is enabled.
  8. Optionally, select the Empty file by migrating the data to other files in the same filegroup check box.
    Selecting this option moves all data from the specified file to other files in the filegroup. The empty file can then be deleted. This option is the same as executing DBCC SHRINKFILE with the EMPTYFILE option.
  9. Click OK.

09 December 2011

Backup Verification Script - Backup when and what type

Select Distinct convert(varchar(25),@@Servername) as Servername,
            convert(varchar(30),e.database_name) as DBname,
            convert(varchar(20),convert(sysname,DatabasePropertyEx(e.database_name,'Recovery') )) as Recovery_model,
database_creation_date,backup_start_date,backup_finish_date,
           
(Select  convert(varchar(25),Max(backup_finish_date) , 100)
              From msdb..backupset a
              Where a.database_name=e.database_name
                and a.server_name  = @@servername
                and type='D'
              Group by a.database_name) Database_Bk,

             (Select convert(varchar(25),Max(backup_finish_date) , 100)
                From msdb..backupset b
               Where b.database_name=e.database_name
                and b.server_name  = @@servername
                 and type='L' Group by b.database_name) Log_Bk,

             (Select convert(varchar(25),Max(backup_finish_date) , 100)
                From msdb..backupset c
               Where c.database_name=e.database_name
                and c.server_name  = @@servername
                 and type='I' Group by c.database_name) Diff_Bk,

             (Select convert(varchar(25),Max(backup_finish_date) , 100)
                From msdb..backupset d
               Where d.database_name=e.database_name
                and  d.server_name  = @@servername
                 and type='F' Group by d.database_name) File_Bk

 From msdb..backupset e
Where e.database_name Not in ('tempdb','pubs','northwind','model')
  and e.server_name = @@Servername
  and e.database_name in (Select Distinct name from master..sysdatabases)

--never backed up
Union all
select Distinct convert(varchar(25),@@Servername) as Servername,
            convert(varchar(30),name) as DBname,
            convert(varchar(20),convert(sysname,DatabasePropertyEx(name,'Recovery'))),

NULL, NULL , NULL, NULL, NULL, NULL, NULL
from master..sysdatabases as record
where name not in (select distinct database_name from msdb..backupset)
and name not in ('tempdb','pubs','northwind','model')
order by 1,2

Script to find Recovery Model and File Location

select *  from
(select sf.fileid, sd.name, sd.cmptlevel, sf.filename,sf.filename as secfile , DATABASEPROPERTYEX (sd.name,'Recovery') as Rec_model
 from sysaltfiles sf join sysdatabases sd on sf.dbid=sd.dbid ) as s --where s.rec_model='Simple'

Script to find Recovery Model and File Location

select *  from
(select sf.fileid, sd.name, sd.cmptlevel, sf.filename,sf.filename as secfile , DATABASEPROPERTYEX (sd.name,'Recovery') as Rec_model
 from sysaltfiles sf join sysdatabases sd on sf.dbid=sd.dbid ) as s --where s.rec_model='Simple'