1117 Disaster Recovery with InterBase Bill Todd The Database Group, Inc.

Slides:



Advertisements
Similar presentations
SQL-BackTrack for Sybase
Advertisements

Copyright 2006 Mid-City Offices Systems. Busy people… How would your business be affected, if you suddenly lost all of your computer data? Rush through.
© 2012 Entrinsik, Inc. Informer Administration Exploring the system menu and functions PRESENTER: Jason Vorenkamp| Informer Software Engineer| March 2012.
Chapter 16: Recovery System
SQL Server Disaster Recovery Chris Shaw Sr. SQL Server DBA, Xtivia Inc.
REDUNDANT ARRAY OF INEXPENSIVE DISCS RAID. What is RAID ? RAID is an acronym for Redundant Array of Independent Drives (or Disks), also known as Redundant.
Backups Rob Limbaugh March 2, Agenda  Explain of a Backup and purpose  Habits  Discuss Types  Risk/Scope  Disasters and Recovery.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
©2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 5 Slide 1 IT390 Business Database Administration Unit 5 :
1096 Understanding InterBase Transactions Bill Todd The Database Group, Inc.
Chapter 9 - Control in Computerized Environment ATG 383 – Spring 2002.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Chapter 7: Configuring Disks. 2/24 Objectives Learn about disk and file system configuration in Vista Learn how to manage storage Learn about the additional.
Database System Concepts ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Remote Backup Systems.
®® Microsoft Windows 7 for Power Users Tutorial 10 Backing Up and Restoring Files.
Back Up and Recovery Sue Kayton February 2013.
Session 3 Windows Platform Dina Alkhoudari. Learning Objectives Understanding Server Storage Technologies Direct Attached Storage DAS Network-Attached.
National Manager Database Services
Module 8 Implementing Backup and Recovery. Module Overview Planning Backup and Recovery Backing Up Exchange Server 2010 Restoring Exchange Server 2010.
1. Preventing Disasters Chapter 11 covers the processes to take to prevent a disaster. The most prudent actions include Implement redundant hardware Implement.
Copyright © 2015 Pearson Education, Inc. Processing Integrity and Availability Controls Chapter
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
November 2009 Network Disaster Recovery October 2014.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Ch 11 Managing System Reliability and Availability 1.
LAN / WAN Business Proposal. What is a LAN or WAN? A LAN is a Local Area Network it usually connects all computers in one building or several building.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
Business Continuity and Disaster Recovery Chapter 8 Part 2 Pages 914 to 945.
15 Maintaining a Web Site Section 15.1 Identify Webmastering tasks Identify Web server maintenance techniques Describe the importance of backups Section.
5.1 © 2004 Pearson Education, Inc. Lesson 5: Administering User Accounts Exam Microsoft® Windows® 2000 Directory Services Infrastructure Goals 
Chapter Fourteen Windows XP Professional Fault Tolerance.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Chapter 16 Designing Effective Output. E – 2 Before H000 Produce Hardware Investment Report HI000 Produce Hardware Investment Lines H100 Read Hardware.
Module 12: Managing Disaster Recovery. Overview Preparing for Disaster Recovery Backing Up Data Scheduling Backup Jobs Restoring Data Configuring Shadow.
Module 9 Planning a Disaster Recovery Solution. Module Overview Planning for Disaster Mitigation Planning Exchange Server Backup Planning Exchange Server.
MCTS Guide to Microsoft Windows Vista Chapter 4 Managing Disks.
System Security Chapter no 16. Computer Security Computer security is concerned with taking care of hardware, Software and data The cost of creating data.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
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.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
11 DISASTER RECOVERY Chapter 13. Chapter 13: DISASTER RECOVERY2 OVERVIEW  Back up server data using the Backup utility and the Ntbackup command  Restore.
Systems Management Server 2.0: Backup and Recovery Overview SMS Recovery Web Site location: Updated.
Reliability and Recovery CS Introduction to Operating Systems.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
High Availability in DB2 Nishant Sinha
MGA Duplica Replication Tool. 1. High Availability and Avoidance of Data Loss  Replicate to alternate databases 2. Split activities across databases.
IT1001 – Personal Computer Hardware & system Operations Week7- Introduction to backup & restore tools Introduction to user account with access rights.
Chapter 15: Reliability and Security in Database Servers Neyha Amar CS 157B May 6, 2008.
Database technology Introduction ER Modeling Database objects (intro) SQL.
Component 8/Unit 9aHealth IT Workforce Curriculum Version 1.0 Fall Installation and Maintenance of Health IT Systems Unit 9a Creating Fault Tolerant.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
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.
RAID TECHNOLOGY RASHMI ACHARYA CSE(A) RG NO
Remote Backup Systems.
Managing Multi-User Databases
Introduction to Operating Systems
Database Corruption Advanced Recovery Techniques|
Maximum Availability Architecture Enterprise Technology Centre.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Processing Integrity and Availability Controls
Introduction of Week 6 Assignment Discussion
Back Up and Recovery Sue Kayton October 2015.
Administering Your Network
Remote Backup Systems.
Database Backup and Recovery
Presentation transcript:

