SlideShare a Scribd company logo
1 of 5
AnarGodjaev

BACKUP and RECOVERY
Lsnrctl services [listener01]
Mean_time_between_failures
Mean_time_to_recover

//*should be bigger in value*//
//*should be smaller in value*//

Problem
Statement failure
logic error
insufficient privileges
Process failure
‐user session abnormally terminated
User errors
‐drop table
‐truncate table
‐delete...commit
Instance failure
v$sgastat
- pool
- name
- bytes
v$log
- group_number
- log_sequence_number
- size_of_the_group
- number_of_members
v$logfile
- name
- status
- group
large pool
- backup restore operations
- I/O server processes
- Session memory fro shared users
- Large_pool_size (approximately 2gb)
Rman
- dbwr_io_slaves (integer)
- backup_tape_io_slaves (true|false)

Solution
Statement failure
Add filespace to the tablespace
Pmon
Recover from a backup

Restart the instance
AnarGodjaev
SQL> alter system switch logfile;
Alter database db_name rename file ‘...’ to ‘...’;
Fast_start_mttr_target:
expectedmttr specified in seconds amount of the time that has passed since the incremental
checkpoint at the position where the last write to redo log file occured.
Log_checkpoint_interval:
number of redo log file blocks that can exist between an incremental checkpoint and the last
block written to the redo log.
v$instance recovery
recovery_estimated_ios: ‐ recovery_estimated_ios: number of dirty buffers in the buffer cache
actual_redo_blks: - current actual number of redo blocks required for recovery
taret_redo_blks: - current number of redo blocks that must be processed for recovery
log_file_size_redo_blks: - current number of redo blocks required to guarantee that
a log switch doesnt occur before checkpoint.
log_chkpt_timeout_redo_blks:
estimated_mttr: current estimated mean time to recover (mttr). Based on the number of dirty
buffers and redo log blocks.
ckpt_block_writes: number of blocks written by checkpoint writes
v$fast_start_servers
v$fast_start_transactions
rolling forward phase
- set recovery_parallelism<integer>
- use parallel clause in the recover database statement
rolling back phase
‐ set fast_start_parallel_rollback [false | low | high] //low is default

user managed backup and recovery
offline backup – consistant whole database setup
AnarGodjaev
SQL> shutdown immediate
!cp<files> /backup/... //control file, datafile, redo log file, password file, parameter file
startup open
online backup – the database should be in archive log mode
SQL> alter tablespace users begin backup
!copy the datafiles
altertablespace users end backup
alter system archivelog current
//archive the unarchivedredologs so that the redo
required to recover the tablespace backup is achieved query the following views.
v$backup
//file,status,change,time
v$datafile_header
SQL> alter database end backup;
Alter database datafile ‘...’ end backup;
Alter tablespace<tablespace name> read only;
!backup the datafiles
Alter tablespace<tablespace name> read write;
Logging and nologging
Set database to nologging for faster data loading After this you should backup the datafiles
SQL> Alter database backup controlfile to ‘control01.bck’;
Alter database backup controlfile to trace;
Obtain database information by quering the following views
v$datafile
v$controlfile
v$logfile
dba_datafiles
user managed recovery
- time based
- cancel based
- change based
recovery steps
1‐ damaged files are restored from backup
2‐ changes from archived redo logs or online redo logs are applied if necessary
AnarGodjaev
3‐ the database may now contain commited and uncommited changes
4‐ the undo block are used to rollback any uncommited changes
5‐ the database is now in recoverd state
recovery in noarchivelog mode
1‐ restore all datafiles even one of them needs recovery
2‐ shutdown the instance
3‐ perform cancel based recovery
4‐ open database with resetlogs
SQL> shutdown immediate
!cp ‘...’ ‘...’
recover database until cancel using backup control file
cancel
alter database open resetlogs
recovery in archivelog mode
1‐ query the v$recover_file, v$archived_log, v$recovery_log
2‐ recover database
//mounted database
3‐ recover datafile ‘...’
//mounted database
4‐ recover tablespaceusers
//open database
5‐ recover datafile ‘...’
//open database
SQL> shutdown abort
Startup mount
Recover database
//recover datafile ‘...’
Alter database open
!cp ‘...’ ‘...’
alter database rename file ‘...’ to ‘...’
startup mount
alter database datafile ‘...’ offline
alter database open
restoredatafile
alter database rename file ‘...’ to ‘...’
alter database recover
recoverdatafile ‘...’
//recover tablespace<tablespace name>
alter database datafile ‘...’ online;
altertablespaceuser_data offline immediate;
alter database create datafile ‘...’ [as] ‘...’;
alter database recover;
altertablespacetable_data online;
AnarGodjaev
createcontrolfile;
recover database using backup controlfile;
1‐ shutdown and backup the database
2‐ restore all datafiles, dont restore controlfile, redo logs, password file and parameter file
3‐ mount database
4‐ recover datafiles
5‐ open database with resetlogs
6‐ perform a closed database backup
SQL> Recover database until cancel
Recover [automatic] database until time ‘2013‐10‐26:14:22:03’
Time based database recovery
1‐ shutdown and backup the database
2‐ restore all datafiles
//may need to recover archivelogs
3‐ mount database
4‐ recover database until time
5‐ open with resetlogs
6‐ backup the database
cancel based database recovery
1‐ redo logs are not multiplexed
one of the redo logs is missing
the missing redo log is not archived
2‐ shutdown database
3‐ restore all datafiles from backup
4‐ mount the database
5‐ recover database until cancel
6‐ open database with resetlogs
7‐ backup database
loss of current redo log files
- attempt to open database
- find the current log sequence number
- recover database until cancel
- drop and recreate log files if necessary
- open database with resetlogs
- perform whole database backup

