1 © 2006 Julian Dyke Supplemental Logging Julian Dyke Independent Consultant juliandyke.com Web Version.

Slides:



Advertisements
Similar presentations
Keys, Referential Integrity and PHP One to Many on the Web.
Advertisements

SQL’s Data Definition Language (DDL) n DDL statements define, modify and remove objects from data dictionary tables maintained by the DBMS n Whenever you.
How to corrupt your data by accident BY: LLOYD ALBIN 9/3/2013.
10 Copyright © Oracle Corporation, All rights reserved. Including Constraints.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
Data Integrity Constraints
SQL DDL constraints Restrictions on the columns and tables 1SQL DDL Constraints.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Using ER/Studio.
SQL: Constraints and Triggers Chapter 6 Ullman and Widom Certain properties we’d like our database to hold Modification of the database may break these.
Introduction to DBMS and SQL Introduction to DBMS and SQL GUIDED BY : MR. YOGESH SAROJ (PGT-CS) MR. YOGESH SAROJ (PGT-CS) Presented By : JAYA XII –COM.
1 © 2006 Julian Dyke Streams Julian Dyke Independent Consultant juliandyke.com Web Version.
Chapter 6 Additional Database Objects
Database Technical Session By: Prof. Adarsh Patel.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
© Logicalis Group Using DB2/400 effectively. Data integrity facilities Traditional iSeries database usage Applications are responsible for data integrity.
HSCI 709 SQL Data Definition Language. SQL Standard SQL-92 was developed by the INCITS Technical Committee H2 on Databases. SQL-92 was designed to be.
1 RAC Internals Julian Dyke Independent Consultant Web Version juliandyke.com © 2007 Julian Dyke.
Other database objects (Sequence). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically used to.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
1 Copyright © 2004, Oracle. All rights reserved. Introduction.
FEN  Data Definition: CREATE TABLE, ALTER TABLE  Data Manipulation: INSERT, UPDATE, DELETE  Queries: SELECT SQL: Structured Query Language.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 Configuring Advanced Replication Julian Dyke Independent Consultant Web Version - July 2009 juliandyke.com © 2009 Julian Dyke.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
1 © 2010 Julian Dyke Edition-Based Redefinition Julian Dyke Independent Consultant juliandyke.com Web Version.
11-1 Copyright  Oracle Corporation, All rights reserved. What Are Constraints? Constraints enforce rules at the table level. Constraints prevent.
Chapter 9 Constraints. Chapter Objectives  Explain the purpose of constraints in a table  Distinguish among PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK,
Oracle 11g: SQL Chapter 4 Constraints.
10 Copyright © Oracle Corporation, All rights reserved. Including Constraints.
Week 5 Lecture 2 Data Integrity Constraints. Learning Objectives  Learn the types and the uses of constraints  Examine the syntax and options for creating.
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Managing Constraints. 2 home back first prev next last What Will I Learn? Four different functions that the ALTER statement can perform on constraints.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
6 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
8 Copyright © 2007, Oracle. All rights reserved. Managing Schema Objects.
Visual Programing SQL Overview Section 1.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
SQL Structured Query Language. Aims  To introduce the implementation of a Physical design using SQL.  To introduce SQL Data Definition Language (DDL).
Indexes and Views Unit 7.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
13 Copyright © Oracle Corporation, All rights reserved. Maintaining Data Integrity.
The Relational Database Model & The Database Development Process
1 © 2005 Julian Dyke Reducing Redo Julian Dyke Independent Consultant Web Version juliandyke.com.
Session 1 Module 1: Introduction to Data Integrity
Chapter 4 Indexes. Indexes Logically represents subsets of data from one or more tables View Generates numeric valuesSequence Basic unit of storage; composed.
Chapter 12 Additional Database Objects. Chapter Objectives  Define the purpose of a sequence and state how it can be used by an organization  Explain.
SY306 Web and Databases for Cyber Operations Databases - The Relational Model.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Chapter 12Introduction to Oracle9i: SQL1 Chapter 12 Additional Database Objects.
Including Constraints. What Are Constraints? Constraints enforce rules at the table level. You can use constraints to do the following: – Enforce rules.
Refining the Server Model. Adding New Tables New Table New View New Snapshot New Cluster New Column New Man FK New Opt FK.
Basic SQL*Plus edit and execute commands SQL*Plus buffer and built-in editor holds the last SQL statement Statements are created in free-flow style and.
Howard Paul. Sequential Access Index Files and Data File Random Access.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
Constraints Advanced Database Systems Dr. AlaaEddin Almabhouh.
20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations.
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
Chapter 4 Relational Databases
Rob Gleasure robgleasure.com
Instructor: Samia arshad
Presentation transcript:

1 © 2006 Julian Dyke Supplemental Logging Julian Dyke Independent Consultant juliandyke.com Web Version

© 2006 Julian Dyke juliandyke.com 2 Supplemental Logging

© 2006 Julian Dyke juliandyke.com 3 Supplemental Logging Example Redo Header Change Header KTU KDO Supplementary Header CREATE TABLE t1 ( c1 NUMBER, c2 NUMBER, c3 NUMBER ); ALTER TABLE t1 ADD CONSTRAINT t1_pk PRIMARY KEY (c1,c2); INSERT INTO t1 VALUES (100,20,1); UPDATE t1 SET c3 = 2 WHERE c1 = 100 AND c2 = 20; c3 = 1 c1 = 100 c2 = 20 KTU KDO c3 = 2 ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;