1117 Disaster Recovery with InterBase Bill Todd The Database Group, Inc.

Data Loss Physical loss Theft

Two Questions… How much data can you afford to lose? What disasters do you want to to protect against?

A Range of Answers You can lose one day of changes –Nightly backups are all you need You cannot lose any data, even if your building burns to the ground –You need real time backup to a remote location

Physical Security Most overlooked aspect of data protection Without it anyone can: –Spill coffee on the server –Kick the plug out of the wall –Knock the server off of a table –Take it home –Take the hard drive home –Delete the database

Log Off! Never leave the server unattended with a user logged on Anyone who gets access to the machine can add a new user to the Administrators group and access the server remotely

Attitude Without it every other aspect of your data protection plan will fail sooner or later –The DBA will run to the restroom without logging out –People who are supposed to change their passwords will use predictable ones that are easy to remember –People will write passwords down –People will give passwords over the phone

Reliability Use a dedicated database server –More software running on the DB server = more likely to crash –More software running on the DB server = more people who need access to the server

Access Only the DBA has login rights to the database server Do not share any drives or folders on the database server If you use a non-dedicated server: –Never allow access to the database or server software folders –Make everyone change their password monthly

Access Don’t run apps as SYSDBA Don’t run apps as the database owner Design your app so that you can easily change the account it runs under Anyone who can log in as SYSDBA or the database owner and has access to gbak can steal your data

Backups IBConsole –Uses services API Gbak –Services API –Local backup IBBackupService component –Uses services API

Backups All backups are full backups Backup using services API –Runs entirely on the server –Backup file must be on the server Backup using gbak –Backup across the network –Backup file can be placed anywhere

To Make Backup Fast Use the services API Place the backup file on a different hard drive than the database Disable garbage collection –If you want garbage collection run a sweep after the backup

gbak Command gbak -b -g -v -service localhost:service_mgr -user sysdba -password masterkey p:\employee.gdb p:\emp.gbk

gbak Backup Switches -bBackup the database -gNo garbage collection -vDisplay progress messages -serviceUse services API

Backup From Batch File gbak -b -g -v -service localhost:service_mgr -user sysdba -password masterkey p:\employee.gdb p:\emp.gbk 2> emplog.txt Note that gbak writes to stderr, thus the 2 in front of the redirection operator (>)

Sample Batch off echo Start================== >> emplog.txt gbak -b -g -service localhost:service_mgr -user sysdba -password masterkey p:\employee.gdb p:\emp.gbk 2>> emplog.txt date > emplog.txt time > emplog.txt echo End================== >> emplog.txt echo. >> emplog.txt

Backup Log Start===================================== The current date is: Sat 05/08/2004 Enter the new date: (mm-dd-yy) The current time is: 11:07:37.13 Enter the new time: End=======================================. Start===================================== The current date is: Sat 05/08/2004 Enter the new date: (mm-dd-yy) The current time is: 11:07:40.02 Enter the new time: End=======================================.

Windows Scheduler C:\> at 23:00 /every:m,t,w,th,f,s,su empbak.cmd To schedule the backup on another machine: C:\> at \\testserver 23:00 /every:m,t,w,th,f,s,su empbak.cmd You can also use the Scheduled Tasks applet in Control Panel

Making Backups Reliable Backup output must be reviewed daily Reviewer must sign a log book The reviewer must have a backup The log book must be signed by a manager weekly

Restoring a Backup IBConsole gbak IBRestoreService component Services API

Restoring with IBConsole From the menu choose Database | Maintenance | Backup/Restore | Restore

Database Restore Dialog

Caution Do not overwrite the exiting database –If the restore fails you have nothing –Restore to a different file name. If successful delete the old database and rename the file Does not work with multi-file databases –Copy the database file using O/S copy then restore with overwrite

