本文摘抄自Oracle官方手册,Oracle数据库的一些概念。
About Schema
Oracle Database groups related information into logical structures called schemas. The logical structures are called schema objects.
About Schema Objects
Every Objects in an Oracle Database belongs to only one schema, and has a unique name with that schema.
Some of the objects that schemas can contain are:
-
Tables
Tables are the basic units of data storage in Oracle database. Tables hold all users-accessible data. Each table contains rows that represent individual data records.Rows are composed of columns that represent the fields of the records. -
Indexes
Indexes are optional objects that can improve the performance of data retrieval from tables. Indexes are created on one or more columns of a table and are automatically maintained in the database. -
Views
You can create a view that combines information from several different tables into a single presentation. A view can rely on information from both tables and other views. -
Sequences
When all records of a table must be distinct, you can use a sequence to generate a serial list of unique integers for numeric columns, each of which represents the ID of one record. -
Synonyms
Synonyms are aliases for schema objects. You can use synonyms for security and convenience; for example, to hide the ownership of an object or to simplify SQL statements. -
Stored subprograms
Stored subprograms are procedures and functions that are stored in the database. They can be invoked from client applications that access the database.
Triggers are stored subprograms that are automatically run by the database when specified events occur in a particular table or view. Triggers can restrict access to specific data and perform logging. -
Packages
A package is a group of related subprograms. along with the explicit cursors and variables they use, stored in the database as a unit, for continued use. Like stored subprograms, package subprograms can be invoked from client applications that access the database.
Typically, the objects that an application uses belong to the same schema.
SQL Plus
SQL Plus is an interactive and batch query tool that is installed with every Oracle Database installation. It has a command-line user interface that acts as the client when connecting to the database.
In the SQL Plus environment, you can enter and run SQL Plus commands, SQL statements, PL/SQL statements, and operations system commands to perform tasks such as:
- Formatting, performing calculations on , storing, and printing query results.
- Examining tables and object definitions.
- Developing and running batch scripts.
- Performing database administration.
About Procedural Language/SQL(PL/SQL)
Procedural Language SQL is a native Oracle Database extension to SQL. It bridges the gap between declarative and imperative program control by adding procedural elements, such as conditional control and loops.
In PL/SQL, you can declare constants and variables, procedures and functions, types and variables of those types, and triggers. You can handle exceptions.You can create PL/SQL units--Procedures, functions, packages, types, and triggers--that are stored in the database for reuse by applications that use any of the Oracle Database programmatic interfaces.
The basic unit of a PL/SQL source program is the block, which groups related declarations and statements. A block has an optional declarative part, a required executable part, and an optional exception-handling part.
网友评论