//select * from v$log

SQL> alter database clear unarchivedlogfile group 2;

More Related Content

What's hot

Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different hostOsama Mustafa
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklistpraveen_01236
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsRoo Wall
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Recvivaankumar
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queriesvivaankumar
 
Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespaceSoumya Das
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2PoguttuezhiniVP
 
Postgresql Database Administration Basic - Day1
Postgresql  Database Administration Basic  - Day1Postgresql  Database Administration Basic  - Day1
Postgresql Database Administration Basic - Day1PoguttuezhiniVP
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Buvivaankumar
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby databaseJorge Batista
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installationvivaankumar
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3PoguttuezhiniVP
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rmanvivaankumar
 

What's hot (20)

Les 01 Arch
Les 01 ArchLes 01 Arch
Les 01 Arch
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queries
 
Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespace
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2
 
Les 03 Catalog
Les 03 CatalogLes 03 Catalog
Les 03 Catalog
 
Postgresql Database Administration Basic - Day1
Postgresql  Database Administration Basic  - Day1Postgresql  Database Administration Basic  - Day1
Postgresql Database Administration Basic - Day1
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
 
Less17 Util
Less17  UtilLess17  Util
Less17 Util
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby database
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
 
Les 09 Tspitr
Les 09 TspitrLes 09 Tspitr
Les 09 Tspitr
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rman
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 
Les 08 Dupe Db
Les 08 Dupe DbLes 08 Dupe Db
Les 08 Dupe Db
 

Viewers also liked

How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...Anar Godjaev
 
Conditional Control
Conditional ControlConditional Control
Conditional ControlAnar Godjaev
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden GateAnar Godjaev
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin GüvenliğiAnar Godjaev
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasiAnar Godjaev
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaultAnar Godjaev
 

Viewers also liked (11)

Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Table Partitions
Table PartitionsTable Partitions
Table Partitions
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 

Similar to Backup and Recovery

