DataBase Administration Scheduling jobs Backing up and restoring Performing basic defragmentation and index rebuilding Using alerts Archiving.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Advertisements

Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Maintaining and Automating SQL Server
Backup Strategy. An Exam question will ask you to describe a backup strategy. Be able to explain: Safe, secure place in different location. Why? – For.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
SQL Server Best Practices Keep Your Database In Top Performance Shape and Maintain Effective Backups September, 2007 Richard Kokoski.
SQL Server 2005 Implementation and Maintenance Chapter 10: Maintaining and Automating SQL Server.
©2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 5 Slide 1 IT390 Business Database Administration Unit 5 :
Chapter 12 - Backup and Disaster Recovery1 Ch. 12 – Backups and Disaster Recovery MIS 431 – Created Spring 2006.
A+ Guide to Software, 4e Chapter 4 Supporting Windows 2000/XP Users and Their Data.
MIS 431 Chapter 71 Ch. 7: Advanced File Management System MIS 431 Created Spring 2006.
Week 9 – Chapter 8 SQL 710 Methods to Backup Databases
CS27510 Commercial Database Applications. Maintenance Maintenance Disaster Recovery Disaster Recovery.
Database Backup and Recovery
Backup and Restore. Backup  Databases live in a fragile environment  Machines can fail  Disks can fail  Programs can fail.
Backup and Recovery Part 1.
Oracle9i Database Administrator: Implementation and Administration
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Presented by Joseph Galvan & Stacy Kemp BACKUPS.  Using database backups, a database administrator (DBA’s) can restore from the last backup or to a specific.
Transaction log grows unexpectedly
Designing Custom Maintenance Plans with TSQL By John Miner.
Oracle backup and recovery strategy
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Module 13 Automating SQL Server 2008 R2 Management.
Module 8: Designing Active Directory Disaster Recovery in Windows Server 2008.
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Chapter 11: Designing a Data Recovery Solution for a Database MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study.
It is one of the techniques to create a stand by server. Introduced in SQL 2000,enhanced in It is a High Availability as well as Disaster recovery.
TEMPDB Capacity Planning. Indexing Advantages – Increases performance – SQL server do not have to search all the rows. – Performance, Concurrency, Required.
Databases Lesson 5.
Architecture Rajesh. Components of Database Engine.
Module 6 Backup of SQL Server 2008 R2 Databases. Module Overview Backing up Databases and Transaction Logs Managing Database Backups Working with Backup.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Mark A. Magumba Storage Management. What is storage An electronic place where computer may store data and instructions for retrieval The objective of.
Module 16: Performing Ongoing Database Maintenance
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
Cosc 4750 Backups Why Backup? In case of failure In case of loss of files –User and system files Because you will regret it, if you don’t. –DUMB = Disasters.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
IT1001 – Personal Computer Hardware & system Operations Week7- Introduction to backup & restore tools Introduction to user account with access rights.
Section 06 (a)RDBMS (a) Supplement RDBMS Issues 2 HSQ - DATABASES & SQL And Franchise Colleges By MANSHA NAWAZ.
Learningcomputer.com SQL Server 2008 – Backup and Restore Database.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Backing Up and Restoring Databases Advanced Database Dr. AlaaEddin Almabhouh.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
Jeremy Kingry, eBECS | ADVANCED SQL SERVER FOR ADMINS AND ANALYSTS.
Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
Database Administration
You Inherited a Database Now What?
Curacao SQL Saturday June 11, 2016
Introduction to SQL Server Management for the Non-DBA
Database Administration for the Non-DBA
Re-Indexing - The quest of ultimate automation
Oracle9i Database Administrator: Implementation and Administration
Disaster Recovery is everyone’s job!
You Inherited a Database Now What?
Performing Database Recovery
data backup & system report
Chapter 11 Managing Databases with SQL Server 2000
Chapter 5 The Redo Log Files.
Sql Saturday Philadelphia
Database Backup and Recovery
Ch 10. Maintaining and Automating SQL Server
Presentation transcript:

DataBase Administration Scheduling jobs Backing up and restoring Performing basic defragmentation and index rebuilding Using alerts Archiving

Scheduling Jobs Tasks - single processes to be executed or a batch of commands that are to be run. Jobs – groupings or one or more tasks that should be run together. –you can setup dependencies and branching depending on the success or failure of individual tasks. Example: task A runs if previous task succeeds but task B runs if previous task fails

Jobs Can be scheduled based on the following: –Daily, weekly, monthly basis –Specific time of day – Specific frequency (e.g., every 10 minutes or every hour) –When CPU becomes idle for a period of time –When SQL server agent starts –In response to an alert

