Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 18 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
18
Dung lượng
1,03 MB
Nội dung
Instructor Inputs Session 8 ¤NIIT Instructor Inputs 8.3 This session includes the following topics: Recovery model Backing up system databases Monitoring performance by using dynamic management views Configuring log shipping Creating database snapshot Reverting a database from a snapshot Best practices Tips and Tricks FAQs Slide 1 Installing Windows XP Professional Using Attended Installation Slide 1 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Objectives In this session, you will learn about: Recovery model Backing up system databases Monitoring performance by using dynamic management views Configuring log shipping Creating database snapshot Reverting a database from a snapshot Best practices that can be considered while restoring databases in SQL Server 2005 Tips and tricks that will help you effectively restore databases and use performance monitoring tools in SQL Server 2005 FAQs related to restore and log shipping concepts of SQL Server 2005 Session Overview 8.4 Instructor Inputs ¤NIIT Slide 2 Installing Windows XP Professional Using Attended Installation Slide 2 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Knowledge Byte The recovery model determines the backup and restore strategies that can be used for a database. There are three recovery models available in the SQL Server: Simple recovery model Full recovery model Bulk-logged recovery model In addition to user databases, you can back up the msdb, master, and model system databases. A backup of these databases allows you to restore and recover the SQL Server system in the event of a system failure, such as a hard disk failure. Slide 3 Installing Windows XP Professional Using Attended Installation Slide 3 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Knowledge Byte (Contd.) You can create only a full database backup of the master database. You should back up the master database when you execute any of the following: CREATE DATABASE, ALTER DATABASE or DROP DATABASE statements sp_addserver,sp_dropserver,sp_addlinkedserver, and sp_addmessage system stored procedures The SQL Server provides database administrators with DMVs, which return server state information. The DMVs are a group of views and table-valued functions. ¤NIIT Instructor Inputs 8.5 Slide 4 Installing Windows XP Professional Using Attended Installation Slide 4 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Knowledge Byte (Contd.) Some DMVs are applied on the server as a whole and are stored in the master databases. To view these DMVs, the user must have the VIEW SERVER STATE permission. The remaining DMVs are specific to a particular database and to view them the user must have the VIEW DATABASE STATE permission. In SQL Server 2005, DMVs have been organized in 12 categories. Microsoft Office Word Document Slide 5 Installing Windows XP Professional Using Attended Installation Slide 5 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Knowledge Byte (Contd.) Log shipping: Can be used to maintain high availability in situations when it is essential to provide a reliable stand by server and a fast failover. To implement log shipping, you need to perform the following tasks: Create a file share. Configure log shipping on the primary server. Specify the secondary server. 8.6 Instructor Inputs ¤NIIT Slide 6 Installing Windows XP Professional Using Attended Installation Slide 6 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Knowledge Byte (Contd.) Database Snapshot: Can be created by using the AS SNAPSHOT OF clause with the CREATE DATABASE statement. Syntax: CREATE DATABASE database_snapshot_name ON ( NAME = logical_file_name, FILENAME = 'os_file_name' ) [ , n ] AS SNAPSHOT OF source_database_name[;] Slide 7 Installing Windows XP Professional Using Attended Installation Slide 7 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Knowledge Byte (Contd.) Database Snapshot considerations: You can create a database snapshot on the same server instance as the source database. You can create multiple snapshots of a database. You cannot drop, detach, or restore primary database. You cannot drop files from a database snapshot. You cannot back up or restore database snapshots. You cannot attach or detach database snapshots. ¤NIIT Instructor Inputs 8.7 Slide 8 Installing Windows XP Professional Using Attended Installation Slide 8 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Knowledge Byte (Contd.) Reverting a database from a Snapshot: Use the FROM DATABASE_SNAPSHOT clause with the RESTORE statement. Syntax: RESTORE DATABASE database_name FROM DATABASE_SNAPSHOT = snapshot_name Slide 9 Installing Windows XP Professional Using Attended Installation Slide 9 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Best Practices Avoid restoring databases from unknown sources Drop databases that no longer exist Shutdown application before using RESTORE 8.8 Instructor Inputs ¤NIIT Slide 10 Installing Windows XP Professional Using Attended Installation Slide 10 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Tips and Tricks Backup master database when master has been restored and any changes have been reapplied. Use the Task Manager and Network Monitor Agent tools of Windows operating system to monitor the performance of the database server. Save trace results to a file. If you want the witness server to remain disconnected for a significant amount of time, you should remove the witness server from the session until it becomes available. If you require only a single destination database, database mirroring is the recommended solution. If you require more than one destination database, you need to use log shipping, either alone or with database mirroring. Slide 11 Installing Windows XP Professional Using Attended Installation Slide 11 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Can you backup and restore individual tables in SQL Server 2005? No, you cannot backup and restore individual tables in SQL Server 2005. FAQs ¤NIIT Instructor Inputs 8.9 Slide 12 Installing Windows XP Professional Using Attended Installation Slide 12 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 If you execute DBCC CHECKDB statement, which other two statements are automatically executed? If you execute DBCC CHECKDB statement, the DBCC CHECKTABLE and DBCC CHECKALLOC statements are automatically executed. FAQs (Contd.) Slide 13 Installing Windows XP Professional Using Attended Installation Slide 13 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 8 Can you create a mirror of system databases? No, you cannot create a mirror of system database. FAQs (Contd.) 8.10 Instructor Inputs ¤NIIT Slide 14 Installing Windows XP Professional Using Attended Installation Slide 14 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Log shipping can be used with which all components of SQL Server? Log shipping can be used with database mirroring, replication, and notification services. FAQs (Contd.) Slide 15 Installing Windows XP Professional Using Attended Installation Slide 15 of 20 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 8 Which user role can configure log shipping on an instance of a server? The sysadmin user role can configure log shipping on an instance of a server. FAQs (Contd.) [...]... possible face degrade in the performance of the server, which could be due to some problems with the operating system or other computer resources For example, the size of the paging file or the virtual memory has increased drastically causing the server to run slow To monitor such problems, you can use the System Monitor tool This tool allows you to monitor the performance of the computer and its resources,... implement appropriate solutions to optimize the performance of the database server Discuss the various tools provided by the SQL Server to monitor and optimize its performance Instructor Inputs You can conduct the discussion as follows: Discuss the various tools provided by the SQL Server to monitor and optimize its performance Discuss the System Monitor tool provided by the Windows operating system Solution... monitor the life cycle of the transactions being executed on a particular instance of the database engine Monitoring performance by using System Monitor At times, it might be possible that degrade in the performance of the server is due to some problems with the operating system or other computer resources To monitor such problems, you can use the System Monitor tool This tool allows you to monitor the. .. database_name> FROM 8.16 Instructor Inputs NIIT Collaborative Exercise Monitoring the performance of a server is one of the important activities performed by an administrator The performance of a database server is measured by the time and resources consumed in responding to the queries posted by the users The performance of the database server should be regularly monitored... view the authenticated SQL Server sessions? sys.dm_exec_connections sys.dm_exec_requests sys.dm_exec_query_stats sys.dm_exec_sessions Answer: sys.dm_exec_sessions Ver 1.0 8.12 Instructor Inputs Collaborate Session 8 Slide 19 of 20 NIIT Slide 20 Querying, Managing, and Administering Databases Using SQL Server 2005 Installing Windows XP Professional Using Attended Installation Challenge (Contd.) The sys.dm_io_backup_tapes... performance of the computer and its resources, such as memory or processor using counters NIIT Instructor Inputs 8.17 Monitoring performance by using Dynamic Management Views When monitoring the performance of the server, you might also need to check the state of the server at any given point of time The SQL Server provides database administrators with DMVs, which return server state information The DMVs... performance In addition, you can also monitor the performance using the System Monitor tool provided by the Windows operating system Monitoring performance by using SQL Server Profiler While monitoring performance, an administrator needs to check for the events occurring on the server These events include the execution of T-SQL statements or a change in the database properties SQL Server Profiler provides... In this case, the standby server takes over the control from the primary server if the later is unavailable a Database Restore b Database Security c Database Backup d Database Mirroring 5 Which instance of the database server in database mirroring holds the active database? a Witness Server b Transaction Server c Principal Server d Mirror Server 6 In which mode of database mirroring the database is... Profiler 2 Which of the following is not the SQL Server log? a SQL Server agent log b SQL Server database engine log c Transaction log d Database mail log 3 Which utility is provided by the SQL Server to view all types of event logs? a Log Viewer utility b Log File Viewer utility c SQL Server Agent utility d Log System utility 4 Which technique in the SQL Server allows you to keep a copy of the database on... DMVs Answer: I/O –related DMVs Ver 1.0 NIIT Collaborate Session 8 Slide 20 of 20 Instructor Inputs 8.13 Solutions to Challenge 1 2 3 4 5 b Full recovery model d CREATE TABLE b Full backup d sys.dm_exec_sessions a I/O –related DMVs 8.14 Instructor Inputs NIIT Home Assignment 1 How will you check the performance of a server due to a problem with the operating system? a By using Dynamic Management Views . Instructor Inputs Session 8 ¤NIIT Instructor Inputs 8. 3 This session includes the following topics: Recovery model Backing up system databases. 2005 Collaborate Session 8 Knowledge Byte (Contd.) Some DMVs are applied on the server as a whole and are stored in the master databases. To view these DMVs, the user must have the VIEW SERVER. degrade in the performance of the server, which could be due to some problems with the operating system or other computer resources. For example, the size of the paging file or the virtual