SlideShare a Scribd company logo
[Altibase] 13 backup and recovery
Checkpointing
 Saves information about the current status of, and changes to, the
database to data files
 Management tasks after checkpointing has completed
 Change the current recovery start point to the end point of checkpointing
 Delete unneeded redo log files that have been applied to data files
 Regular checkpointing reduces the amount of time required to recover the
database in the event of a fault.
ALTIBASE HDB Checkpointing features
 Fuzzy & Ping-pong checkpointing
 Transaction performance is not reduced during checkpointing
 Two sets of data files are maintained
 Only applies to memory tablespaces
Performing Checkpointing
 Automatic execution (Default)
 Set auto-execution using the CHECKPOINT_ENABLED property
 Checkpointing interval: - CHECKPOINT_INTERVAL_IN_SEC
 Number of redo log files- CHECKPOINT_INTERVAL_IN_LOG
 Manual execution
 User command - Only the SYS user can perform checkpointing manually.
Reasons why redo log files might not be deleted after
checkpointing is completed:
 They might contain information about transactions that are still underway
 In Archivelog mode, they have not yet been archived
 If using replication, they have not yet been converted to XLogs and sent for
replication
iSQL> ALTER SYSTEM CHECKPOINT;
Database mode
 Redo log files are managed in one of two different ways after
checkpointing:
 Archivelog mode – Archived to a specified path and then deleted
 Noarchivelog mode – Deleted without being archived
 Set when the CREATE DATABASE statement is executed
 Can be subsequently changed in the CONTROL startup phase (restart
required)
Comparison
Database Mode Pros Cons
Archivelog mode
 Media recovery possible
 If archive log files are not lost,
recovery up to the present time is
possible.
 Disk space for saving archive log files
must be provided.
 DBA is burdened with additional
archive log file management tasks
Noarchivelog mode
 No disk space for saving archive
log files is needed.
 DBA need not perform archive log
file management tasks
 Media recovery is impossible.
 Recovery is only possible up to the
point at which the most recent offline
backup was conducted.
Checking the current database mode
 More detailed information can be checked by querying the v$archive
performance view
Changing the database mode after the database is created
 Start up ALTIBASE HDB in the CONTROL phase
 Change the database mode
 Can only be changed by the SYS user in SYSDBA mode
iSQL> connect sys/manager as sysdba
iSQL(sysdba)> shutdown immediate;
iSQL(sysdba)> startup control;
iSQL(sysdba)> ALTER DATABASE ARCHIVELOG;
iSQL(sysdba)> startup;
iSQL(sysdba)> SELECT archive_mode, archive_dest FROM v$archive;
ARCHIVE_MODE ARCHIVE_DEST
--------------------------------------------------------------------
0 /edu/alti1/altibase_home/arch_logs
Types of database backup and objects that are backed up
 Online backup-related commands can only be executed by the “SYS” user,
in SYSDBA mode
 Cannot be executed from multiple sessions, as there can be only one
SYSDBA mode session at any time.
Backup Type Target Object
Recovery
Point
DB Mode
Online Database Backup
The entire database (data files, log
anchor files) except redo log files
 Present
time point
 Must be
Archivelog mode
Online Tablespace Backup
The data files for a particular
tablespaceOnline Tablespace backup
by “file system copy”
Online log anchor backup log anchor files
Offline backup
The entire database (data files, log
anchor files, redo log files)  Time of
last backup
 Noarchivelog or
Archivelog mode
Backup using aexport and
iloader
Schema creation script, data in a
particular table
Online Database Backup
 Back up the entire database at particular time points while ALTIBASE HDB
is running
 When the command is executed, all data files and redo loganchor files are
