Вы находитесь на странице: 1из 27

Oracle10g

Index
1.Introduction of Oracle10g
2.Architecture of Oracle 10g
3 Installation process
4.Databases(Table,Index,Tablespaces)
5.VPD(Virtual Private Database)
6.PL/SQL(Limitation,adv.,DDL,DML)
7.PL/SQL Vs. SQL*Plus.
8.Conclusion.
Introduction of Oracle10g

Grid controls and integrates different resources and


users within different control domains- for example
desktops versus large computers, different units of same
enterprise and different enterprise. It also addresses the
issues of security,policy,membership and payment.
Grid Architecture

User Applications
Tools and Applications

Collective Services Directory brokering


Diagnostics and
monitoring
Resources & connectivity
Protocols Secure Access to
Resources and services

Fabric Diverse resources such as


computers,storage,media networks
and sensors
Installation process
 Oracle Universal Installer (OUI) is used to install and
manage all Oracle components for both the server-side
and client-side.Deinstall any Oracle products can be made
from initial OUI screens.

In Oracle Database 10g, Automatic Storage Management


(ASM) is used to simplify storage management.

 For Unix environments we need to set a proper value for


the DISPLAY environment variable and enable xhost prior
to starting OUI via the run Installer script.
Object-Relational Features of Oracle

 Defining Types-describe,create,grant,union
 Dropping Types-droping tables,views,synonym.
 Constructing Objects –insert,select,update.
 Methods-number function and number procedure in the create type statement.
 Queries Involving Types-union,intersect,except
 Declaring Types For Relations –joins.
 References -constraints
 Nested Tables
 Nested Tables of References
 Converting Relations to Object-Relations
Databases and Instances

Inside the Oracle Database,the basic structure is table.


Oracle Database 10g supports many types of tables.

 Relational tables
 Object- relational tables
 Index- organized tables
 External tables
 Partitioned tables
 Materialized views
 Temporary tables
 Clustered tables
 Dropped tables
WEATHER LOCATION

City Temp Humid Condition


City Country
ATHENS 97 89 SUNNY
ATHENS GREECE
CHICAGO 66 88 RAIN
CHICAGO UNITED STATES
LIMA 45 79 RAIN
CONAKRY GUINEA
MANCHESTER 66 98 FOG
LIMA PERU
PARIS 81 62 CLOUDY
MADRAS INDIA
SPARTA 74 63
MANCHESTER ENGLAND
CLOUDY
PARIS FRANCE
SYDNEY 69 99 SUNNY
SYDNEY AUSTRALIA
Relationship

The city name in one table is related to the city name in the other .
This relationship is the basis for the name relational database.
DATA DICTIONARY

This is a collection of tables and related views that enables us to


see the inner workings and structure of the Oracle Database.
The views divided into three categories:

 USER_
 ALL_
 DBA_
DATABASE OBJECTS

 TABLE  STORED PROCEDURES &


PACKAGES
 INDEXES
 USER DEFINED DATA TYPES
 VIEWS
 TABLESPACES
 SYNONYMS  CONSTRAINTS
 SEQUENCES
 PARTITIONS
 CLUSTERS
Beyond the Basics

 Virtual Private Database (VPD):This advance feature attach


security policies directly to tables,views and synonyms.

 Security condition had been set-up for VPD.

 VPD can be applied to Select,Insert,Update,Index & Delete


command.
Procedural Language/SQL
 PL/SQL (Procedural Language/SQL) is a procedural
extension of Oracle-SQL that offers language constructs
similar to those in imperative programming languages.

 PL/SQL allows its user to develop complex database


applications that require the usage of control structure and
procedural elements such as procedures,function,modules
etc.
 PL/SQL supports many enhancement of oracle10g
including LOB(large objects),Object oriented design and
development, collections and advanced facility.
Architecture of PL/SQL
 It has own processing PL/SQL Block in the
engine that executes
PL/SQL blocks and application program
subprogram.
 This can be installed in the
server or any development
tools . PL/SQL Engine
 If host program does not
have PL/SQL engine the
block of code are send to SQL statement executor
the Oracle server for
processing. Oracle server
Limitations of SQL

 No procedural capabilities-SQL doesn't offer any procedural