Tasks Task is a logical unit of work Tasks run by virtue of being part of a job, based on branching rules you have defined. –Running a job does not mean all tasks in that job will run – depends on success/failure of previous tasks and branching rules you have defined.

Job Branching Provide notification of job success/failure to operator –Network message, pager, Write information to event log Automatically delete the job (to prevent executing it later )

Creating an Operator Management Studio –SQL server Agent node Operators member –New operator Agent may not start automatically (See new operator screen figure 19-1)

Creating Jobs & Tasks Task is logical unit of work –E.g., backing up one database –E.g., running a t-sql script to rebuild all your indexes Book says that “even among highly advanced SQL server developers, programmatic construction of jobs and tasks is very rare – pg 558)

Creating Jobs & Tasks Using Management Studio See book figure 19-3 through (attempt in class)

Backup and Recovery Book has two key points (pg 567): –No database-driven application should ever be deployed or sold to a customer without a mechanism for dealing with backup and recovery. –Backups are like voting in Chicago “Do it early and often”

Creating a Backup A.k.a “A DUMP” Object explorer of particular database Tasks -> Backup fig –Dialog box figure 19-15

Backup Types Full – full backup of actual database file as of end of last transaction that was committed prior to your issuing the backup command

Differential Backup “Backup since” backup Only writes a backup of extents that have chanced since you did last full backup Typically runs much faster than full Takes up less space –How much less? – depends on database

Backup Strategy Full backup only once a week or even only once a month Differential backups in between to save space and time Only need to restore from full backup and one differential – BUT Longer time from last full backup means more and more extents written in differential –Differentials take more and more time –Recovery takes more and more time

Transaction Log Backup Copy of transaction log Discussed more later

Backup Set (pg 569) SQL server allows for idea that for various reasons (e.g., very large database) you need to backup across multiple devices e.g., drives or tapes –If so, for recovery, you need all of these destinations available to recover from any of them – they are a “set” Backup set holds the definition of what destinations were involves in your particular backup –Also holds some property information )(e.g., exp date)

Destination This is where your data is going to be backed up to –(How to fix the grammar of this sentence?) Generally a file location on separate disk which is then moved to tape Can also define a backup device Note other miscellaneous options –Note transaction log area of dialog box

Backup Scheduling Note scheduling button to define a regular schedule

Recovery Models Full – everything is logged –No data loss in event of system failure assuming backup of data available and all transaction logs since that backup. –If missing or damaged log then can still recover up through last intact log Full can take up a lot of space

Recovery Models Bulk Logged – “full recovery light” –Regular transactions logged but bulk operations are not. –Restored backup will contain all non-bulk changes to data pages –Much faster –Can recreate database IFF can redo bulk operations –Your mileage may vary

Recovery Models Simple –Transaction log only supports transactions as they happen –Log of ZERO value for restore GENERALLY, you want to be setup for FULL RECOVERY

Recovery (also be used to make copy of Database) Right click on DB and fire up restore dialog box (fig 19-16) –Fairly straight forward if restore in same location

Restoring to different location Not enough to change database name Must also change which physical files are affected.

Recovery Status State you want Database to be into after restore –With recovery -> database immediately in full online status when restore operation is completed. –With no recovery -> delayed start to allow operations to be undertaken first

Index Maintenance Indexes can become fragmented –Cylinders and disks SQL server has commands that will reorganize data and indexes to clean things up –Use job scheduling to setup automatic routine defragmentation

Alter Index ALTER INDEX { | ALL} on {REBUILD { [ WITH ( [,..n])] | PARTITION = [with ( [,..n])]]] | disable | reorganize [partition= ] [with (LOB_compaction={on|off})] | set ( [,..n]} } [;]

Alter Index Details Index Name – either individual index or all on table Table/view name Rebuild – industrial strength approach –Old index destroyed and new one built – best rebuild result, but index is GONE during re build so queries on this are SLOW during rebuild

Alter Index Details Disable – drastic as marks index as unusable, not just temp disables –Must be rebuilt to be used again –Not used much as more likely to just drop it –CAREFUL – if disable clustered index then DISABLE TABLE!!

Alter Index Details Reorganize – very useful –Almost as good a resulting index as rebuild with far less downtime. –Only works on leaf level of index – non-leaf nodes not touched –Most of the time Close enough for government work/jazz/rock/funk –Usually the tool you want as part of your regular maintenance plan

Index Reorganization Alter index all on Production.TransactionHistory reorganize;

Archiving Data Think about archiving needs at time design database Considerations –How often is data really used? Is it worth keeping – legal reasons to keep or NOT KEEP! Legal requirements to keep can be done with backups or a copy –Don’t leave orphans (ref integrity) –May be slow – TEST TEST TEST!