Oracle 8i User Guide for CS2312

Similar documents
Oracle User Administration

CHAPTER. Oracle Database 11g Architecture Options

Chapter 14 Data Dictionary and Scripting

"Charting the Course... Oracle 18c DBA I (3 Day) Course Summary

"Charting the Course... Oracle 18c DBA I (5 Day) Course Summary

Lab # 1. Introduction to Oracle

Creating and Managing Tables Schedule: Timing Topic

Getting started with Oracle

Database System Concepts and Architecture

ORACLE VIEWS ORACLE VIEWS. Techgoeasy.com

2. Software Oracle 12c is installed on departmental server machines.

Explore the Oracle 10g database architecture. Install software with the Oracle Universal Installer (OUI)

Database Architecture 1

Definitions. Database Architecture 1. Database Schema. Database Instance. Data Item (Schema Construct) The description of a database.

Create A Private Database Link In Another Schema In Oracle 11g Drop >>>CLICK HERE<<<

Course Description. Audience. Prerequisites. At Course Completion. : Course 40074A : Microsoft SQL Server 2014 for Oracle DBAs

Oracle Database: Introduction to SQL Ed 2

Oracle 12C DBA Online Training. Course Modules of Oracle 12C DBA Online Training: 1 Oracle Database 12c: Introduction to SQL:

Oracle Database 11g for Experienced 9i Database Administrators

How To Drop All Tables In A Schema In Oracle 10g

Security Mechanisms I. Key Slide. Key Slide. Security Mechanisms III. Security Mechanisms II

ORACLE 11gR2 DBA. by Mr. Akal Singh ( Oracle Certified Master ) COURSE CONTENT. INTRODUCTION to ORACLE

select Name, a.card.extract('/acard/ /text()').getstringval() from addr_book a where a.card.existsnode('/acard') = 1

Database Administration. Database Administration CSCU9Q5. The Data Dictionary. 31Q5/IT31 Database P&A November 7, Overview:

Oracle Database: SQL and PL/SQL Fundamentals

Introduction to Databases

ORACLE DBA TRAINING IN BANGALORE

Oracle Database: Introduction to SQL

Survey of Oracle Database

Introduction to Computer Science and Business

Course 40045A: Microsoft SQL Server for Oracle DBAs

Course: Oracle Database 12c R2: Administration Workshop Ed 3

CO MySQL for Database Administrators

Database Programming with SQL

Oracle Database 12c R2: Administration Workshop Ed 3 NEW

Hubble Technical Mirroring Overview

Oracle SQL & PL SQL Course

ROLLBACK SEGMENTS. In this chapter, you will learn about: Rollback Segment Management Page 272

Managing PostgreSQL on Windows

ORACLE DBA I. Exploring Oracle Database Architecture

Oracle Database 12c R2: Administration Workshop Ed 3

B. Verification is completed by the DBA using the database verification toolkit.

GFC_ARCH_MGMT: SEGMENT MANAGEMENT UTILITY PACKAGE

Managing the Database

ORANET- Course Contents

Oracle Database: Introduction to SQL

Course Outline and Objectives: Database Programming with SQL

AO3 - Version: 2. Oracle Database 11g SQL

LECTURE1: PRINCIPLES OF DATABASES

Oracle Database Gateway for DRDA

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Oracle Database 11g: Introduction to SQLRelease 2

COURSE CONTENT. ORACLE 10g/11g DBA. web: call: (+91) / 400,

Course Contents of ORACLE 9i

Database Administration and Management

