SlideShare a Scribd company logo
1 of 91
Download to read offline
Paul G. Matuszyk
 Introduction
 Corruptions –What are they?
 Recover options
 How to prevent corruptions?
 Impact on database
 Conclusions
 Questions
 Oracle (mainly) contractor
 Current contract in Poland
 8th time here in Dallas
Corruption is a form of dishonest conduct by a
person entrusted with a position of authority,
often to acquire personal benefit.
(Wikipedia)
Block ≠ Oracle expects
 Logical
 Physical
 Checksum OK
 Data inside block is bad
 Examples:
 Stale lock
 Wrong free space indicators
(avsp or tosp)
 Wrong block type
 ORA-600 reported
 Limited reporting
 Extended reporting by DBV
 ORA-1578
 Causes
 Oracle bug
 Failure of the Oracle software infrastructure
 Memory error
 Direct-load inserts with no-logging
 a.k.a media corruption
 Most common type of corruptions
 Any major damage to the block
 'zeroed' block
 Block checksums inconsistent
 Wrong internal block structures
 Oracle doesn’t recognize block as a
legitimate
 Problem with software
 Firmware
 Kernel
 File system corruption
 Controller error
 (...)
 Problem with hardware
 CPU or memory error
 Cache on storage array or disk
 (...)
 Intrablock – within single block
- physical
- logical
 Interblock – corruption between > 1 block
- only logical
 alert.log
 trace files
 stdout
 views
 v$database_block_corruption
 v$backup_corruption
 v$copy_corruption
 SQLs: ANALYZE table/index
 RMAN commands like:
validate / backup validate
list failure
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 Check for logical / physical corruptions
 NO logical checks (by default)
 VALIDATE / BACKUPVALIDATE
 VALIDATE DATABASE;
 VALIDATE DATAFILE 1;
 VALIDATE DATAFILE 1 BLOCK 10;
 BACKUPVALIDATE DATABASEARCHIVELOGALL;
 BACKUPVALIDATE CHECK LOGICAL DATABASE
ARCHIVELOGALL;
 BLOCKRECOVER command
 v$database_block_corruption
and
RECOVER command
 RECOVER ... BLOCK ...
 Parallel operations
 Progress in:
 v$session_longops
and
 v$database_block_corruption
 NOARCHIVELOG  Block media recovery
 Only complete block media recovery
 Blocks unavailable until recovered
 Full backups only for BMR
 BMR only on corrupted blocks ;-)
 First block is unrecoverable
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 Command line ($ORACLE_HOME/bin/dbv)
 Physical data structure check
 ONLINE / OFFLINE tool
 Modes: file level / segment level
 (-) Can be slow
 (+) easy to use
 (+) works offline
 dbv userid="'/ as sysdba‚'" file=TB_COMPRESS.dbf
 ASM / OMF / normal files
 dbv userid='/ as sysdba' file=TB_COMPRESS.dbf
 dbv …. segment_id=4.4.86289
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 Introduced Oracle8i
 Online repair tool
 Two tables are created:
 Repair table
 Orphan key table
 Helps with:
 Detection
 Repair
 Index problems (pointing to corrupt data, index
status fix)
 DBMS_REPAIR.CHECK_OBJECT()
 DBMS_REPAIR.FIX_CORRUPT_BLOCKS()
Does NOT repair data
Marks invalid blocks
 DBMS_REPAIR.SKIP_CORRUPT_BLOCKS()
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 To break or fix
 Metalink DocID 62015.1
 Shipped until 10g ... works in 12c
 Be careful while using it
 Be extremely careful while in EDIT MODE
 Allows to calculate block checksums
 Mark a block as valid (block sequence reset)
 Noarchivelog failures  problems with db
opening
 Datafiles from older backups
 RMAN
 DBV
 DBMS_REPAIR
 (BBED)
 Active Data Guard
 Physical (only) corruption  repair
 Automatic (mostly)
 Transparent to apps & users (mostly)
 Exceptions:
 Block header corruption
 > 100 block corruptions
 Timeout after 60 s.
 If exception  ORA-1578
 Manual block media recovery