© 2006 Julian Dyke juliandyke.com 4 Supplemental Logging Minimal Supplemental Logging  Required for LogMiner  Includes additional information in redo stream  Minimal supplemental logging can be enabled using: ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;  Minimal supplemental logging can be enabled using: ALTER DATABASE DROP SUPPLEMENTAL LOG DATA;

© 2006 Julian Dyke juliandyke.com 5 Supplemental Logging Minimal Supplemental Logging  To check whether minimal supplemental logging is enabled: SELECT supplemental_log_data_min FROM v$database;  Returns YES or IMPLICIT if enabled  Allows LogMiner to support  chained rows  clustered tables  index organized tables (IOTs)

© 2006 Julian Dyke juliandyke.com 6 Supplemental Logging Database Supplemental Logging  Can be enabled  For all columns  For primary key columns  For unique columns  For foreign key columns  All columns  All columns are included with the exception of:  LONG  LOB  LONG RAW  Abstract Data Types  Collections

© 2006 Julian Dyke juliandyke.com 7 Supplemental Logging Database Supplemental Logging  To enable supplemental logging at database level: ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;  Database can be mounted and open ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (UNIQUE) COLUMNS; ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS; ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

© 2006 Julian Dyke juliandyke.com 8 Supplemental Logging Database Supplemental Logging  To disable supplemental logging at database level: ALTER DATABASE DROP SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS; ALTER DATABASE DROP SUPPLEMENTAL LOG DATA (UNIQUE) COLUMNS; ALTER DATABASE DROP SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS; ALTER DATABASE DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

© 2006 Julian Dyke juliandyke.com 9 Supplemental Logging Database Supplemental Logging  To monitor database level supplemental logging: SELECT supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui, supplemental_log_data_fk, supplemental_log_data_all FROM v$database;

© 2006 Julian Dyke juliandyke.com 10 Supplemental Logging Log Groups  Implemented as constraints  If no name specified for log group then system constraint name will be allocated e.g SYS_C  Can be  Unconditional  Before image of supplemental columns always included in redo  Conditional  Before image of supplemental columns only included in redo if supplemental columns have changed  In Oracle 10.2, minimal supplemental logging must be enabled at database level before supplemental logging can be enabled at table level

© 2006 Julian Dyke juliandyke.com 11 Supplemental Logging Unconditional Supplemental Log Groups  To specify an unconditional supplemental log group for primary key column(s): ALTER TABLE t1 ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;  To specify an unconditional supplemental log group that includes all table columns: ALTER TABLE t1 ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;  To specify an unconditional supplemental log group that includes selected columns: ALTER TABLE t1 ADD SUPPLEMENTAL LOG GROUP t1_g1 (c1,c3) ALWAYS;

© 2006 Julian Dyke juliandyke.com 12 Supplemental Logging Conditional Supplemental Log Groups  To specify a conditional supplemental log group for unique key column(s) and/or bitmap index column(s): ALTER TABLE t1 ADD SUPPLEMENTAL LOG DATA (UNIQUE) COLUMNS;  To specify a conditional supplemental log group that includes all foreign key columns: ALTER TABLE t1 ADD SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS;  To specify a conditional supplemental log group that includes selected columns: ALTER TABLE t1 ADD SUPPLEMENTAL LOG GROUP t1_g1 (c1,c3);

© 2006 Julian Dyke juliandyke.com 13 Supplemental Logging Dropping Supplemental Log Groups  To drop a supplemental log group: ALTER TABLE t1 DROP SUPPLEMENTAL LOG GROUP t1_g1;  To drop supplemental logging of data use: ALTER TABLE t1 DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS; ALTER TABLE t1 DROP SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS; ALTER TABLE t1 DROP SUPPLEMENTAL LOG DATA (UNIQUE) COLUMNS; ALTER TABLE t1 DROP SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS;

© 2006 Julian Dyke juliandyke.com 14 Supplemental Logging DBA_LOG_GROUPS view  Describes currently configured supplemental log groups: OWNERVARCHAR2(30) LOG_GROUP_NAMEVARCHAR2(30) TABLE_NAMEVARCHAR2(30) LOG_GROUP_TYPEVARCHAR2(19) ALWAYSVARCHAR2(11) GENERATEDVARCHAR2(14)  LOG_GROUP_TYPE can be:  PRIMARY KEY LOGGING  UNIQUE KEY LOGGING  FOREIGN KEY LOGGING  ALL COLUMN LOGGING  USER LOG GROUP  ALWAYS can be:  ALWAYS  CONDITIONAL  GENERATED can be  GENERATED NAME  USER NAME

© 2006 Julian Dyke juliandyke.com 15 Supplemental Logging DBA_LOG_GROUP_COLUMNS view  Describes columns in currently configured supplemental log groups: OWNERVARCHAR2(30) LOG_GROUP_NAMEVARCHAR2(30) TABLE_NAMEVARCHAR2(30) COLUMN_NAMEVARCHAR2(4000) POSITIONNUMBER LOGGING_PROPERTYVARCHAR2(6)  LOGGING_PROPERTY can be:  LOG  NO_LOG  Only applies to log groups (not log data) configurations

© 2006 Julian Dyke juliandyke.com 16 Thank you for your interest