[Contents. Sharing. sqlplus. Storage 6. System Support Processes 15 Operating System Files 16. Synonyms. SQL*Developer

INTRODUCTION TO DATABASE

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

Get Oracle Schema Ddl Syntax With Dbms_metadata

Quest Code Tester for Oracle 3.1. Installation and Configuration Guide

Oracle Database Vault

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2-1

Kintana Object*Migrator Installation Guide. Version 5.1 Publication Number: OMInstall-1203A

A database management system (DBMS) is a software package with computer

Technical White Paper August Migrating to Oracle 11g Using Data Replicator Software with Transportable Tablespaces

Getting Started With Oracle

Veritas NetBackup for Microsoft SQL Server Administrator's Guide

Copy Table From One Database To Another Sql

ORACLE DATABASE 12C INTRODUCTION

Alter Change Default Schema Oracle Sql Developer

Oracle Database: Introduction to SQL

MySQL for Database Administrators Ed 3.1

Oracle Database 10g: Introduction to SQL

Change Database Default Schema Sql Server Set User

Using SQL Developer. Oracle University and Egabi Solutions use only

Introduction to database administration

Full file at

Oracle - Oracle Database 12c R2: Administration Workshop Ed 3

1. Data Model, Categories, Schemas and Instances. Outline

Appendix A Practices and Solutions

Pl Sql Copy Table From One Schema To Another

Projects. Corporate Trainer s Profile. CMM (Capability Maturity Model) level Project Standard:- TECHNOLOGIES

Oracle Tables TECHGOEASY.COM

Database Management Systems

Rampant TechPress. Oracle DBA made simple Oracle database administration techniques. Mike Ault

Oracle8i. Release Notes

Oracle Database 12c SQL Fundamentals

Table of Contents. Oracle SQL PL/SQL Training Courses

Oracle Database Backup And Recovery Advanced User's Guide 11g Pdf

Oracle ILM Assistant Installation Guide Version 1.4

Database Architectures

Oracle Way To Grant Schema Privileges All Tables

DATA MANAGEMENT SPECIALIST I DATA MANAGEMENT SPECIALIST II

Oracle DBA Course Content

DB2 for Linux, UNIX, Windows - Adv. Recovery and High Availability

Relational Database Management Systems Oct/Nov I. Section-A: 5 X 4 =20 Marks

Oracle Database Gateway for DRDA User's Guide. 12c Release 2 (12.2)

INSTALL GUIDE BIOVIA INSIGHT 2.6

To create a private database link, you must have the CREATE

2. Recovery models ->

Transcription:

Oracle 8i User Guide for CS Carole Goble. Introduction Oracle is a relational database management system that uses SQL as its data manipulation language. Information on SQL is given separately to these notes. These notes are a fast-start to the way we will use Oracle in the labs and supplement the SQL*Plus User's Guide and Reference manual available on the web. The Oracle database resides on a server. This is where the binaries are and your databases. Your database tables DO NOT reside in your own file store and can only be accessed by using an Oracle tool. When you log onto a machine and start an Oracle tool the server must be notified to serve the tool to your machine. This can be slow. However, once the tool is loaded onto the client it runs the program locally so this is faster. Once you have started a tool don't close it down unless you are finished. You will be developing your database implementations in pairs. To avoid confusion and wasted disk space do not create multiple tables with the same things in them. There should only be one team database, looked after by one person and the other should be granted permission to use that database (see later on how to do that).. Oracle. Oracle Architecture Oracle, very simplistically, can be viewed as having a nested architecture (figure ) SQL*Loader Pro* SQL*Plus SQL*Forms 4.5 SQL Dictionary Kernel Designer 000 WebDB PL/SQL Utilities Cartridges SQL*Net Figure : Basic architecture of Oracle.. The Kernel The internal code that communicates with the database, and handles all the facilities of DBMS: retrieval, recovery etc. It also optimises request execution to be more efficient, and deals with the accelerators and physical data storage exploiting the facilities of the host operating system, which in our case is Unix... The Data Dictionary

Describes in detail the Oracle objects. It is used for documentation and management of the objects. Holds the schema of the tables and views. The description of database objects is often called metadata (data about data). The dictionary is a set of tables and views manipulated through SQL. Users can look at the content of the tables through a series of views. Only the DBA can actually manipulate the dictionary directly (see figure )... SQL layer The interface between the kernel and the tools of the external layer. Every access operation to the data is expressed in SQL. SQL commands include: Data Definition commands to define the schema; Data Manipulation commands to manipulated the contents of the schema; Data Control commands to grant users privileges and access rights. Significant contents View View View Users can look at these Coded contents DBA can manipulate these Description of objects in the database Figure : The Data Dictionary..4 The External Layer A set of tools that enable all the facilities provided by the three basic underlying layers to be used easily. It is an applications development environment. We will only use SQL*Plus. This is the interactive interface to SQL, so you can put SQL commands directly to the database. Has a work environment that can be parameterise; has commands for the formatting of results and commands to store SQL and SQL*Plus commands in files.

. Oracle objects Oracle manipulates many objects, of which we are interested in five: s Views Integrity constraints Users and their privileges Accelerators on tables (indexes, clusters) -- these are data structures which give a fast access path to tables, a bit like an index in a book. See Chapters 4 & 5 of Elmasri and Navathe. We will cover these later in the course. In Oracle, a user cannot explicitly define an object called a database; a user s database is the set of tables and views that a user has access privileges to. A user may access table and views other than those created by themselves by prefixing them with the name of that user, provided they have been granted the privilege of doing so. user user user view view view table table table Cluster Index Figure : Objects manipulated by Oracle In Figure, user has created two tables, table and table, and a view view. The two tables are grouped in the same cluster, which means that they are stored internally close together on the disk because they are often accessed together. This same user can access table table via view view. User has created a table table, which uses an index (a data structure which makes accessing data in it faster), and two views view and view on this table. Finally user has created no table or view, but has the privilege of accessing table table by prefixing it with the name of user... User Privileges Users are defined by a name (which is unique), a password and a set of privileges. You have all been given the privilege to create, modify and delete database objects (called RESOURCE privilege).the way you will build tables for your databases is as follows:. Design your tables

4. One of your team, user A, creates the tables. User A grants permission to the other member of the pair, user B, the privilege to access the tables using the SQL GRANT statement 4. User B will have to use user A s tables by prefixing the table name with user A s oracle user name. To get round this, users B should create SYNONYMS for user A s tables and views. 5. All users can create views, and organise which users have permission to use the views... Databases and spaces The way Oracle has been set up on the SUN server is on a disk local to it. There is only one Database, run by the Data Base Administrator. The database is divided into six tablespaces. spaces are partitions where Oracle objects are stored. First year users are given permission to create objects in tablespace cags_course. space SYSTEM is where the Data Dictionary is held (figure 4). Database space project space staff space system space cags_course space msc Figure 4: spaces 4

5. Running SQL commands Oracle requires each user to be registered as a user of Oracle with a user name and a password. This is separate to the Unix system. However, we have set up your Oracle username and password to be the same as your Unix ones automatically. All of the Oracle paths, environment variables and aliases should have been set up automatically with your account. If you have any problems using a command (for example the command cannot be found ) then contact the lab supervisor. Sometimes SQL commands refer to the user name of an Oracle user. Usually your user name will be the same as the Unix one. There are two types of commands: SQL commands: the commands for controlling, defining, manipulating and querying the database tables. The SQL Language Reference Manual is the complete manual of the whole of the Oracle SQL language. The SQL language is used for creating, manipulating, updating, querying and deleting your tables and the data dictionary tables. It is very useful and is available on the web. For CS you can ignore any statement that has the following keywords when referring to the manual: Rollback, Databases, spaces, Storage and blocks, Clusters and indexes, Distributed. SQL*Plus commands: additional commands governing the SQL*Plus environment, formatting or results and measuring performance. The complete manual is on the web. I have included in these notes the basics with a page number of the Guide for further details. When reading this Guide ignore any reference to PL/SQL and SQL*Forms. Oracle is not case-sensitive, which means you can use upper or lower case for commands, names of tables and so on, but Oracle won t tell any difference between STUDENT, Student or student. 6. Backing Up We do keep a backup. However, for an immediate fix if you muck up a relation is to use a SQL batch file to create tables, and a SQL batch file for loading the tuples. Then keep these files in a safe place in the teams collective file store. Then, if all goes wrong you can rebuild from scratch. Otherwise you will have to ask the DBA to restore your table which is rather difficult. To compress these files so they use up less of your filestore quota, look at the Unix commands compress and uncompress. 7. The Oracle Catalog and Data Dictionary Oracle has a data dictionary containing all the management information on the objects in the database. You cannot alter this dictionary directly, but you can look at it: the data 5

6 is held as tables so the usual SQL commands work. Appendix B of the Oracle8 Server Administrator s Guide has a list of all the Data Dictionary Views and the Oracle reserved words. The most interesting Data Dictionary Views for you are: ALL_CATALOG ALL_CONSTRAINTS ALL_CONS_COLUMNS ALL_SYNONYMS ALL_TABLES ALL_VIEWS DICTIONARY (or DICT) TABLE_PRIVILEGES USER_CATALOG (or CAT) USER_COL_PRIVS USER_COL_PRIVS_MADE USER_COL_PRIVS_RECD USER_CONSTRAINTS USER_CONS_COLUMNS USER_SYNONYMS USER_TABLES USER_TAB_COLUMNS USER_TAB_PRIVS USER_TAB_PRIVS_MADE USER_TAB_PRIVS_RECD USER_USERS USER_VIEWS s, views, synonyms accessible to the user Constraints on tables accessible to the user Information about accessible columns in constraint definitions Synonyms accessible to the user s accessible to the user. This gives more information than ALL_CATALOG Views accessible to the user Data Dictionary tables and views Grants on objects for which the user is the grantor, grantee or owner, or PUBLIC is the grantee s, views, synonyms and sequences owned Grants on columns for which the user is the owner, grantor or grantee Grants on columns of objects owned by the user Grants on columns for which the user is grantee Constraints owned by the user Columns in constraints owned by the user The user s private synonyms s owned by the user Columns of the user s tables, views and clusters Grants on objects for which the user is the owner, grantor or grantee Grants on objects owned by the user Grants on objects for which the user is the grantee Privileges of the current user Views owned by the user 6