location based features of the oracle rdbms plus some interesting new features of oracle9i -...

25
Location Based features of the Oracle RDBMS plus Some interesting new features of Oracle9i - Flashback - Fine Graind Audit - Workspace Management by Martin Jensen – [email protected] for Danish Database Workshop 15 at AUC 7. – 8. June 2001

Upload: john-mcdaniel

Post on 29-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Location Based features of theOracle RDBMS

plus

Some interesting new features of Oracle9i- Flashback

- Fine Graind Audit- Workspace Management

byMartin Jensen – [email protected]

for Danish Database Workshop 15 at AUC

7. – 8. June 2001

Oracle Spatial

Extends the World’s leading information management platform with a native understanding of location

Enables users to manage and analyze geographic data within the Oracle database

Open, standards based data model for universal accessTable

ROAD_ID

1

2

3

SURFACE

Asphalt

Asphalt

Asphalt

NAME

Fisher Cir.

Coop Ct.

85Th St.

LANES

4

2

2

LOCATION

Oracle Spatial

GeometryType

Indexing

Analysis

Element 0

Element 1 (Hole)

Basic Components: Example:

Mai

n S

tree

t

First Street

X DistanceHospital #2

Hospital #1

SELECT HOSPITAL_NAME FROM HOSPITALS A WHERE SDO_WITHIN_DISTANCE(A.LOCATION, :aGeom, ‘DISTANCE = 10 UNITS=MILES') = 'TRUE';

Supported Data Types

Point Line String Polygon (with holes) Circle Arc Strings Rectangle Collections

94102

94103

Building

SDO_GEOMETRY Object

SQL> CREATE TABLE states ( 2 state VARCHAR2(30), 3 totpop NUMBER(9), 4 geom MDSYS.SDO_GEOMETRY);

SQL> CREATE TABLE states ( 2 state VARCHAR2(30), 3 totpop NUMBER(9), 4 geom MDSYS.SDO_GEOMETRY);

Example:

sdo_gtype NUMBERsdo_srid NUMBERsdo_point SDO_POINT_TYPEsdo_elem_info SDO_ELEM_INFO_ARRAYsdo_ordinates SDO_ORDINATE_ARRAY

sdo_gtype NUMBERsdo_srid NUMBERsdo_point SDO_POINT_TYPEsdo_elem_info SDO_ELEM_INFO_ARRAYsdo_ordinates SDO_ORDINATE_ARRAY

SDO_GEOMETRY Object:

Indexing Techniques

Linear Quadtree (Fixed and Hybrid)– Quadtree enhanced using b+ tree– Pros: Fast, tunable, very good on joins,

leverages B-tree implementation– Cons: size

R-trees – Pros: smaller size, good for selects, popular– Cons: not tunable, slower on joins, periodic

rebuilds may be necessary

Spatial Operators Full range of spatial operators

– Implemented as functional extensions in SQL

– Topological Operators Inside Contains Touch Disjoint Covers Covered By Equal Overlap Boundary

– Distance Operators Within Distance Nearest Neighbor

INSIDE

Mai

n S

tree

t

First Street

X DistanceHospital #2

Hospital #1

Spatial Functions Returns a geometry

– Union– Difference– Intersect– XOR– Buffer– CenterPoint– ConvexHull

Returns a number– LENGTH– AREA– Distance

Union

XOR

Intersect

Original

Difference

Geocoding

Server based interface to geocoding servers

– Published API in Oracle 8.1.6

Name Address

ABC 755 Market St.

geocoder_http.geocode1('209.38.36.39/oracle/geoservice.dll', 'my-proxy.us.acme.com', 'user', 'password', 'oracle','1 oracle dr','', 'nashua NH 03062', 'tight', geo_result, geom);

Other 8.1.7 Features

Java Classes (Java API for geometry) Geocoding API Coordinate Systems/Projections

– Single geometry or entire table transformations

Versioning– Available with Database Workspace Manager

R-Tree Indexing (up to 4D) Linear Referencing Systems (Dyn. Seg.) GeoImage (Beta)

Oracle Flashback Overview

This feature allows users to see a consistent view of the database at a point in the past

Users can specify this read-only view based on a system time or a system change number (SCN)

Only transactions committed up until that time are visible

Possible applications are:– Self-service repair– Packaged applications like email– Decision support systems for trend

analysis

Oracle Flashback

Oracle Flashback leverages the Automatic Undo Management functionality

Undo information is kept for a specified retention interval at system level

Queries addressed to a time within the retention interval have enough undo information to reconstruct the snapshot

Oracle Flashback is enabled at a session level

Flashback Demo

Fine Grained Auditing A tool to provide extensible intrusion detection,

capturing the SQL statement, not the retrieved data

This auditing policy is based on simple user defined SQL predicates on tables as conditions for selective auditing

Attach audit policy to table or view with WHERE condition on SELECT statements

Oracle executes a user-defined audit event handler using autonomous transactions to process the event

A RELAVANT COLUMN feature is provided to reduce false audit conditions

Fine Grained Auditing Implementation

The PL/SQL package DBMS_FGA is provided to administer value-based audit policies

The security administrator uses DBMS_FGA to create an audit policy on the table(s) in question

If any of the rows returned from a query matches the audit condition the database inserts an audit event entry into the audit trail

Administrators can define audit event handlers, to process the event, such as sending an alert page to the administrator.

Fine Grained Auditing Demo

What is Workspace Manager?

Enables web and application based collaboration on database-backed projects

Provides shareable workspaces to version data

Example application:managing multiplecatalog editions

LIVE Workspace(Catalog)

NewspapersWorkspace

MagazinesWorkspace

Print EditionWorkspace

Web EditionWorkspace

How Does Workspace Manager Work

Automatically installed with Oracle9i Allows for version-enabling tables by

running a packaged procedure Automatically versions only changed

rows Merges changes with parent

to resolve conflicts

LIV Workspace(Marketing Budget)

TV & Web Workspace

Print & WebWorkspace

10% IncreaseWorkspace

25% IncreaseWorkspace

Workspace-Enable a Table

DBMS_WM.ENABLEVERSIONING('CATALOG')

CATALOG:base table

CATALOG_LT:Renamed base table with new columns

CATALOG:view with instead of triggers

UPDATE catalogSET ...

RENAME…

Guidelines for Tables Participating in a Workspace

Version-enabled table must have a primary key

A table can be version-enabled by the table owner or by a user with WM_ADMIN_ROLE

Tables owned by SYS cannot be version-enabled

Referential integrity constraints are supported on version-enabled tables

Triggers are supported on version-enabled tables with some restrictions

Assign Workspace: Associate a User

At login, the user is placed in the LIVE workspace

GOTOWORKSPACE procedure moves the current user session to the destination workspace

To include the user in the E1 workspace:

All subsequent modifications to data by the user take place on the latest versions in the E1

DBMS_WM.GOTOWORKSPACE('E1')

Refresh a Workspace

Applies all changes made in the parent to the child since the child was created or last refreshed

Refresh changes made to a single table:

Refresh all workspace changes:

Before refreshing a table:Regular (non-workspace) transactions must be committed and conflicts must be resolved

DBMS_WM.RefreshTable('E1','catalogs','product_type =''Book''')

DBMS_WM.RefreshWorkspace('E1')

Resolve Workspace Conflicts

Conflict: the same row is changed in two or more workspaces

Conflicts are detected when a workspace merge or refresh operation is attempted

Conflicts must be resolved before merge or refresh operations succeed

Resolve conflicts by choosing a row value from:– BASE– CHILD– PARENT

Conflict Resolution Example:Check for Existence of Conflicts Check for conflicts between child and

parent:

View Conflicts in table catalog:

DBMS_WM.SetConflictWorkspace('e1_focus_2')

SELECT * FROM catalogs_conf;

Good luck

Martin Jensen

[email protected]