DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-1 COS 346 Day 21.

Slides:



Advertisements
Similar presentations
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 David M. Kroenke’s Chapter Eight: Database Redesign Database Processing:
Advertisements

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 11-1 David M. Kroenke’s Chapter Eleven: Managing Databases with SQL Server.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 COS 346 Day 20.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2008.
Introduction to Structured Query Language (SQL)
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 David M. Kroenke’s Chapter Eight: Database Redesign Database Processing:
Database Administration Chapter Six DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Introduction to Structured Query Language (SQL)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 COS 346 Day 11.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Fundamentals, Design, and Implementation, 9/e Chapter 10 Managing Databases with Oracle 9i.
Prentice Hall © COS 346 Day Agenda Questions? Assignment 7 Corrected –4 A’s and 4 B’s Assignment 8 posted –Due April 6 Quiz 2 next class.
Getting Started (Excerpts) Chapter One DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 COS 346 Day 12.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 17.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 18.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 COS 346 Day 11.
Introduction to Structured Query Language (SQL)
David M. Kroenke and David J
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Backup and Recovery Part 1.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-1 David M. Kroenke’s Chapter Ten: Managing Databases with Oracle Database.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
ASP.NET Programming with C# and SQL Server First Edition
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Database Technical Session By: Prof. Adarsh Patel.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Fundamentals, Design, and Implementation, 9/e Chapter 10 Managing Databases with Oracle 9i SII 654 Fall 2005.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 20.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Prentice Hall © COS 346 Day Agenda Questions? Assignment 8 not Corrected yet Assignment 9 posted –Due April 2:05 PM Quiz 2 Corrected.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 12 Managing Databases with Oracle.
Fundamentals, Design, and Implementation, 9/e Chapter 8 Database Redesign.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Seven: SQL for Database Construction and Application.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
Chapter 15: Reliability and Security in Database Servers Neyha Amar CS 157B May 6, 2008.
Managing Database With Oracle Replacement for Ch10 COP 4708.
© 2007 by Prentice Hall2-1 Introduction to Oracle 10g Chapter 2 Overview of SQL and SQL*Plus James Perry and Gerald Post.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Seven: SQL for Database Construction and Application.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Ten A: Managing Databases with Oracle Database.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Eight: Database Redesign.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Ten A: Managing Databases with SQL Server 2012.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Seven: SQL for Database Construction and Application.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
CH 10 DB Application Design n 10.1 Functions n 10.2 Case Application n 10.3 Creating, Reading, Updating, Deleting View n 10.4 Form Design n 10.5 Report.
Chapter Seven: SQL for Database Construction and Application Processing.
Introduction To Database Systems
SQL for Database Construction and Application Processing
Database Processing: David M. Kroenke’s Chapter Seven:
Database Processing: David M. Kroenke’s Chapter Seven:
Chapter 7 Using SQL in Applications
Chapter 7 Using SQL in Applications
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-1 COS 346 Day 21

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-2 Agenda Assignment 9 Posted –Due April 23 –2 More to go Assignment 10 Posted –Due April 26 –1 more to go Quiz 2 Corrected –3 A’s, 2 B’s, 1 C and 1 D –There will only be 3 exams 10% instead of 7.5%) Last Capstone Progress Reports Due April 26 Today we will discuss –Managing databases with Oracle

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-3 End of days? (subject to change) April 19 –DP Chap 10 April 23 –DP Chap 12 –SQL Chap 11 –Assignment 9 due April 26 –DP Chapter 13 –Assignment 10 due April 30 –DP Chap 14 May 3 –DP Chap 15 –Review –Assignment 11 Due May 9 –Quiz 3 –10 AM –Capstone presentations

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-4 David M. Kroenke’s Chapter Ten: Managing Databases with Oracle Part One Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-5 Introduction Oracle is the world’s most popular DBMS - It is a powerful and robust DBMS that runs on many different operating systems Oracle DBMS engine available is several versions:versions –The Personal Edition of Oracle is available with this text and can also be downloaded from Oracle Example of Oracle products: –SQL*Plus: a utility for processing SQL and creating components like stored procedures and triggers: PL/SQL is a programming language that adds programming constructs to the SQL language –Oracle Developer (Forms & Reports Builder) Also third-party products - Quest Software’s TOADQuest Software’s TOAD

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-6 View Ridge Gallery View Ridge Gallery is a small art gallery that has been in business for 30 years It sells contemporary European and North American fine art View Ridge has one owner, three salespeople, and two workers View Ridge owns all of the art that it sells; it holds no items on a consignment basis

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-7 Application Requirements View Ridge application requirements: –Track customers and their artist interests –Record gallery's purchases –Record customers' art purchases –List the artists and works that have appeared in the gallery –Report how fast an artist's works have sold and at what margin –Show current inventory in a Web page

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-8 View Ridge Gallery Database Design VRG-Answers.zip

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 10-9 Creating an Oracle Database Installing Oracle: –Install Oracle 9i Client to use an already created database –Install Oracle 9i Personal Edition to create your own databasesOracle 9i Personal Edition Three ways to create an Oracle database: –Via the Oracle Database Configuration Assistant –Via the Oracle-supplied database creation procedures –Via the SQL CREATE DATABASE command

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Creating an Oracle Database: The Oracle Database Configuration Assistant

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus Oracle SQL*Plus or the Oracle Enterprise Manager Console may be used to manage an Oracle database SQL*Plus is a text editor available in all Oracle Except inside quotation marks of strings, Oracle commands are case-insensitive The semicolon (;) terminates a SQL statement The right-leaning slash (/) executes SQL statement stored in Oracle buffer SQL*Plus can be used to: –Enter SQL statements –Submit SQL files created by text editors, e.g., notepad, to Oracle

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus: Logging In to an Oracle Database

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus: The SQL+Plus Window

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus Buffer SQL*Plus keeps the current statements in a multi-line buffer without executing it LIST is used to see the contents of the buffer: –LIST {line_number} is used to change the current line CHANGE/astring/bstring/ is used to change the contents of the current line: –astring = the string you want to change –bstring = what you want to change it to Example: change/Table_Name/*/ –‘Table_Name’ is replaced with ‘*’

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus Buffer

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus LIST Command

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall SQL*Plus: Changing a Line in the Buffer

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Creating Tables Some of the SQL-92 CREATE TABLE statements we have studied need to be modified for Oracle –Oracle does not support a CASCADE UPDATE constraint –Money or currency is defined in Oracle using the Numeric data type Oracle sequences must be used for surrogate keys The DESCRIBE or DESC command is used to view table status

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Data Types

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle CREATE TABLE Statements for the View Ridge Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle CREATE TABLE Statements for the View Ridge Schema

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Sequences A sequence is an object that generates a sequential series of unique numbers: Create Sequence CustID Increment by 1 start with 1000; It is the best way to work with surrogate keys in Oracle Two sequence methods: –NextVal provides the next value in a sequence. –CurrVal provides the current value in a sequence. Using sequences does not guarantee valid surrogate key values because it is possible to have missing, duplicate, or wrong sequence value in the table

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Using Sequences Creating a sequence: CREATE SEQUENCE CustID INCREMENT BY 1 START WITH 1000; Entering data using a sequence: INSERT INTO CUSTOMER (CustomerID, Name, AreaCode, PhoneNumber) VALUES( CustID.NextVal, 'Mary Jones', '350', '555–1234'); Retrieving the row just created: SELECT * FROM CUSTOMER WHERE CustomerID = CustID.CurrVal;

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall The DROP and ALTER Statements SQL DROP statements may be used to remove structures from the database –DROP TABLE Command: Any data in the MYTABLE table will be lost DROP TABLE MyTable; –DROP SEQUENCE Command: DROP SEQUENCE MySequence; SQL ALTER statements may be used to drop (add) a column: ALTER TABLE MYTABLE DROP COLUMN MyColumn; ALTER TABLE MYTABLE ADD C1 NUMBER(4);

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall The TO_DATE Function Oracle requires dates in a particular format. TO_DATE function may be used to identify the format: TO_DATE('11/12/2002', 'MM/DD/YYYY') 11/12/2002 is the date value MM/DD/YYYY is the pattern to be used when interpreting the date The TO_DATE function can be used with the INSERT and UPDATE statements to enter data: INSERT INTO T1 VALUES( 100, TO_DATE ('01/05/02', 'DD/MM/YY');

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Creating Indexes Indexes are created to: –Enforce uniqueness on columns –Facilitate sorting –Enable fast retrieval by column values Good candidates for indexes are columns that are frequently used with equal conditions in WHERE clause or in a join Examples: CREATE INDEX CustNameIdx ON CUSTOMER(Name); CREATE UNIQUE INDEX WorkUniqueIndex ON WORK(Title, Copy, ArtistID);

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Restrictions On Column Modifications A column may be dropped at any time and all data will be lost A column may be added at any time as long as it is a NULL column To add a NOT NULL column: –Add a NULL column –Fill the new column in every row with data –Change its structure to NOT NULL: ALTER TABLE T1 MODIFY C1 NOT NULL;

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Creating Views SQL-92 CREATE VIEW command can be used to create views in Oracle Unlike SQL-92, Oracle allows the ORDER BY clause in view definitions Oracle 9i and newer verions support the JOIN…ON syntax Example: CREATE VIEW CustomerInterests AS SELECT C.Name as Customer, A.Name as Artist FROM CUSTOMER C JOIN CUSTOMER_ARTIST_INT I ON C.CustomerID = I.CustomerID JOIN ARTIST A ON I.ArtistID = A.ArtistID;

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Enterprise Manager Console The Oracle Enterprise Manager Console provides graphical facilities for managing an Oracle database The utility can be used to manage: –Database structures such as tables and views –User accounts, passwords, roles, and privileges The Manager Console includes a SQL scratchpad for executing SQL statements

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Enterprise Manager Console

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Enterprise Manager Console: ARTIST Columns and Properties

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Enterprise Manager Console: Displaying the CustomerInterests View

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Ten Part One

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Chapter Ten: Managing Databases with Oracle Part Two Database Processing: Fundamentals, Design, and Implementation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Application Logic Oracle database application can be processed using: –Programming language to invoke Oracle DBMS commands –Stored procedures –The SQL*Plus Start command to invoke database commands stored in.sql files –Triggers

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Stored Procedures A stored procedure is a PL/SQL or Java program stored within the database Stored procedures are programs that can: –Have parameters –Invoke other procedures and functions –Return values –Raise exceptions A stored procedure must be compiled and stored in the database The Execute or Exec command is used to invoke a stored procedure: Exec Customer_Insert ( ' Michael Bench ', ' 203 ', ' ', ' US ' );

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall IN signifies an input parameter; OUT signifies an output parameter; IN OUT is used for parameters with both functions Variable are declared after the keyword AS

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers An Oracle trigger is a PL/SQL or Java procedures that is invoked when a specified database activity occurs Triggers can be used to: –Set default values –Enforce a Data Constraint –Update a view –Enforce referential integrity action –Handle exceptions

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers Trigger types: –A command trigger will be fired once per SQL command –A row trigger will be fired once for every row involved in the processing of a SQL command: There are three types of row triggers: BEFORE, AFTER, and INSTEAD OF BEFORE and AFTER triggers are placed on tables while INSTEAD OF triggers are placed on views Each trigger can be fired on INSERT, UPDATE, or DELETE commands

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall This is a BEFORE trigger on INSERT on the table TRANSACTION. It is will set a default value on AskingPrice.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers: Enforcing a Required Child Constraint There is an M-M relationship between WORK and TRANSACTION:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers: Enforcing a Required Child Constraint The hard way using two triggers – this one enforces the required child:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers: Enforcing a Required Child Constraint The hard way using two triggers – this one deletes any duplicate transaction:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers: Enforcing a Required Child Constraint CREATE VIEW Work_Trans AS SELECT Title, Description, Copy, ArtistID, DateAcquired, AcquisitionPrice FROMWORK W JOIN TRANSACTION T ONW.WorkID = T.WorkID; A better way - Create the Work_Trans view:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Triggers: Enforcing a Required Child Constraint A better way using one trigger – this one works with the Work_Trans view:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall The OracleData Dictionary Oracle maintains a data dictionary of metadata. The metadata of the dictionary itself are stored in the table DICT: SELECT Table_Name, Comments FROM DICT WHERE Table_Name LIKE ( ' %TABLES% ' ); USER_TABLES contains information about user or system tables: DESC USER_TABLES;

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Example Oracle Metadata

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Concurrency Control Oracle processes database changes by maintaining a System Change Number (SCN) –SCN is a database-wide value that is incremented by Oracle when database changes are made With SCN, SQL statements always read a consistent set of values; those that were committed at or before the time the statement was started Oracle only reads committed changes; it will never reads dirty data

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Transaction Isolation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Security Oracle security components: –An ACCOUNT is a user account –A PROFILE is a set of system resource maximums that are assigned to an account –A SYSTEM PRIVILEGE is the right to perform a task –A ROLE consists of groups of PRIVILEGEs and other ROLEs

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account System Privileges Each ACCOUNT can be allocated many SYSTEM PRIVILEGEs and many ROLEs An ACCOUNT has all the PRIVILEGEs: –That have been assigned directly. –Of all of its ROLEs –Of all of its ROLEs that are inherited through ROLE connections A ROLE can have many SYSTEM PRIVILEGEs and it may also have a relationship to other ROLEs ROLEs simplify the administration of the database: –A set of privileges can be assigned to or removed from a ROLE just once

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account System Privileges: Privileges Granted to the System Account

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account Roles: Roles Granted to the System Account

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account Authentication Accounts can be authenticated by: –Passwords –The host operating system Password management can be specified via PROFILEs

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account Authentication: Password Authentication

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Account Authentication: Password Management via a Profile

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Recovery Facilities Three file types for Oracle recovery: –Datafiles contain user and system data –ReDo log files contain logs of database changes: OnLine ReDo files are maintained on disk and contain the rollback segments from recent database changes Offline or Archive ReDo files are backups of the OnLine ReDo files –Control files describe the name, contents, and locations of various files used by Oracle

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Recovery Facilities Oracle can operate in either ARCHIVELOG or NOARCHIVELOG mode: –If running in ARCHIVELOG mode, Oracle logs all changes to the database –When the OnLine ReDo files fill up, they are copied to the Archive ReDo files The Oracle Recovery Manager (RMAN) is a utility program used to create backups and to perform recovery.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Types of Failure Oracle recovery techniques depend on the type of failure: –An application failure due to application logic errors –An instance failure occurs when Oracle itself fails due to an operating system or computer hardware failure Oracle can recover from application and instance failure without using the archived log file –A media failure occurs when Oracle is unable to write to a physical file because of a disk failure or corrupted files The database is restored from a backup

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall Oracle Backup Facilities Two kinds of backups: –A consistent backup: Database activity must be stopped and all uncommitted changes have been removed from the datafiles Cannot be done if the database supports 24/7 operations –An inconsistent backup: Backup is made while Oracle is processing the database An inconsistent backup can be made consistent by processing an archive log file a/bar/bar.htmhttp:// a/bar/bar.htm

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Ten Part Two