Posts

Showing posts from October, 2017

SQL Server Backup Dashboard

Situation:                 For production support DBAs, its always be a requirement to publish backups and maintenance jobs daily/weekly dashboards. In some organisations, it is a mendatory requirement to meet the compliance.            I am proving the powershell script that can produce this dashboard in Excel format. This script reads the SQL Server instance names from the external text file and produces the consolidated output for these instances. DBAs can scheule this script through windows task scheduler or they can send the output file as an attachment to the intended audience. Solution:  ################################################################################# # This script is use to generate SQL Server DBA maintenence jobs last run Dashbord in EXCEL format. # This script uses different currColor coding schemes to quickly visualise if the last run of the job successful, failed...

Property Size is not available for Database '[tempdb]'

Image
Situation: Many times, DBA try to view the TEMPDB properties but they get the following error: The user is unable to view the TEMPDB property even if he has proper rights on the SQL Server instance. In fact, sometimes SYSADMIN role user is also unable to view the property and getting the same error. Solution: For user databases, this error can be resolved by changing the database ownership. We can run this command to check the Database ownership: sp_hepldb 'database name' user databases ownership can be SET by using the following command: USE 'db name' go sp_changedbowner 'sa' However, you can not change ownership of SYSTEM databases (tempdb, master, model & msdb) through the sp_changedbowner command. 'sa' is the default owner of all the system databases. I workaround this problem and found that this error frequently arises when tempdb is highly utilised and lots of contention is there on tempdb. In this scenario, SQL server...