[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_pptmaclean liu
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklistمسلم islam
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
ControlfilemanagementVinay Thota
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.subhani shaik
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.subhani shaik
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezInsight Technology, Inc.
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guideAmit87_dba
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in DataguardJason Arneil
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlMoeen_uddin
 
Cloning database using srdf copy
Cloning database using srdf copyCloning database using srdf copy
Cloning database using srdf copyAmit Vashishth
 

Similar to Backup and Recovery (20)

[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
5895640.ppt
5895640.ppt5895640.ppt
5895640.ppt
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
 
Backup&recovery
Backup&recoveryBackup&recovery
Backup&recovery
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guide
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Les 12 fl_db
Les 12 fl_dbLes 12 fl_db
Les 12 fl_db
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sql
 
Cloning database using srdf copy
Cloning database using srdf copyCloning database using srdf copy
Cloning database using srdf copy
 

More from Anar Godjaev

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumAnar Godjaev
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon ExportAnar Godjaev
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Anar Godjaev
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Anar Godjaev
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeAnar Godjaev
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)Anar Godjaev
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Anar Godjaev
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationAnar Godjaev
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace YonetimiAnar Godjaev
 

More from Anar Godjaev (17)

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
LogMiner
LogMinerLogMiner
LogMiner
 
Undo Management
Undo ManagementUndo Management
Undo Management
 
ASM
ASMASM
ASM
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 Installation
 
Change DB Name
Change DB NameChange DB Name
Change DB Name
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace Yonetimi
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Backup and Recovery

  • 1. AnarGodjaev BACKUP and RECOVERY Lsnrctl services [listener01] Mean_time_between_failures Mean_time_to_recover //*should be bigger in value*// //*should be smaller in value*// Problem Statement failure logic error insufficient privileges Process failure ‐user session abnormally terminated User errors ‐drop table ‐truncate table ‐delete...commit Instance failure v$sgastat - pool - name - bytes v$log - group_number - log_sequence_number - size_of_the_group - number_of_members v$logfile - name - status - group large pool - backup restore operations - I/O server processes - Session memory fro shared users - Large_pool_size (approximately 2gb) Rman - dbwr_io_slaves (integer) - backup_tape_io_slaves (true|false) Solution Statement failure Add filespace to the tablespace Pmon Recover from a backup Restart the instance
  • 2. AnarGodjaev SQL> alter system switch logfile; Alter database db_name rename file ‘...’ to ‘...’; Fast_start_mttr_target: expectedmttr specified in seconds amount of the time that has passed since the incremental checkpoint at the position where the last write to redo log file occured. Log_checkpoint_interval: number of redo log file blocks that can exist between an incremental checkpoint and the last block written to the redo log. v$instance recovery recovery_estimated_ios: ‐ recovery_estimated_ios: number of dirty buffers in the buffer cache actual_redo_blks: - current actual number of redo blocks required for recovery taret_redo_blks: - current number of redo blocks that must be processed for recovery log_file_size_redo_blks: - current number of redo blocks required to guarantee that a log switch doesnt occur before checkpoint. log_chkpt_timeout_redo_blks: estimated_mttr: current estimated mean time to recover (mttr). Based on the number of dirty buffers and redo log blocks. ckpt_block_writes: number of blocks written by checkpoint writes v$fast_start_servers v$fast_start_transactions rolling forward phase - set recovery_parallelism<integer> - use parallel clause in the recover database statement rolling back phase ‐ set fast_start_parallel_rollback [false | low | high] //low is default user managed backup and recovery offline backup – consistant whole database setup
  • 3. AnarGodjaev SQL> shutdown immediate !cp<files> /backup/... //control file, datafile, redo log file, password file, parameter file startup open online backup – the database should be in archive log mode SQL> alter tablespace users begin backup !copy the datafiles altertablespace users end backup alter system archivelog current //archive the unarchivedredologs so that the redo required to recover the tablespace backup is achieved query the following views. v$backup //file,status,change,time v$datafile_header SQL> alter database end backup; Alter database datafile ‘...’ end backup; Alter tablespace<tablespace name> read only; !backup the datafiles Alter tablespace<tablespace name> read write; Logging and nologging Set database to nologging for faster data loading After this you should backup the datafiles SQL> Alter database backup controlfile to ‘control01.bck’; Alter database backup controlfile to trace; Obtain database information by quering the following views v$datafile v$controlfile v$logfile dba_datafiles user managed recovery - time based - cancel based - change based recovery steps 1‐ damaged files are restored from backup 2‐ changes from archived redo logs or online redo logs are applied if necessary
  • 4. AnarGodjaev 3‐ the database may now contain commited and uncommited changes 4‐ the undo block are used to rollback any uncommited changes 5‐ the database is now in recoverd state recovery in noarchivelog mode 1‐ restore all datafiles even one of them needs recovery 2‐ shutdown the instance 3‐ perform cancel based recovery 4‐ open database with resetlogs SQL> shutdown immediate !cp ‘...’ ‘...’ recover database until cancel using backup control file cancel alter database open resetlogs recovery in archivelog mode 1‐ query the v$recover_file, v$archived_log, v$recovery_log 2‐ recover database //mounted database 3‐ recover datafile ‘...’ //mounted database 4‐ recover tablespaceusers //open database 5‐ recover datafile ‘...’ //open database SQL> shutdown abort Startup mount Recover database //recover datafile ‘...’ Alter database open !cp ‘...’ ‘...’ alter database rename file ‘...’ to ‘...’ startup mount alter database datafile ‘...’ offline alter database open restoredatafile alter database rename file ‘...’ to ‘...’ alter database recover recoverdatafile ‘...’ //recover tablespace<tablespace name> alter database datafile ‘...’ online; altertablespaceuser_data offline immediate; alter database create datafile ‘...’ [as] ‘...’; alter database recover; altertablespacetable_data online;
  • 5. AnarGodjaev createcontrolfile; recover database using backup controlfile; 1‐ shutdown and backup the database 2‐ restore all datafiles, dont restore controlfile, redo logs, password file and parameter file 3‐ mount database 4‐ recover datafiles 5‐ open database with resetlogs 6‐ perform a closed database backup SQL> Recover database until cancel Recover [automatic] database until time ‘2013‐10‐26:14:22:03’ Time based database recovery 1‐ shutdown and backup the database 2‐ restore all datafiles //may need to recover archivelogs 3‐ mount database 4‐ recover database until time 5‐ open with resetlogs 6‐ backup the database cancel based database recovery 1‐ redo logs are not multiplexed one of the redo logs is missing the missing redo log is not archived 2‐ shutdown database 3‐ restore all datafiles from backup 4‐ mount the database 5‐ recover database until cancel 6‐ open database with resetlogs 7‐ backup database loss of current redo log files - attempt to open database - find the current log sequence number - recover database until cancel - drop and recreate log files if necessary - open database with resetlogs - perform whole database backup //select * from v$log SQL> alter database clear unarchivedlogfile group 2;