Restore with gbak gbak -r -p service localhost:service_mgr -user sysdba -password masterkey p:\employee.gbk p:\employee.gdb

Restore with gbak Do not use the –validate option It will slow the restore dramatically It may cause the restore to fail No validation is the default in 7.1 Before 7.1 you cannot disable validation

O/S Backups Backup the gbak backup file, not the database file –File may not be backup up if in use –File may be corrupt if backed up If you must backup the database file with an O/S backup or copy program stop the IB server service first

Forced Writes Always run with forced writes on unless performance is unacceptable If you must run with forced writes off use a dedicated server with a UPS and a stable operating system Be aware that a server crash may corrupt the database because everything in the write cache will be lost

Backup Strategies Backup at least once per day Store backup files on a different machine Store backup files off site Review backup output after every backup

Checking for Corruption Use gfix gfix -validate -full -no_update -user sysdba -password masterkey employee.gdb

Repairing Database with gfix gfix -validate -full -user sysdba - password masterkey employee.gdb -validate checks database structure -full validates records –Takes longer –More thorough

Database Still Corrupt Records could not be repaired Use –mend then backup & restore gfix -validate -full -mend -user sysdba -password masterkey employee.gdb

Repairing with IBConsole IBConsole does not offer all of the options available with gfix Choose Database | Maintenance | Validate from the menu

Database Validation Dialog

Hard Drive Failure Maintain a live copy of the database on another drive –InterBase Shadowing –Operating system disk shadowing –RAID drive array

InterBase Shadowing Maintains two copies of the database simultaneously on two drives Drive configuration –Drive 1 = operating system –Drive 2 = the database –Drive 3 = the shadow Alternative drive configuration –Drive 1 = O/S & database –Drive 2 = the shadow

InterBase Shadowing + Provides fast recovery if database drive fails - Shadow must be on a local drive - Software failure will corrupt shadow - No point-in-time recovery

InterBase Shadowing Create with CREATE SHADOW Activate shadow with gfix gfix -activate employee.shd -user sysdba -password masterkey

RAID Redundant Array of Inexpensive Disks 10 types Only four are readily available

RAID 0 Provides improved performance but no fault tolerance Of no value in protecting your data

RAID 1 Mirroring Provides 100% data redundancy Reboot is required if a drive fails

RAID 5 Striping plus Error Correction Code (ECC) Fast reads, fast writes and fault tolerance Supports hot swappable disks

RAID 10 RAID 1 + RAID 0 Combines striping for high performance with mirroring for fault tolerance Best combination of performance and fault tolerance for databases

Replication + Backup database can be on another machine on your network, even in another location - Replicated DB is behind the master - Imposes additional load on server - Replicator may fall behind if load is heavy - A network failure will stop replication

Recovery Logging Record all changes since last full backup in a separate file To recover the database: –Restore from last full backup –Apply changes in recovery log + Provides point-in-time recovery InterBase does not provide recovery logging

Implementing Recovery Logging Logging must be under transaction control It is impossible to write to an external file under transaction control You must log to a database table Logging to a table within the database defeats the purpose of logging since the log will be lost with the database

A Hybrid Approach Log to the database using triggers to write to the log table Copy the logged information to an external file as soon as possible after the transaction commits

A Hybrid Approach Use IB database for external file –Logger can use two phase commit transaction to insert info into log database and delete from log table –Log database can be on another machine

Triggering Log Copying Use an after insert trigger on the log table to post an event to the log client –+ Very little delay between change and logging –- High load on a busy database Trigger logging at a preset interval –+ Lower load on server –- Log will be further behind database

Log Table Structure One log table for each database table –Same structure as data table –Generated primary key –Column to indicate insert, update or delete - Great care required to process log data in an order that does not violate referential integrity

Log Table Structure All changes for all tables recorded in two log tables Log Master Structure –Sequence_Number –Table_Name –Action (insert, update, delete) –Where_Clause

Log Table Structure Log Detail Structure –Detail_Number –Sequence_Number (foreign key) –Column_Name –Type_Code Integer number of column containing value –Value columns One column for each data type

Two Table Log Log master gets one row for each insert, update or delete Log detail table gets one row for each non-null column in each insert or update This approach solves the RI sequencing problem This structure was first suggested by Dalton Calford in his paper “Some Solutions to Old Problems”

Recovering Using the Log Edit the log tables if necessary Restore from last full backup Run recovery program –Generate SQL statements from log –Execute statements

Questions?

Thank You Please fill out the speaker evaluation You can contact me further at …