Sql Server Dba Responsibilities & Implications of Integration
Total Page:16
File Type:pdf, Size:1020Kb
▲ E-Guide SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION SearchSQLServer SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION Home Defining Half a Dozen Daily SQL Server DBA Responsibilities In-Memory SQL Server: The Implica- tions of Integration ATABASE MANAGEMENT” MAY sound like one “D responsibility to the uninitiated, but those who are more familiar know it’s just an umbrella term. Read on to explore six du- ties that are the building blocks of effective SQL Server administration. PAGE 2 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION DEFINING HALF A DOZEN DAILY SQL SERVER DBA RESPONSIBILITIES Basit Farooq Home Defining Half a Dozen SQL Server database administration can be a complex and stressful job. Daily SQL Server DBA Responsibilities Database administrators’ responsibilities cover the performance, integrity and security of business data and SQL Server databases. To fulfill their duties In-Memory SQL Server: The Implica- and to make business data available to its users, database administrators have tions of Integration to perform routine DBA checks on their SQL Servers to monitor their status. So, what critical aspects of SQL Server should all DBAs include in their daily checklist? Here are six daily DBA responsibilities that every SQL Server manager should perform. PAGE 3 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION VERIFY ALL SQL SERVER INSTANCES ARE UP Check the connectivity of each SQL Server on the network, and make sure all SQL Server instances are up. Ensure that all databases hosted on SQL Server instances are online. In addition to this, validate the storage of database data Home on the hard disk, which can be done by running the Database Consistency Defining Half a Dozen Checker (DBCC) CHECKDBcommand against each database on every SQL Daily SQL Server DBA Responsibilities Server instance. Using DBCC CHECKDB with PHYSICAL_ONLY runs faster, which is useful when it’s running against very large databases (VLDBs) and In-Memory SQL Server: The Implica- when the server is not powerful. tions of Integration INSPECT SQL SERVER ERROR LOGS FOR UNUSUAL EVENTS No matter how well you have designed and tested a database, errors will occur. Because SQL Server stores all information, warnings and error messages in the operating system and application log files, reviewing error logs daily helps quickly and easily identify unexpected errors and security problems that have occurred in the SQL Server environment. By default, SQL Server keeps one current log and six archive logs. You can use either SQL Server Management Studio Log Viewer or the sp_readerrorlog undocumented stored procedure to view SQL Server error logs. PAGE 4 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION VERIFY THAT ALL SCHEDULED JOBS HAVE RUN SUCCESSFULLY Managing SQL Server Agent jobs is a key DBA responsibility, as they are crucial to any SQL Server environment. They are created and scheduled to perform critical business and operational tasks. Therefore, it is important to keep track Home of all scheduled jobs that have not run successfully. Defining Half a Dozen SQL Server Agent stores history information for jobs, alerts and operators. Daily SQL Server DBA Responsibilities History information is stored in the sysjobhistory table of the msdbdatabase. You view the history of jobs and job steps using the Job Activity Monitor. Or, In-Memory SQL Server: The Implica- alternatively, you can query sysjobhistory for failed jobs. For example, see the tions of Integration following query that keeps track of failed jobs over the previous 24 hours: PAGE 5 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION Home Defining Half a Dozen Daily SQL Server DBA Responsibilities In-Memory SQL Server: The Implica- tions of Integration PAGE 6 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION VERIFY SUCCESS OF DATABASE BACKUPS One of a DBA’s key management tasks is backing up databases on a regular basis. This is because reliable backups are the most important tool in ensuring data recovery. Therefore, it is important for the DBA to check for database Home backups and validate that they have been successfully created and saved in a Defining Half a Dozen secure location. Daily SQL Server DBA Responsibilities SQL Server keeps information about each successful backup in the msdbdatabase. Information about each successful backup operation is stored In-Memory SQL Server: The Implica- in the backupset table, and information about each backup physical file in tions of Integration thebackupmediafamily table. For example, I wrote the following query, which can be used to check all databases’ backup status for any given SQL Server instance: PAGE 7 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION Home Defining Half a Dozen Daily SQL Server DBA Responsibilities In-Memory SQL Server: The Implica- tions of Integration PAGE 8 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION MONITOR DISK SPACE Check the amount of free space available on each SQL Server and make sure you are not low on disk space. For best performance, it is recommended that all disks should have at least 15% or more free space available. You should Home also investigate the cause of disk free space fluctuation, if there is significant Defining Half a Dozen variation in the disk space from the previous day. Often the abnormal growth Daily SQL Server DBA Responsibilities of the transaction log can cause of significant variation in the disk space. To monitor disk space, you can use the undocumented stored procedurexp_ In-Memory SQL Server: The Implica- fixeddrives. However, the limitation of xp_fixeddrives is that it can only be used tions of Integration to return information about fixed drives, not mount points. To monitor free space on operating system volumes, including the mount points, you can use the sys.dm_os_volume_stats dynamic management function. This dynamic management function returns information about the operation system volume on which databases files are located. For example, you can query this dynamic management function as follows, to get drive free-space information on any given SQL Server instance: PAGE 9 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION Alternatively, you can write a PowerShell script or common language runtime, or CLR, procedure to monitor disk and mount-point free space. REVIEW DATABASE SIZES AND GROWTH SETTINGS Home The size of the databases on an SQL Server instance is a measurable quantity Defining Half a Dozen that should be tracked on each individual SQL Server instance. This should Daily SQL Server DBA Responsibilities be done because if the database and transaction file runs out of space, then all transactions running against it will fail. Therefore, it is critical to monitor and In-Memory SQL Server: The Implica- manage the growth of the database. tions of Integration You can use sys.master_files system view to monitor database growth settings and file sizes. This system view returns the status of all files for all databases, including those that are offline. For example, the following query returns the filename, size, location and growth settings of each database file for each database. PAGE 10 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION IN-MEMORY SQL SERVER: THE IMPLICATIONS OF INTEGRATION Serdar Yegulalp Home Defining Half a Dozen It’s easy to be misled by terminology. When I first heard the term “in-memory Daily SQL Server DBA Responsibilities database” applied to SQL Server, I made the same mistake many other people have. I thought, “How’s that different from an instance of SQL Server with In-Memory SQL Server: The Implica- tons of RAM and the buffer pooling for the program turned up to 11?” But in- tions of Integration memory SQL Server -- a major change, codenamed Hekaton and planned for the next iteration of the product -- isn’t like that. And why it isn’t like that has implications for how such an instance of SQL Server would fit in with the rest of your setup. First, the basics. The label conveys the fundamental idea behind an in- memory database pretty accurately: It’s a database system where both the engine and as much of the data as possible are stored directly in RAM. Of course, this dramatically increases the speed of transactions, but this is only possible in a couple circumstances: PAGE 11 OF 15 SPONSORED BY SQL SERVER DBA RESPONSIBILITIES & IMPLICATIONS OF INTEGRATION 1. The database and engine are small enough to fit into RAM by default 2. The system contains enough RAM to hold both database and engine With memory getting cheaper all the time and the average server sporting Home more of it, scenario #2 has been happening a lot more often than scenario #1 Defining Half a Dozen ever did. The sheer size of almost any professional SQL Server deployment all Daily SQL Server DBA Responsibilities but guarantees the former rarely happens. But it isn’t just memory that’s grown cheaper, faster and more plentiful. In-Memory SQL Server: The Implica- CPUs have also become dramatically faster and more parallel, and in order tions of Integration to keep that silicon from just sitting around doing nothing, more of what the database does is being moved into memory whenever possible. Because of these issues, the forthcoming in-memory enhancements to SQL Server are being engineered to take advantage of all these trends. In a TechNet blog post entitled “The coming in-memory database tipping point,” David Campbell lays out some of these changes, including how the database itself is stored differently in memory (via a columnar, rather than a row-based, model). Microsoft has in fact already adopted some of these methods for the PowerPivot add-on for Microsoft Excel.