homework help on oracle

21
Homework Help On Oracle

Upload: stevenash2020

Post on 26-Feb-2016

48 views

Category:

Documents


1 download

DESCRIPTION

Homework Help On Oracle, Need Homework, assignment help in database contact urgenthomework.com. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Homework Help On Oracle

Homework Help On Oracle

Page 2: Homework Help On Oracle

What is Oracle ?

Oracle is a name of a organization which has developed many software, Operating Systems and Databases.

Here we are going to discuss about Oracle Database or Oracle DB. Oracle database is a relational database management system in

which data are treated as a unit. It is the most trusted and widely-used relational database engines.

The system of oracle database is built around a relational database framework in which data objects may be directly accessed by users through SQL (Structured Query Language).

Page 3: Homework Help On Oracle

History of Oracle 1979 Oracle Release 2 1986 client/server relational database 1989 Oracle 6 1997 Oracle 8 (object relational) 1999 Oracle 8i (Java Virtual Machine) 2000 Oracle Application Server 2001 Oracle 9i database server 2004: Oracle 10g is released (the g stands for Grid). 2007: Oracle 11g is released. 2013: Oracle 12C is released which is capable of providing cloud

services with Oracle Database.

Page 4: Homework Help On Oracle

Oracle Family Personal Oracle- for single users. Used to develop systems

Oracle Standard Edition- (Entry level Workgroup server)

Oracle Enterprise edition- Extended functionality

Oracle Lite- (Oracle mobile) single users using wireless devices.

Page 5: Homework Help On Oracle

Developer Tools

Oracle Forms Developer Oracle Reports Developer Oracle Jdeveloper Oracle Designer OEPE , Oracle Enterprise Pack for Eclipse.

Page 6: Homework Help On Oracle

Oracle Architecture

SGAShared SQL Area Database Buffer Cashe

KByte1,200,000 KByte

Redo LogBuffer

KByte2,100 KByte

PMON

LGWR

Data File Raw Device

Server

USERARCH

TL-812

Archive Log Mode(50M)

* Fixed Size : 70 Kbyte

* Variavle Size : 490 MByte

4,000,000 KByte

* Total SGA Size : 1700 Mbyte

DBW0 CKPT

SMON RECO D000 S000 P000

Page 7: Homework Help On Oracle

Memory Structure : Shared Pool

Shared Pool

Library Cache

Shared SQL Area

PL/SQL Procedures

and Package

Control Structuresfor examples;

LocksLibraryCache handlesand so on ...

Dictionary Cache

Control Structuresfor example:

Character SetConversion MemoryNetwork Security Attributes

and so on ..

Shared Pool Contents

- Text of the SQL or PL/SQL statement

- Parsed form of the SQL or PL/SQL statement - Execution plan for the SQL or PL/SQL statements - Data dictionary cache containing rows of data dictionary information Library Cache - shared SQL area - private SQL area - PL/SQL procedures and package - control structures : lock and library cache handles Dictionary Cache - names of all tables and views in the database - names and datatypes of columns in database tables - privileges of all Oracle users SHARED_POOL_SIZEReusable

RuntimeMemory

Page 8: Homework Help On Oracle

TableSpaces

A database is divided into logical storage units called Tablespaces.

logical construct for arranging different types of data.

An Oracle database must have at least a system tablespace.

It is recommended to have different tablespaces for user and system data.

Page 9: Homework Help On Oracle

Tablespaces

a logical structure

Data1 Data2

Data1_01.dbf Data2_01.dbf Data2_02.dbf

The DATA1Tablespace =One datafile

The DATA2Tablespace =Two datafiles

Page 10: Homework Help On Oracle

Create Tablespace

CREATE TABLESPACE testDATAFILE '\oraserv\ORADATA\a.dbf'SIZE 10MAUTOEXTEND ON NEXT 10M MAXSIZE 100M;

CREATE TABLE cust(id int,name varchar2(20))TABLESPACE test;

Page 11: Homework Help On Oracle

SQL(Structured Query Language)

SQL is a standard language for accessing databases. Both an ANSI and ISO standard Types of commands: Data Definition Language (DDL) : Create, Alter, Drop, Rename,

Truncate Data Manipulation Language (DML): Insert, Delete, Update Data Retrieval: Select Transaction Control: Commit, Rollback, Savepoint Data Control Language (DCL): Grant, Revoke

Page 12: Homework Help On Oracle

CourseCourseIDID

DepartmentDepartment

11 CommerceCommerce

22 ComputersComputers

33 CommerceCommerce

44 AccountantAccountant

55 ComputersComputers

SIDSID CourseCourseIDID

11 55

22 22

33 11

44 55

SIDSID NameName AgeAge

1010 MarkMark 1818

2020 SmithSmith 2222

3030 JohnJohn 1919

4040 LeeLee 2121

STUDENT

COURSE TAKES

Page 13: Homework Help On Oracle

Data Definition Language:CREATE TABLE {table}( {column datatype [DEFAULT expr] [column_constraint] ... | table_constraint} [, { column datatype [DEFAULT expr] [column_constraint] ... )

ALTER TABLE {table}[ADD|MODIFY {column datatype [DEFAULT expr] [column_constraint]} [DROP drop_clause]

DROP TABLE {table} [cascade constraints]

DESC {table}

Page 14: Homework Help On Oracle

Example :CREATE TABLE Students(sid INTEGER,name VARCHAR(20), age INTEGER);

CREATE TABLE Courses( courseid CHAR(6),department CHAR(20));

CREATE TABLE takes( sid CHAR(9),courseid CHAR(6));

Page 15: Homework Help On Oracle

Data Manipulation Language:

INSERT INTO {table | view} [ (column [, column] ...) ] VALUES (expr,expr ...)

UPDATE {table | view }SET { (column [, column] = { expr | } [WHERE condition]

DELETE [FROM] {table | view} [WHERE condition]

Page 16: Homework Help On Oracle

Example: INSERT INTO Students VALUES (10,’Mark’,18);

INSERT INTO Students VALUES (20,’smith’,22);

INSERT INTO Students VALUES (30,’John’,19);

INSERT INTO Students VALUES (40,’Lee’,21);

Page 17: Homework Help On Oracle

Data Retrieval:

SELECT [DISTINCT | ALL] {table|view}FROM {table | view}[WHERE condition ] [GROUP BY expr [, expr]] [ORDER BY {expr} [ASC | DESC]]

Page 18: Homework Help On Oracle

Example:

select * from student;select name from student where sid='10';select courseid from course where department=‘computer’; Select a.sid from takes a, student b where a.sid=b.sid;

Page 19: Homework Help On Oracle

Transaction Control:

COMMIT

ROLLBACK [ to {savepoint}]

SAVEPOINT {name}

commit;

savepoint point5;

rollback to point5;

Page 20: Homework Help On Oracle

Data Control Language:

GRANT [privileges]ON object TO user|public[WITH GRANT OPTION]

REVOKE [privileges]ON object TO user|public[CASCADE CONSTRAINTS]

grant select,update on student to XYZ ;

revoke update on student to XYZ;

Page 21: Homework Help On Oracle

For Further Informatiom: Read more about oracle Database:

http://www.urgenthomework.com/oracle-10g-and-11g.php