automatically backed up to the specified directory
 Only one of two (#0 and #1) checkpoint image files is backed up
 Temporary tablespace data files are not backed up, as they are only used for
processing queries
iSQL(sysdba)> ALTER DATABASE BACKUP DATABASE TO 'backup_dir ';
Online Tablespace Backup
 Back up a particular tablespace while ALTIBASE HDB is running
 The data files related to the tablespace are automatically backed up to the
specified path when the command is executed.
 Only one of two (#0 and #1) memory tablespace-related data files is backed
up
iSQL(sysdba)> ALTER DATABASE BACKUP
TABLESPACE tablespace_name TO 'backup_dir ';
Online Tablespace Backup by DBA
 Backup particular tablespace while DB is operating
 Copy tablespace datafile using OS copy command after the backup using
backup command
 Log switching is essential to forcibly archive the related redo log file
 Interoperable with 3rd party backup solution as the multiple tablespaces
can be backed up simultaneously
1. iSQL(sysdba)> ALTER TABLESPACE tablespace_name BEGIN BACKUP;
2. Copy tablespace datafile using OS copy command
3. iSQL(sysdba)> ALTER TABLESPACE tablespace_name END BACKUP;
4. iSQL(sysdba)> ALTER SYSTEM SWITCH LOGFILE;
Online log anchor file backup
 Back up log anchor files while ALTIBASE HDB is running
 All three log anchor files are automatically backed up to the specified path
when the query is executed
 When altering the tablespace (ALTER DATABASE), the modified
tablespace and dictionary tablespace are also backed up, in case they are
needed for recovery
iSQL(sysdba)> ALTER DATABASE BACKUP LOGANCHOR TO 'backup_dir ';
iSQL(sysdba)> ALTER DATABASE BACKUP
2 TABLESPACE tablespace_name TO 'backup_dir ';
iSQL(sysdba)> ALTER DATABASE BACKUP
2 TABLESPACE SYS_TBS_MEM_DIC TO 'backup_dir ';
Offline database backup
 Back up the entire database after ALTIBASE HDB is shut down.
 Back up data files, redo log files and log anchor files using an OS copy
command.
1. iSQL(sysdba)> shutdown immediate;
2. Backup data files, redo log files and loganchor files by using OS copy command.
3. iSQL(sysdba)> startup;
Example of offline database backup
 altibase.properties settings
 Backup procedure
 This example assumes that the tablespace data files are located in the
default directory
MEM_DB_DIR = ?/mem_dbs
DEFAULT_DISK_DB_DIR = ?/dbs
LOG_DIR = ?/logs
LOGANCHOR_DIR = ?/logs
iSQL(sysdba)> shutdown immediate;
shell> cp –r $ALTIBASE_HOME/mem_dbs/* /backup
shell> cp –r $ALTIBASE_HOME/dbs/* /backup
shell> cp –r $AL TIBASE_HOME/logs /backup
iSQL(sysdba)> startup;
Backup Considerations
 When performing offline backup, there are more things to check other than
the default directory in the properties file
 Data files in other directories might be missed
 Check data file-related performance views for data files in other directories.
 Online backup and checkpointing cannot be performed simultaneously
 If checkpointing is underway when the online backup procedure starts, the
backup procedure waits for checkpointing to finish
 If online backup is underway when checkpointing is attempted, an error
occurs
[ERR-110A4 : Backup is in progress. Please wait until the current backup process
completes.]
 Do one of the followings to prepare for recovery when modifying a
tablespace:
 Back up the tablespace, the dictionary tablespace, and log anchor files
 Perform online or offline database backup
 If any replication objects exist, replication information is also backed up.
 If the database is restored on a system with a different IP address, the
replication error will occur.
Restart Recovery
 Automatic recovery in the event of an abnormal shutdown, such as a
power outage or a system crash.
………
TRANSITION TO PHASE : META
[SM] Recovery Phase - 1 : Preparing Database
: Dynamic Memory Version => Parallel Loading
[SM] Recovery Phase - 2 : Loading Database
[SM] Recovery Phase - 3 : Starting Recovery
Initializing Active Transaction List
Redo
Refine Disk Table..
Undo
[SM] Refine Memory Table :
........................................................................................................................................ [SUCCESS]
Media recovery
 Performed when data files are missing or corrupted.
 The database should be manually restored using:
 archive log files
 backup data files
 log anchor files
 Recovery commands must be executed in the CONTROL phase. (Online
recovery is not possible.)
 Is possible only if ALTIBASE HDB is operating in Archivelog mode.
 Both complete and partial recovery are possible
Complete recovery
 Execute the command shown below to restore the database up to the
present:
Considerations
 The archive log files AND the redo log files generated since the most
recent complete database backup must not be corrupted.
 The most recently updated log anchor files are needed.
iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE;
Partial recovery
 Restore the database to a specific point in time by executing the command
shown below:
 If redo log files or archive log files are missing or corrupted:
 To restore the database to a specified point in time:
 Redo log files must be reset after performing partial recovery.
 This step is mandatory in order to avoid restart recovery when the system is
restarted.
Consideration
 In order to restore the database to a specific point in time, the log anchor
files up to that time are needed.
iSQL(sysdba)> ALTER DATABASE db_name META RESETLOGS;
iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL;
iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE UNTIL TIME ‘2010-09-10:17:55:00’;
Recovery example in case of missing data file (1) – recovery
using backup data files
 Use the redo log files whose LSN (Log Sequence Number) is between the
LSN of the backup data files and the current LSN of the database.
Log Anchor
User1.dbf information
Creation LSN(20:012284)
Checkpoint LSN(102:172168)
Archive Logs Directory
Log File 32 Log File 100…
Log File 101 Log File 102
Online Redo Logs directory
User1.dbf (backup file)
Recovery command executed
User1.dbf
LSN
102:172168
Replay
Redo logs
LSN
32:345698User1.dbf
Media Recovery Process
Log File 0 …
Recovery example in case of missing data file (2) – recovery by
creating empty data files
 Perform recovery using archive log files and active redo log files after
creating data files.
 Use the redo log files whose LSN (Log Sequence Number) is between the
LSN of the backup data files and the current LSN of the database.
Log Anchor
User1.dbf information
Creation LSN(20:012284)
Checkpoint LSN(102:172168)
Archive Logs Directory
Log File 20 Log File 100…
Log File 101 Log File 102
Online Logs Directory
Create missing User1.dbf
Recovery command executed
User1.dbf
LSN
102:172168
Replay
Redo logs
User1.dbf
Media Recovery Process
Log File 0 …
Create an empty data file for media recovery
 Create one in the CONTROL phase if no backup data files exist.
 Create an empty memory tablespace data file:
 Create an empty disk tablespace data file:
Consideration
 The location of the data file must be same as the directory recorded in the
log anchor file.
iSQL(sysdba)> ALTER DATABASE CREATE DATAFILE 'user_disk_data001.dbf';
iSQL(sysdba)> ALTER DATABASE CREATE CHECKPOINT IMAGE 'USER_MEM_DATA-1-0';
Considerations during media recovery
 Some data files must be created by the user.
 Memory tablespace data files must be copied to form a pair.
 Empty temporary tablespace data files must be created in the CONTROL
phase.
Considerations after media recovery
 Back up the database after performing partial recovery.
 If the database is not backed up at this time, and recovery is again
subsequently performed, it will be impossible to recover any changes made
to the database after the redo logs were initialized.
shell> cp USER_MEM_DATA-1-0 USER_MEM_DATA-0-0;
iSQL(sysdba)> ALTER DATABASE CREATE DATAFILE 'temp001.dbf';

More Related Content

PDF
Inside PostgreSQL Shared Memory
EDB
 
PDF
WebLogic 12c & WebLogic Mgmt Pack
DLT Solutions
 
PPTX
Automating a PostgreSQL High Availability Architecture with Ansible
EDB
 
PPT
Oracle backup and recovery
Yogiji Creations
 
PDF
Oracle RAC 19c - the Basis for the Autonomous Database
Markus Michalewicz
 
PDF
Designing Structured Streaming Pipelines—How to Architect Things Right
Databricks
 
PDF
Redis vs Infinispan | DevNation Tech Talk
Red Hat Developers
 
PDF
Federated Engine 실무적용사례
I Goo Lee
 
Inside PostgreSQL Shared Memory
EDB
 
WebLogic 12c & WebLogic Mgmt Pack
DLT Solutions
 
Automating a PostgreSQL High Availability Architecture with Ansible
EDB
 
Oracle backup and recovery
Yogiji Creations
 
Oracle RAC 19c - the Basis for the Autonomous Database
Markus Michalewicz
 
Designing Structured Streaming Pipelines—How to Architect Things Right
Databricks
 
Redis vs Infinispan | DevNation Tech Talk
Red Hat Developers
 
Federated Engine 실무적용사례
I Goo Lee
 

What's hot (20)

PDF
How netflix manages petabyte scale apache cassandra in the cloud
Vinay Kumar Chella
 
PDF
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
PPTX
Room 1 - 3 - Lê Anh Tuấn - Build a High Performance Identification at GHTK wi...
Vietnam Open Infrastructure User Group
 
PDF
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
 
PDF
MongoDB Administration 101
MongoDB
 
PDF
Introduction to Apache Beam
Knoldus Inc.
 
PDF
MySQL Performance Schema in Action
Mydbops
 
PPTX
Elastic stack Presentation
Amr Alaa Yassen
 
PDF
KFServing and Feast
Animesh Singh
 
PPT
Database migration
Sankar Patnaik
 
PDF
Apache Spark Data Validation
Databricks
 
PDF
Fully Utilizing Spark for Data Validation
Databricks
 
PDF
Introduction to Presto at Treasure Data
Taro L. Saito
 
PPTX
Advanced Stream Processing with Flink and Pulsar - Pulsar Summit NA 2021 Keynote
StreamNative
 
PPTX
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
PDF
An Overview to MySQL SYS Schema
Mydbops
 
PPTX
MySQL enterprise edition
Mark Swarbrick
 
PPTX
Design Patterns For Real Time Streaming Data Analytics
DataWorks Summit
 
PDF
The Lyft data platform: Now and in the future
markgrover
 
PDF
Airflow presentation
Ilias Okacha
 
How netflix manages petabyte scale apache cassandra in the cloud
Vinay Kumar Chella
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
Room 1 - 3 - Lê Anh Tuấn - Build a High Performance Identification at GHTK wi...
Vietnam Open Infrastructure User Group
 
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
 
MongoDB Administration 101
MongoDB
 
Introduction to Apache Beam
Knoldus Inc.
 
MySQL Performance Schema in Action
Mydbops
 
Elastic stack Presentation
Amr Alaa Yassen
 
KFServing and Feast
Animesh Singh
 
Database migration
Sankar Patnaik
 
Apache Spark Data Validation
Databricks
 
Fully Utilizing Spark for Data Validation
Databricks
 
Introduction to Presto at Treasure Data
Taro L. Saito
 
Advanced Stream Processing with Flink and Pulsar - Pulsar Summit NA 2021 Keynote
StreamNative
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
An Overview to MySQL SYS Schema
Mydbops
 
MySQL enterprise edition
Mark Swarbrick
 
Design Patterns For Real Time Streaming Data Analytics
DataWorks Summit
 
The Lyft data platform: Now and in the future
markgrover
 
Airflow presentation
Ilias Okacha
 
Ad

Similar to [Altibase] 13 backup and recovery (20)

PPT
Les 06 Perform Rec
vivaankumar
 
PDF
Oracle database hot backup and recovery
Arun Sharma
 
PDF
Mid term & final- preparation- student-review(Oracle)
than sare
 
PDF
MySQL Backup & Recovery
Mindfire Solutions
 
PPT
Xpp c user_rec
Femi Adeyemi
 
PPT
Les 07 rman_rec
Femi Adeyemi
 
DOCX
Backup and Recovery
Anar Godjaev
 
PDF
Refresh development from productions
Osama Mustafa
 
PPT
Less14 Br Concepts
vivaankumar
 
PPT
D17316 gc20 l05_phys_sql
Moeen_uddin
 
PPT
Les 12 fl_db
Femi Adeyemi
 
PPT
Les 06 rec
Femi Adeyemi
 
DOC
Backup and Recovery Procedure
Anar Godjaev
 
PPTX
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Marcelo Altmann
 
PDF
Backup andrecoverychecklist
praveen_01236
 
PPTX
Data Guard New Features
xiangrong
 
PPT
Les 02 config
Femi Adeyemi
 
DOC
Missing redo logs in oracle
Bolisetty Srinivas
 
PDF
Oracle 12c New Features_RMAN_slides
Saiful
 
PPTX
Presentation day2 oracle12c
Pradeep Srivastava
 
Les 06 Perform Rec
vivaankumar
 
Oracle database hot backup and recovery
Arun Sharma
 
Mid term & final- preparation- student-review(Oracle)
than sare
 
MySQL Backup & Recovery
Mindfire Solutions
 
Xpp c user_rec
Femi Adeyemi
 
Les 07 rman_rec
Femi Adeyemi
 
Backup and Recovery
Anar Godjaev
 
Refresh development from productions
Osama Mustafa
 
Less14 Br Concepts
vivaankumar
 
D17316 gc20 l05_phys_sql
Moeen_uddin
 
Les 12 fl_db
Femi Adeyemi
 
Les 06 rec
Femi Adeyemi
 
Backup and Recovery Procedure
Anar Godjaev
 
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Marcelo Altmann
 
Backup andrecoverychecklist
praveen_01236
 
Data Guard New Features
xiangrong
 
Les 02 config
Femi Adeyemi
 
Missing redo logs in oracle
Bolisetty Srinivas
 
Oracle 12c New Features_RMAN_slides
Saiful
 
Presentation day2 oracle12c
Pradeep Srivastava
 
Ad

More from altistory (20)

PDF
[Altibase] 4-5 summary of tablespace management
altistory
 
PDF
[Altibase] 12 replication part5 (optimization and monitoring)
altistory
 
PDF
[Altibase] 11 replication part4 (conflict resolution)
altistory
 
PDF
[Altibase] 10 replication part3 (system design)
altistory
 
PDF
[Altibase] 9 replication part2 (methods and controls)
altistory
 
PDF
[Altibase] 8 replication part1 (overview)
altistory
 
PDF
[Altibase] 7 how the buffer is managed in altibase
altistory
 
PDF
[Altibase] 6 what is the mvcc
altistory
 
PDF
[Altibase] 5 durability
altistory
 
PDF
[Altibase] 4-4 disk tablespace
altistory
 
PDF
[Altibase] 4-3 volatile tablespace
altistory
 
PDF
[Altibase] 4-2 memory tablespace
altistory
 
PDF
[Altibase] 4-1 tablespace concept
altistory
 
PDF
[Altibase] 3-3 directory contents
altistory
 
PDF
[Altibase] 3-1 architecture
altistory
 
PDF
[Altibase] 2-4 sql functions
altistory
 
PDF
[Altibase] 2-3 general functions
altistory
 
PDF
[Altibase] 2-2 Altibase storage
altistory
 
PDF
[Altibase] 2-1 features
altistory
 
PDF
[Altibase] 1-5 hybrid dbms
altistory
 
[Altibase] 4-5 summary of tablespace management
altistory
 
[Altibase] 12 replication part5 (optimization and monitoring)
altistory
 
[Altibase] 11 replication part4 (conflict resolution)
altistory
 
[Altibase] 10 replication part3 (system design)
altistory
 
[Altibase] 9 replication part2 (methods and controls)
altistory
 
[Altibase] 8 replication part1 (overview)
altistory
 
[Altibase] 7 how the buffer is managed in altibase
altistory
 
[Altibase] 6 what is the mvcc
altistory
 
[Altibase] 5 durability
altistory
 
[Altibase] 4-4 disk tablespace
altistory
 
[Altibase] 4-3 volatile tablespace
altistory
 
[Altibase] 4-2 memory tablespace
altistory
 
[Altibase] 4-1 tablespace concept
altistory
 
[Altibase] 3-3 directory contents
altistory
 
[Altibase] 3-1 architecture
altistory
 
[Altibase] 2-4 sql functions
altistory
 
[Altibase] 2-3 general functions
altistory
 
[Altibase] 2-2 Altibase storage
altistory
 
[Altibase] 2-1 features
altistory
 
[Altibase] 1-5 hybrid dbms
altistory
 

Recently uploaded (20)

PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Presentation about variables and constant.pptx
kr2589474
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Exploring AI Agents in Process Industries
amoreira6
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Presentation about variables and constant.pptx
safalsingh810
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 

[Altibase] 13 backup and recovery

  • 2. Checkpointing  Saves information about the current status of, and changes to, the database to data files  Management tasks after checkpointing has completed  Change the current recovery start point to the end point of checkpointing  Delete unneeded redo log files that have been applied to data files  Regular checkpointing reduces the amount of time required to recover the database in the event of a fault. ALTIBASE HDB Checkpointing features  Fuzzy & Ping-pong checkpointing  Transaction performance is not reduced during checkpointing  Two sets of data files are maintained  Only applies to memory tablespaces
  • 3. Performing Checkpointing  Automatic execution (Default)  Set auto-execution using the CHECKPOINT_ENABLED property  Checkpointing interval: - CHECKPOINT_INTERVAL_IN_SEC  Number of redo log files- CHECKPOINT_INTERVAL_IN_LOG  Manual execution  User command - Only the SYS user can perform checkpointing manually. Reasons why redo log files might not be deleted after checkpointing is completed:  They might contain information about transactions that are still underway  In Archivelog mode, they have not yet been archived  If using replication, they have not yet been converted to XLogs and sent for replication iSQL> ALTER SYSTEM CHECKPOINT;
  • 4. Database mode  Redo log files are managed in one of two different ways after checkpointing:  Archivelog mode – Archived to a specified path and then deleted  Noarchivelog mode – Deleted without being archived  Set when the CREATE DATABASE statement is executed  Can be subsequently changed in the CONTROL startup phase (restart required) Comparison Database Mode Pros Cons Archivelog mode  Media recovery possible  If archive log files are not lost, recovery up to the present time is possible.  Disk space for saving archive log files must be provided.  DBA is burdened with additional archive log file management tasks Noarchivelog mode  No disk space for saving archive log files is needed.  DBA need not perform archive log file management tasks  Media recovery is impossible.  Recovery is only possible up to the point at which the most recent offline backup was conducted.
  • 5. Checking the current database mode  More detailed information can be checked by querying the v$archive performance view Changing the database mode after the database is created  Start up ALTIBASE HDB in the CONTROL phase  Change the database mode  Can only be changed by the SYS user in SYSDBA mode iSQL> connect sys/manager as sysdba iSQL(sysdba)> shutdown immediate; iSQL(sysdba)> startup control; iSQL(sysdba)> ALTER DATABASE ARCHIVELOG; iSQL(sysdba)> startup; iSQL(sysdba)> SELECT archive_mode, archive_dest FROM v$archive; ARCHIVE_MODE ARCHIVE_DEST -------------------------------------------------------------------- 0 /edu/alti1/altibase_home/arch_logs
  • 6. Types of database backup and objects that are backed up  Online backup-related commands can only be executed by the “SYS” user, in SYSDBA mode  Cannot be executed from multiple sessions, as there can be only one SYSDBA mode session at any time. Backup Type Target Object Recovery Point DB Mode Online Database Backup The entire database (data files, log anchor files) except redo log files  Present time point  Must be Archivelog mode Online Tablespace Backup The data files for a particular tablespaceOnline Tablespace backup by “file system copy” Online log anchor backup log anchor files Offline backup The entire database (data files, log anchor files, redo log files)  Time of last backup  Noarchivelog or Archivelog mode Backup using aexport and iloader Schema creation script, data in a particular table
  • 7. Online Database Backup  Back up the entire database at particular time points while ALTIBASE HDB is running  When the command is executed, all data files and redo loganchor files are automatically backed up to the specified directory  Only one of two (#0 and #1) checkpoint image files is backed up  Temporary tablespace data files are not backed up, as they are only used for processing queries iSQL(sysdba)> ALTER DATABASE BACKUP DATABASE TO 'backup_dir ';
  • 8. Online Tablespace Backup  Back up a particular tablespace while ALTIBASE HDB is running  The data files related to the tablespace are automatically backed up to the specified path when the command is executed.  Only one of two (#0 and #1) memory tablespace-related data files is backed up iSQL(sysdba)> ALTER DATABASE BACKUP TABLESPACE tablespace_name TO 'backup_dir ';
  • 9. Online Tablespace Backup by DBA  Backup particular tablespace while DB is operating  Copy tablespace datafile using OS copy command after the backup using backup command  Log switching is essential to forcibly archive the related redo log file  Interoperable with 3rd party backup solution as the multiple tablespaces can be backed up simultaneously 1. iSQL(sysdba)> ALTER TABLESPACE tablespace_name BEGIN BACKUP; 2. Copy tablespace datafile using OS copy command 3. iSQL(sysdba)> ALTER TABLESPACE tablespace_name END BACKUP; 4. iSQL(sysdba)> ALTER SYSTEM SWITCH LOGFILE;
  • 10. Online log anchor file backup  Back up log anchor files while ALTIBASE HDB is running  All three log anchor files are automatically backed up to the specified path when the query is executed  When altering the tablespace (ALTER DATABASE), the modified tablespace and dictionary tablespace are also backed up, in case they are needed for recovery iSQL(sysdba)> ALTER DATABASE BACKUP LOGANCHOR TO 'backup_dir '; iSQL(sysdba)> ALTER DATABASE BACKUP 2 TABLESPACE tablespace_name TO 'backup_dir '; iSQL(sysdba)> ALTER DATABASE BACKUP 2 TABLESPACE SYS_TBS_MEM_DIC TO 'backup_dir ';
  • 11. Offline database backup  Back up the entire database after ALTIBASE HDB is shut down.  Back up data files, redo log files and log anchor files using an OS copy command. 1. iSQL(sysdba)> shutdown immediate; 2. Backup data files, redo log files and loganchor files by using OS copy command. 3. iSQL(sysdba)> startup;
  • 12. Example of offline database backup  altibase.properties settings  Backup procedure  This example assumes that the tablespace data files are located in the default directory MEM_DB_DIR = ?/mem_dbs DEFAULT_DISK_DB_DIR = ?/dbs LOG_DIR = ?/logs LOGANCHOR_DIR = ?/logs iSQL(sysdba)> shutdown immediate; shell> cp –r $ALTIBASE_HOME/mem_dbs/* /backup shell> cp –r $ALTIBASE_HOME/dbs/* /backup shell> cp –r $AL TIBASE_HOME/logs /backup iSQL(sysdba)> startup;
  • 13. Backup Considerations  When performing offline backup, there are more things to check other than the default directory in the properties file  Data files in other directories might be missed  Check data file-related performance views for data files in other directories.  Online backup and checkpointing cannot be performed simultaneously  If checkpointing is underway when the online backup procedure starts, the backup procedure waits for checkpointing to finish  If online backup is underway when checkpointing is attempted, an error occurs [ERR-110A4 : Backup is in progress. Please wait until the current backup process completes.]  Do one of the followings to prepare for recovery when modifying a tablespace:  Back up the tablespace, the dictionary tablespace, and log anchor files  Perform online or offline database backup  If any replication objects exist, replication information is also backed up.  If the database is restored on a system with a different IP address, the replication error will occur.
  • 14. Restart Recovery  Automatic recovery in the event of an abnormal shutdown, such as a power outage or a system crash. ……… TRANSITION TO PHASE : META [SM] Recovery Phase - 1 : Preparing Database : Dynamic Memory Version => Parallel Loading [SM] Recovery Phase - 2 : Loading Database [SM] Recovery Phase - 3 : Starting Recovery Initializing Active Transaction List Redo Refine Disk Table.. Undo [SM] Refine Memory Table : ........................................................................................................................................ [SUCCESS]
  • 15. Media recovery  Performed when data files are missing or corrupted.  The database should be manually restored using:  archive log files  backup data files  log anchor files  Recovery commands must be executed in the CONTROL phase. (Online recovery is not possible.)  Is possible only if ALTIBASE HDB is operating in Archivelog mode.  Both complete and partial recovery are possible
  • 16. Complete recovery  Execute the command shown below to restore the database up to the present: Considerations  The archive log files AND the redo log files generated since the most recent complete database backup must not be corrupted.  The most recently updated log anchor files are needed. iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE;
  • 17. Partial recovery  Restore the database to a specific point in time by executing the command shown below:  If redo log files or archive log files are missing or corrupted:  To restore the database to a specified point in time:  Redo log files must be reset after performing partial recovery.  This step is mandatory in order to avoid restart recovery when the system is restarted. Consideration  In order to restore the database to a specific point in time, the log anchor files up to that time are needed. iSQL(sysdba)> ALTER DATABASE db_name META RESETLOGS; iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL; iSQL(sysdba)> ALTER DATABASE RECOVER DATABASE UNTIL TIME ‘2010-09-10:17:55:00’;
  • 18. Recovery example in case of missing data file (1) – recovery using backup data files  Use the redo log files whose LSN (Log Sequence Number) is between the LSN of the backup data files and the current LSN of the database. Log Anchor User1.dbf information Creation LSN(20:012284) Checkpoint LSN(102:172168) Archive Logs Directory Log File 32 Log File 100… Log File 101 Log File 102 Online Redo Logs directory User1.dbf (backup file) Recovery command executed User1.dbf LSN 102:172168 Replay Redo logs LSN 32:345698User1.dbf Media Recovery Process Log File 0 …
  • 19. Recovery example in case of missing data file (2) – recovery by creating empty data files  Perform recovery using archive log files and active redo log files after creating data files.  Use the redo log files whose LSN (Log Sequence Number) is between the LSN of the backup data files and the current LSN of the database. Log Anchor User1.dbf information Creation LSN(20:012284) Checkpoint LSN(102:172168) Archive Logs Directory Log File 20 Log File 100… Log File 101 Log File 102 Online Logs Directory Create missing User1.dbf Recovery command executed User1.dbf LSN 102:172168 Replay Redo logs User1.dbf Media Recovery Process Log File 0 …
  • 20. Create an empty data file for media recovery  Create one in the CONTROL phase if no backup data files exist.  Create an empty memory tablespace data file:  Create an empty disk tablespace data file: Consideration  The location of the data file must be same as the directory recorded in the log anchor file. iSQL(sysdba)> ALTER DATABASE CREATE DATAFILE 'user_disk_data001.dbf'; iSQL(sysdba)> ALTER DATABASE CREATE CHECKPOINT IMAGE 'USER_MEM_DATA-1-0';
  • 21. Considerations during media recovery  Some data files must be created by the user.  Memory tablespace data files must be copied to form a pair.  Empty temporary tablespace data files must be created in the CONTROL phase. Considerations after media recovery  Back up the database after performing partial recovery.  If the database is not backed up at this time, and recovery is again subsequently performed, it will be impossible to recover any changes made to the database after the redo logs were initialized. shell> cp USER_MEM_DATA-1-0 USER_MEM_DATA-0-0; iSQL(sysdba)> ALTER DATABASE CREATE DATAFILE 'temp001.dbf';