Set init.ora parameters
 DB_BLOCK_CHECKING
 DB_BLOCK_CHECKSUM
 DB_LOST_WRITE_PROTECT
 DB_ULTRA_SAFE
 DB_BLOCK_CHECKING
 DB_BLOCK_CHECKSUM
 DB_LOST_WRITE_PROTECT
 DB_ULTRA_SAFE
 Introduced in Oracle8i
 Validate data in database blocks
 Memory corruption  data corruption
 Logical corruption
 Dynamic parameter (alter system)
 PDB modifiable
 Default: FALSE
Semantic block checking
Data in SYSTEM tbs is always checked
 Replaces events:
 10210 (tables)
 10211 (indexes)
 DB_BLOCK_CHECKING higher priority than
events
 Valid values
 FALSE
 TRUE
 OFF
 LOW
 MEDIUM
 FULL
For backward
compatibility
10gR2+
 Valid values for compatibility
 FALSE  OFF
 TRUE  FULL
OFF (FALSE)
 Default value: FALSE
 Oracle's internal data  checks on
 User data  checks off
LOW
Oracle's internal data  checks on
User data  basic checks
MEDIUM
Oracle's internal data  checks on
User data  LOW and
full semantic checks
but NOT on indexes
FULL (TRUE)
Oracle's internal data  checks on
User data  LOW+MEDIUM
full semantic checks
also on indexes
 DB_BLOCK_CHECKING
 DB_BLOCK_CHECKSUM
 DB_LOST_WRITE_PROTECT
 DB_ULTRA_SAFE
 From (at least) Oracle7
 Enables checksum calculation & checks
 Physical corruption
 Dynamic parameter
 Alter system / alter session
 PDB
 Defaults to TYPICAL
 XOR on DATA in the block
 READS affected more
 WRITES affected less
 Oracle says:
 TYPICAL  1-2%
 FULL  4-5%
 Checksum calculation for :
 Data block
 Log blocks
 Valid values
 FALSE
 TRUE
 OFF
 TYPICAL
 FULL
For backward
compatibility
10gR2+
OFF (FALSE)
Oracle's internal data  checks on
User data  checks off
TYPICAL (TRUE)
Oracle's internal data  checks on
User data  checks on
(when applicable)
FULL
Oracle's internal data  checks on
User data  checks on
(when applicable)
logs checksumed
in-memory errors
 DB_BLOCK_CHECKING
 DB_BLOCK_CHECKSUM
 DB_LOST_WRITE_PROTECT
 DB_ULTRA_SAFE
 New in 11gR1
(10gR2 „_db_lost_write_checking”)
 Record SCN of read block into REDO stream
 Dynamic (alter system)
 Meant for Data Guard environments
 Must be the same for all instances (RAC)
 Other techniques may not detect lost writes
 ~50 bytes / read block
 NONE  functionality disabled (default)
 TYPICAL  READS logged for
R/W tablespaces
 FULL  READS logged for
R/W and R/O tablespaces
 12cR1 new property
 PrimaryLostWriteAction =
CONTINUE  Primary: BAU (continue)
SHUTDOWN  Primary: shutdown abort
 Diag info written:
 Primary site: alert.log + DG Broker log
 Standby site: alert.log + DG Broker log
 Faster lost writes detection
 Solution:
- failover to standby (if LW in PROD)
- recreate standby (if LW in STBY)
- FIX STORAGE
 Impact on performance:
 Primary db – increased REDO stream
 Standby db - validate + additional reads
 DB_BLOCK_CHECKING
 DB_BLOCK_CHECKSUM
 DB_LOST_WRITE_PROTECT
 DB_ULTRA_SAFE
 New in Oracle11g
 Static parameter
 PDB unmodifiable
 Defaults to OFF
DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
 OFF
 DATA_ONLY
 DB_BLOCK_CHECKING = MEDIUM
 DB_BLOCK_CHECKSUM = FULL
 DB_LOST_WRITE_PROTECT =TYPICAL
 DATA_AND_INDEX
 DB_BLOCK_CHECKING = FULL
 DB_BLOCK_CHECKSUM = FULL
 DB_LOST_WRITE_PROTECT =TYPICAL
DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
alter system set db_ultra_safe=DATA_ONLY scope=spfile;
-- instance restart
alter system set db_block_checking=FALSE scope=both;
-- instance restart
alter system set db_ultra_safe=DATA_ONLY scope=spfile;
-- instance restart
 Not very useful
 Static
 Can introduce confusion
 Why to use it?
 Intel Xeon CPU
 4TB SSD for the DB
 8 vCPU
 16GB RAM
 VMware
Users off low medium full %
30 265 344 261 255 104
70 411 630 409 391 105
100 653 402 370 367 178
db_block_checksum=OFF
db_block_checking = …
Users off low medium full %
30 23 17 24 26 110
70 30 21 32 35 117
100 38 47 56 57 151
db_block_checksum=OFF
db_block_checking = …
Users off low medium full %
30 235 191 200 183 128
70 272 248 273 211 129
100 427 225 189 191 223
db_block_checksum=FULL
db_block_checking = …
Users off low medium full %
30 39 47 54 54 139
70 75 89 107 107 142
100 86 131 161 161 187
db_block_checksum=FULL
db_block_checking = …
db_block_checksum= …
db_block_checking = …
Users: db_block_checking
30 off low medium full
db_block_checksum
off 265 344 261 255
full 235 191 200 183
db_block_checksum= …
db_block_checking = …
Users: db_block_checking
30 off low medium full
db_block_checksum
off 23 17 24 26
full 39 48 55 55
 Corruptions are rare
 Corruptions  serious consequencies
 „A stitch in time saves nine”
 Impact can be huge:
 Db_block_checking  medium for new DBs
 If I/O or CPU usage high:
PRI: db_block_checksum OFF / LOW
PRI: db_block_checking OFF
 SBY: enable
 Consider DB_LOST_WRITE_PROTECT
(dynamic / revertible)
 Oracle-base.com (Tim Hall)
 Oracle DOC & Metalink
 Blogs @ Pythian.com
 Disassembling the Oracle Data Block by
GrahamThornton (2005)
 (many others)
Paul G. Matuszyk
matuszyk@matuszyk.com
@pmatuszy

More Related Content

What's hot

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
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recoverymaclean liu
 
Managing Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSONManaging Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSONMichael Rosenblum
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Michael Rosenblum
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationAlexey Lesovsky
 
Debunking myths about_redo_ppt
Debunking myths about_redo_pptDebunking myths about_redo_ppt
Debunking myths about_redo_pptRiyaj Shamsudeen
 
Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]revoluson
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
 
Windows 7 64 java envirenment build
Windows 7 64 java envirenment buildWindows 7 64 java envirenment build
Windows 7 64 java envirenment buildLifeng (Aaron) Han
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres MonitoringDenish Patel
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
 
SQL Tuning, takes 3 to tango
SQL Tuning, takes 3 to tangoSQL Tuning, takes 3 to tango
SQL Tuning, takes 3 to tangoMauro Pagano
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10gsagai
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly databaseAnar Godjaev
 
SQL injection: Not Only AND 1=1 (updated)
SQL injection: Not Only AND 1=1 (updated)SQL injection: Not Only AND 1=1 (updated)
SQL injection: Not Only AND 1=1 (updated)Bernardo Damele A. G.
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 

What's hot (20)

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
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery
 
Managing Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSONManaging Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSON
 
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
Hidden Gems of Performance Tuning: Hierarchical Profiler and DML Trigger Opti...
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming Replication
 
Debunking myths about_redo_ppt
Debunking myths about_redo_pptDebunking myths about_redo_ppt
Debunking myths about_redo_ppt
 
Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]Oracle11g(1z0 050) v100612[1]
Oracle11g(1z0 050) v100612[1]
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
Windows 7 64 java envirenment build
Windows 7 64 java envirenment buildWindows 7 64 java envirenment build
Windows 7 64 java envirenment build
 
Rac 12c optimization
Rac 12c optimizationRac 12c optimization
Rac 12c optimization
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres Monitoring
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
SQL Tuning, takes 3 to tango
SQL Tuning, takes 3 to tangoSQL Tuning, takes 3 to tango
SQL Tuning, takes 3 to tango
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10g
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
 