facilities/capabilities such as condition testing,looping,branching
which are necessary for conventional programming languages.

 Time consuming processing-All SQL statement are executed by


database server or oracle Engine.SQL statement are passed one
at a time.Therefore more traffic means slower data processing
speed.

 No error handling routines/procedures-while processing SQL


statements, if an error occurs knows no way to handle these
error.
Advantage of PL/SQL

 Support for SQL


 Higher productivity
 Better performance
 Portability
 Integration with Oracle10g.
Different datatype:

 A scalar data type, atomic datatype,made up of other


datatype.Examples of Scalar datatype in PL/SQL-
Char,Varchar2,Date,Boolean,Long etc.

 A composite datatype made up of other datatypes.Have


internal component that can be used/manipulated easily.
Examples RECORD,TABLE AND VARRAY.
SQL FUNCTIONS

 UPPER & LOWER


 MAX & MIN
 SUM & AVG
 COUNT & POWER
 ABS & SQRT
 ROUND and TRUNC
 SUBSTR & SOUNDEX
 LTRIM & RTRIM
Elementary Conversion Functions

 TO_CHAR Transforms a DATE or NUMBER into a


character string.

 TO_DATE Transforms a NUMBER,CHAR or VARCHAR2


into a DATE.

 TO_NUMBER Transforms a CHAR or VARCHAR2 into a


NUMBER.
Type of expressions

Pl/SQL variables are held together via expressions and operators.


Expressions can be of many types as explained below:

 Arithmetic or Numeric expressions- 10*20+30/2;


 Boolean expressions- ’Scott LIKE’sc%f
 String expressions- LENGTH(‘NEW YORK’||’NY’)
 Date expressions- SYSDATE>TO_DATE(’15-NOV-61’,”DD-
MON-yy”)
DML(Data Manipulation Language)

DML includes commands like-


 SELECT
 INSERT
 DELETE
 UPDATE
 COMMIT
 ROLL BACK
DDL(Data definition Language.)

DDL includes –
 Create table
 Describe table
 Alter table
 Drop table
 Create index
 Drop index
 Grant
 Union
Transaction in PL/SQL

A transaction is a logical unit of work(LUW) composed of


DDL and DML statements. There are three transaction
specifications available in PL/SQL.These are:
 Commit
 Savepoint
 Rollback
Commit-saves all outstanding changes.
Savepoint-establish a Savepoint which allows to perform
partial ROLLBACKS.
Rollback-erases all changes since last commit.
Roll back to save point save
point B

Roll back to Save point Save point A

Roll back

Insert Delete save update delete save Insert


COMMIT

COMMENT
WORK
‘TEXT’

Savepoint
Savepoint

ROLLBACK
TO SAVEPOINT
WORK
SAVEPOINT
PL/SQL support cursors

There are two types of cursors in PL/SQL

 Implicit cursor: All DML and all PL/SQL including queries


and return only one row.

 Explicit cursor: For queries that return more than one row.
Declared and named by the programmer.
Trigger

 A trigger is a stored procedure that defines an action the


database should take when some database-related
events(such as inserts,updates,deletes)occurs.

 Database trigger is a set of PL/SQL statements that


execute each time an event such as an Update,Insert,or
Delete statement occurs on the database.
PL/SQL VS. SQL*plus

PL/SQL does not support interactive input and output.


Therefore we need a tool like SQL*plus to use PL/SQL.

In SQL*plus we can use PL/SQL in following ways.


 To input, store and run PL/SQL block.
 To create, load and run script containing PL/SQL block.
 To call a store procedure.

This starts with DECLARE or BEGIN.BEGIN is used as


starting point .Instruct SQL*plus to clear SQL buffer.
To execute PL/SQL block stored in the buffer SQL*PLUS. RUN
command can be used.
COMMAND: SQL>Run or SQL>/
Conclusion

Oracle can easily be used for simple operation such a


entering data and running standard reports.Oracle10g
provides some advanced feature and higher security label.
By the installation of oracle software 10g one can create
complex queries, create table, insert, update and delete
data.

Вам также может понравиться