Skip to main content

Posts

How will you upgrade for Active and Active cluster server

To upgrade for Active & Active cluster server Active to active means you will install SQL server on each node so they will be active to active. First transfer both sql server service on node A and upgrade Node B then transfer both services on node B and upgrade node A and then split the service on separate nodes(Node A & B)

Datebase-Unavailable database:testdb is unavailable(suspect,offline,recovering etc) in SQL

SQL Error:  Database-Unavailable database  :testdb is unavailable(suspect,offline,recovering etc) 1.If the database is offline, the approach should be to bring the database online by either from GUI or from query : ALTER DATABASE <database_name> SET ONLINE and if it still doesn't come up..we should check the logs for the reasons..and based on the outcome we have to proceed accordingly. 2.If the Database is offline, then try to make the database online using the script ALTER DATABASE <database name> SET ONLINE. If it is not recover the database to online, then check in event viewer for possible error, if error is 17204--then data file has damaged,if error is 17207--- then log file has damaged,If you see this error then the database is there in suspect state. To Recover the suspect state database u need to follow steps as below: If data file damaged: 1. Take the tile log back up. 2.Restore Full back up with no recovery. 3.Restore Differential & Log Backups

How to Shrink TempDB in Sql Server?

To Shrink TempDB in Sql Server below ideas can help you to handle the issue. If it is data file then Instead of shrinking you should check the open transactions causing tempdb to get full..if it is not critical you can kill the process or else should add secondary data files. Shrinking log whereas is safe witch you can do by dbcc shrinkfile command. 1)If mdf file is full we can shrink that but sometimes we can’t shrink mdf file the reasons are: (i)check if any locks are there through (sys.dm_tran_locks)or sp_locks (ii)check for sys.dm_db_session_space_usage which will allows to check for page allocation and deallocation for each session on that instance (iii)check for temporary objects in tempdb using (select * from sys.all_objects where is_ms_shipped=0)-ser created temp objects. These are called as cached objects which are residing in procedure cache which helps stored procedure to make use of the query plan. But now it is not getting shrinked we have to perform DBCC FREEPROCCACHE wh

Database Administrator daily tasks

These are the task list that must be done by a DBA on daily basis. 1) Check System Event Logs and SQL Server Error Logs for unusual events. 2) Verify that all scheduled jobs have run successfully. 3) Confirm that backups have been made and successfully and moved to the backup storage or secure location. 4) Monitor disk space to make sure SQL Servers will not run out of disk space. 5) Periodically monitor performance of database and system using both System Monitor and SQL Server Profiler. 6) Monitor and identify blocking issues. 7) Keep a log of any changes you make to servers, instance setting, database setting and monitoring script. 8) Create SQL Server alerts to notify you of problems, and e-mailed to you. Take action as  needed. 9) Regularly restore backups to a test server in order to verify that you can restore them. Summary: Installing DB software Creating databases Performing upgrades of the database and software to new release levels Starting u

Index rebuilding in SQL

When index are rebuild that means the old indexes on the table are dropped and new indexes on the table are created. Due to the creation of the indexes on the table all the data is organised in the leaf level (cluster index) and organised simultaneously. Thus maximum the number of rows in your table , maximum will be the page count and maximum will be the time taken in rebuilding the index. Indexing is nothing but ordering of pages, thus it depends on page count