Strategic autovacuum
Strategic autovacuumStrategic autovacuum
Strategic autovacuum
 
SQL injection: Not Only AND 1=1 (updated)
SQL injection: Not Only AND 1=1 (updated)SQL injection: Not Only AND 1=1 (updated)
SQL injection: Not Only AND 1=1 (updated)
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 

Similar to Hotsos 2017 - Protect or Perform by Paul G. Matuszyk

FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GN/A
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new featuresNabi Abdul
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
Oracle Database Management Basic 1
Oracle Database Management Basic 1Oracle Database Management Basic 1
Oracle Database Management Basic 1Chien Chung Shen
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2Mario Redón Luz
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuningafa reg
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLéopold Gault
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features" Anar Godjaev
 
Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Emre Baransel
 
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』Insight Technology, Inc.
 

Similar to Hotsos 2017 - Protect or Perform by Paul G. Matuszyk (20)

FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
 
Corruptbkp
CorruptbkpCorruptbkp
Corruptbkp
 
oracle dba
oracle dbaoracle dba
oracle dba
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
Oracle Database Management Basic 1
Oracle Database Management Basic 1Oracle Database Management Basic 1
Oracle Database Management Basic 1
 
Les 09 diag
Les 09 diagLes 09 diag
Les 09 diag
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
 
