190 likes | 415 Views
Oracle seminar. Presented by Dimitar Dimitrov 29.11.2001 Dimitar.Dimitrov@Semantec.bg For Course: Modern Software Technologies. Agenda :. What is Oracle Oracle and otherwise Certification Oracle & Internet How Oracle works Oracle indexes PL/SQL
E N D
Oracle seminar Presented by Dimitar Dimitrov 29.11.2001 Dimitar.Dimitrov@Semantec.bg For Course: Modern Software Technologies
Agenda : • What is Oracle • Oracle and otherwise • Certification • Oracle & Internet • How Oracle works • Oracle indexes • PL/SQL • Stored Procedures • Oracle Packages
Certification • Oracle Java DeveloperCertification TrackThe Oracle Java Developer certification track is comprised of five tests that cover three progressive skill levels. • 1). Sun Certified Programmer for the Java Platform (1 exam)Fundamental skills in the Java Programming language • 2). Oracle Certified Solution Developer - JDeveloper (2 exams)Application development for the Java Platform • 3). Oracle Certified Enterprise Developer-Oracle iPlatform (2 exams)Enterprise development with an application server • Pricing and RegistrationOCP exams are offered at Authorized Prometric Testing Centers worldwide. The cost of each exam is US$125. Pricing is subject to change.
How Oracle Works • Physical database structure • Logical Database Structures • The logical structures of an Oracle database include tablespaces, schema objects, data blocks, extents, and segments. • Tablespaces • A database is divided into logical storage units called tablespaces, which group related logical structures together. • For example, tablespaces commonly group all of an application's objects to simplify some administrative operations.
How Oracle Works Schemas and Schema Objects A schema is a collection of database objects. Schema objects are the logical structures that directly refer to the database's data. Schema objects include such structures as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links.
Oracle Indexes Parser • The parser performs two functions: • Syntax analysis: This checks SQL statements for correct syntax. • Semantic analysis: This checks, for example, that the current database objects and object attributes referenced are correct. • Optimizer • The optimizer is the heart of the SQL processing engine. The Oracle server provides two methods of optimization: rule-based optimizer (RBO) and cost-based optimizer (CBO). • Row Source Generator • The row source generator receives the optimal plan from the optimizer. It outputs the execution plan for the SQL statement. The execution plan is a collection of row sources structured in the form of a tree. A rowsource is an iterative control structure. It processes a set of rows, one row at a time, in an iterated manner. A row source produces a row set.
Oracle Indexes SQL Execution • SQL execution is the component that operates on the execution plan associated with a SQL statement. It then produces the results of the query. • Create Indexes when select a small percentage of rowsfrom a table • Indexes are logically and physically independent of the data in the associate table. • Required CREATE ANY INDEX system privilege for creating index
Oracle Indexes Advices
PL/SQL • PL/SQL is Oracle's procedural language extension to SQL. PL/SQL combines the ease and flexibility of SQL with the procedural functionality of a structured programming language, such as IF ... THEN, WHILE, and LOOP. • When designing a database application, a developer should consider the advantages of using stored PL/SQL: • Because PL/SQL code can be stored centrally in a database, network traffic between applications and the database is reduced, so application and system performance increases. • Data access can be controlled by stored PL/SQL code. In this case, the users of PL/SQL can access data only as intended by the application developer (unless another access route is granted). • PL/SQL blocks can be sent by an application to a database, executing complex operations without excessive network traffic. • Even when PL/SQL is not stored in the database, applications can send blocks of PL/SQL to the database rather than individual SQL statements, thereby again reducing network traffic.
Store Procedures • Procedures and functions consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks. A procedure is created and stored in compiled form in the database and can be executed by a user or a database application. • Procedures and functions are identical except that functions always return a single value to the caller, while procedures do not return values to the caller. • Examples :
Store Procedures • createorreplaceprocedure SST(Name intype, • Name inouttype, • ...) • isbegin…end SST; • createorreplacefunction SST(Name intype, • Name in type, • ...) • return type is • Result type; • begin • … • return(Result); • end SST;
Oracle Packages • Packages provide a method of encapsulating and storing related procedures, functions, variables, and other package constructs together as a unit in the database. While packages allow the administrator or application developer the ability to organize such routines, they also offer increased functionality (for example, global package variables can be declared and used by any procedure in the package) and performance (for example, all objects of the package are parsed, compiled, and loaded into memory once). • Examples :
Oracle Packages • createorreplacepackage SST is-- Public type declarationstype <TypeName> is <Datatype>;-- Public constant declarations <ConstantName> constant <Datatype> := <Value>;-- Public variable declarations <VariableName> <Datatype>;-- Public function and procedure declarationsfunction <FunctionName>(<Parameter> <Datatype>) return <Datatype>;end SST;
Oracle Packages • create or replace package body SST is • -- Private type declarations • type <TypeName> is <Datatype>; • -- Private constant declarations • <ConstantName> constant <Datatype> := <Value>; • -- Private variable declarations • <VariableName> <Datatype>;
Oracle Packages • -- Function and procedure implementations • function <FunctionName>(<Parameter> <Datatype>) return <Datatype> is • <LocalVariable> <Datatype>; • begin • <Statement>; • return(<Result>); • end; • begin • -- Initialization • <Statement>; • end SST;
Links • http://www.oracle.com/ • Oracle University • PL/SQL Help and Tutorial