Oracle Data Guard
Oracle Data GuardOracle Data Guard
Oracle Data Guard
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 
Less04 Instance
Less04 InstanceLess04 Instance
Less04 Instance
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
 
Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012Data Guard Deep Dive UKOUG 2012
Data Guard Deep Dive UKOUG 2012
 
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』
[db tech showcase Tokyo 2018] #dbts2018 #B17 『オラクル パフォーマンス チューニング - 神話、伝説と解決策』
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Hotsos 2017 - Protect or Perform by Paul G. Matuszyk

  • 2.  Introduction  Corruptions –What are they?  Recover options  How to prevent corruptions?  Impact on database  Conclusions  Questions
  • 3.  Oracle (mainly) contractor  Current contract in Poland  8th time here in Dallas
  • 4.
  • 5. Corruption is a form of dishonest conduct by a person entrusted with a position of authority, often to acquire personal benefit. (Wikipedia)
  • 7.
  • 9.
  • 10.  Checksum OK  Data inside block is bad  Examples:  Stale lock  Wrong free space indicators (avsp or tosp)  Wrong block type  ORA-600 reported
  • 11.  Limited reporting  Extended reporting by DBV
  • 13.  Causes  Oracle bug  Failure of the Oracle software infrastructure  Memory error  Direct-load inserts with no-logging
  • 14.
  • 15.  a.k.a media corruption  Most common type of corruptions  Any major damage to the block  'zeroed' block  Block checksums inconsistent  Wrong internal block structures  Oracle doesn’t recognize block as a legitimate
  • 16.  Problem with software  Firmware  Kernel  File system corruption  Controller error  (...)  Problem with hardware  CPU or memory error  Cache on storage array or disk  (...)
  • 17.  Intrablock – within single block - physical - logical  Interblock – corruption between > 1 block - only logical
  • 18.
  • 19.  alert.log  trace files  stdout  views  v$database_block_corruption  v$backup_corruption  v$copy_corruption  SQLs: ANALYZE table/index  RMAN commands like: validate / backup validate list failure
  • 20.
  • 21.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 22.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 23.  Check for logical / physical corruptions  NO logical checks (by default)  VALIDATE / BACKUPVALIDATE  VALIDATE DATABASE;  VALIDATE DATAFILE 1;  VALIDATE DATAFILE 1 BLOCK 10;  BACKUPVALIDATE DATABASEARCHIVELOGALL;  BACKUPVALIDATE CHECK LOGICAL DATABASE ARCHIVELOGALL;
  • 24.
  • 25.  BLOCKRECOVER command  v$database_block_corruption and RECOVER command
  • 26.  RECOVER ... BLOCK ...
  • 27.  Parallel operations  Progress in:  v$session_longops and  v$database_block_corruption
  • 28.  NOARCHIVELOG  Block media recovery  Only complete block media recovery  Blocks unavailable until recovered  Full backups only for BMR  BMR only on corrupted blocks ;-)  First block is unrecoverable
  • 29.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 30.
  • 31.  Command line ($ORACLE_HOME/bin/dbv)  Physical data structure check  ONLINE / OFFLINE tool  Modes: file level / segment level
  • 32.  (-) Can be slow  (+) easy to use  (+) works offline
  • 33.  dbv userid="'/ as sysdba‚'" file=TB_COMPRESS.dbf  ASM / OMF / normal files
  • 34.  dbv userid='/ as sysdba' file=TB_COMPRESS.dbf
  • 35.  dbv …. segment_id=4.4.86289
  • 36.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 37.  Introduced Oracle8i  Online repair tool  Two tables are created:  Repair table  Orphan key table  Helps with:  Detection  Repair  Index problems (pointing to corrupt data, index status fix)
  • 38.  DBMS_REPAIR.CHECK_OBJECT()  DBMS_REPAIR.FIX_CORRUPT_BLOCKS() Does NOT repair data Marks invalid blocks  DBMS_REPAIR.SKIP_CORRUPT_BLOCKS()
  • 39.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 40.  To break or fix  Metalink DocID 62015.1  Shipped until 10g ... works in 12c  Be careful while using it  Be extremely careful while in EDIT MODE  Allows to calculate block checksums
  • 41.  Mark a block as valid (block sequence reset)  Noarchivelog failures  problems with db opening  Datafiles from older backups
  • 42.  RMAN  DBV  DBMS_REPAIR  (BBED)  Active Data Guard
  • 43.  Physical (only) corruption  repair  Automatic (mostly)  Transparent to apps & users (mostly)  Exceptions:  Block header corruption  > 100 block corruptions  Timeout after 60 s.
  • 44.  If exception  ORA-1578  Manual block media recovery
  • 45.
  • 47.  DB_BLOCK_CHECKING  DB_BLOCK_CHECKSUM  DB_LOST_WRITE_PROTECT  DB_ULTRA_SAFE
  • 48.  DB_BLOCK_CHECKING  DB_BLOCK_CHECKSUM  DB_LOST_WRITE_PROTECT  DB_ULTRA_SAFE
  • 49.  Introduced in Oracle8i  Validate data in database blocks  Memory corruption  data corruption  Logical corruption  Dynamic parameter (alter system)  PDB modifiable  Default: FALSE
  • 50. Semantic block checking Data in SYSTEM tbs is always checked
  • 51.  Replaces events:  10210 (tables)  10211 (indexes)  DB_BLOCK_CHECKING higher priority than events
  • 52.  Valid values  FALSE  TRUE  OFF  LOW  MEDIUM  FULL For backward compatibility 10gR2+
  • 53.  Valid values for compatibility  FALSE  OFF  TRUE  FULL
  • 54. OFF (FALSE)  Default value: FALSE  Oracle's internal data  checks on  User data  checks off
  • 55. LOW Oracle's internal data  checks on User data  basic checks
  • 56. MEDIUM Oracle's internal data  checks on User data  LOW and full semantic checks but NOT on indexes
  • 57. FULL (TRUE) Oracle's internal data  checks on User data  LOW+MEDIUM full semantic checks also on indexes
  • 58.  DB_BLOCK_CHECKING  DB_BLOCK_CHECKSUM  DB_LOST_WRITE_PROTECT  DB_ULTRA_SAFE
  • 59.  From (at least) Oracle7  Enables checksum calculation & checks  Physical corruption  Dynamic parameter  Alter system / alter session  PDB  Defaults to TYPICAL
  • 60.  XOR on DATA in the block  READS affected more  WRITES affected less  Oracle says:  TYPICAL  1-2%  FULL  4-5%
  • 61.  Checksum calculation for :  Data block  Log blocks  Valid values  FALSE  TRUE  OFF  TYPICAL  FULL For backward compatibility 10gR2+
  • 62. OFF (FALSE) Oracle's internal data  checks on User data  checks off
  • 63. TYPICAL (TRUE) Oracle's internal data  checks on User data  checks on (when applicable)
  • 64. FULL Oracle's internal data  checks on User data  checks on (when applicable) logs checksumed in-memory errors
  • 65.  DB_BLOCK_CHECKING  DB_BLOCK_CHECKSUM  DB_LOST_WRITE_PROTECT  DB_ULTRA_SAFE
  • 66.  New in 11gR1 (10gR2 „_db_lost_write_checking”)  Record SCN of read block into REDO stream  Dynamic (alter system)  Meant for Data Guard environments  Must be the same for all instances (RAC)  Other techniques may not detect lost writes  ~50 bytes / read block
  • 67.  NONE  functionality disabled (default)  TYPICAL  READS logged for R/W tablespaces  FULL  READS logged for R/W and R/O tablespaces
  • 68.  12cR1 new property  PrimaryLostWriteAction = CONTINUE  Primary: BAU (continue) SHUTDOWN  Primary: shutdown abort  Diag info written:  Primary site: alert.log + DG Broker log  Standby site: alert.log + DG Broker log
  • 69.
  • 70.  Faster lost writes detection  Solution: - failover to standby (if LW in PROD) - recreate standby (if LW in STBY) - FIX STORAGE
  • 71.  Impact on performance:  Primary db – increased REDO stream  Standby db - validate + additional reads
  • 72.  DB_BLOCK_CHECKING  DB_BLOCK_CHECKSUM  DB_LOST_WRITE_PROTECT  DB_ULTRA_SAFE
  • 73.  New in Oracle11g  Static parameter  PDB unmodifiable  Defaults to OFF DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX } DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
  • 74.  OFF  DATA_ONLY  DB_BLOCK_CHECKING = MEDIUM  DB_BLOCK_CHECKSUM = FULL  DB_LOST_WRITE_PROTECT =TYPICAL  DATA_AND_INDEX  DB_BLOCK_CHECKING = FULL  DB_BLOCK_CHECKSUM = FULL  DB_LOST_WRITE_PROTECT =TYPICAL DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
  • 75. alter system set db_ultra_safe=DATA_ONLY scope=spfile; -- instance restart
  • 76. alter system set db_block_checking=FALSE scope=both; -- instance restart
  • 77. alter system set db_ultra_safe=DATA_ONLY scope=spfile; -- instance restart
  • 78.  Not very useful  Static  Can introduce confusion  Why to use it?
  • 79.
  • 80.  Intel Xeon CPU  4TB SSD for the DB  8 vCPU  16GB RAM  VMware
  • 81. Users off low medium full % 30 265 344 261 255 104 70 411 630 409 391 105 100 653 402 370 367 178 db_block_checksum=OFF db_block_checking = …
  • 82. Users off low medium full % 30 23 17 24 26 110 70 30 21 32 35 117 100 38 47 56 57 151 db_block_checksum=OFF db_block_checking = …
  • 83. Users off low medium full % 30 235 191 200 183 128 70 272 248 273 211 129 100 427 225 189 191 223 db_block_checksum=FULL db_block_checking = …
  • 84. Users off low medium full % 30 39 47 54 54 139 70 75 89 107 107 142 100 86 131 161 161 187 db_block_checksum=FULL db_block_checking = …
  • 85. db_block_checksum= … db_block_checking = … Users: db_block_checking 30 off low medium full db_block_checksum off 265 344 261 255 full 235 191 200 183
  • 86. db_block_checksum= … db_block_checking = … Users: db_block_checking 30 off low medium full db_block_checksum off 23 17 24 26 full 39 48 55 55
  • 87.
  • 88.  Corruptions are rare  Corruptions  serious consequencies  „A stitch in time saves nine”  Impact can be huge:
  • 89.  Db_block_checking  medium for new DBs  If I/O or CPU usage high: PRI: db_block_checksum OFF / LOW PRI: db_block_checking OFF  SBY: enable  Consider DB_LOST_WRITE_PROTECT (dynamic / revertible)
  • 90.  Oracle-base.com (Tim Hall)  Oracle DOC & Metalink  Blogs @ Pythian.com  Disassembling the Oracle Data Block by GrahamThornton (2005)  (many others)