ORACLEDDL包括哪些操作
Posted cl-learning
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLEDDL包括哪些操作相关的知识,希望对你有一定的参考价值。
(一) Data Manipulation Language (DML) Statements
Data manipulation language (DML) statements query or manipulate data in existing schema objects.
Whereas DDL statements change the structure of the database, DML statements query or change the contents. For example, ALTER TABLE
changes the structure of a table, whereas INSERT
adds one or more rows to the table.
DML statements are the most frequently used SQL statements and enable you to:
-
Retrieve or fetch data from one or more tables or views (
SELECT
). -
Add new rows of data into a table or view (
INSERT
) by specifying a list of column values or using a subquery to select and manipulate existing data. -
Change column values in existing rows of a table or view (
UPDATE
). -
Update or insert rows conditionally into a table or view (
MERGE
). -
Remove rows from tables or views (
DELETE
). -
View the execution plan for a SQL statement (
EXPLAIN
PLAN
). -
Lock a table or view, temporarily limiting access by other users (
LOCK
TABLE
).
DML statements do not implicitly commit the current transaction.
(二) Data Definition Language (DDL) Statements
Data definition language (DLL) statements define, structurally change, and drop schema objects.
DDL enables you to alter attributes of an object without altering the applications that access the object. For example, you can add a column to a table accessed by a human resources application without rewriting the application. You can also use DDL to alter the structure of objects while database users are performing work in the database.
More specifically, DDL statements enable you to:
-
Create, alter, and drop schema objects and other database structures, including the database itself and database users. Most DDL statements start with the keywords
CREATE
,ALTER
, orDROP
. -
Delete all the data in schema objects without removing the structure of these objects (
TRUNCATE
).
-
Unlike
DELETE
,TRUNCATE
generates no undo data, which makes it faster thanDELETE
. Also,TRUNCATE
does not invoke delete triggers -
Grant and revoke privileges and roles (
GRANT
,REVOKE
). -
Turn auditing options on and off (
AUDIT
,NOAUDIT
). -
Add a comment to the data dictionary (
COMMENT
).
DDL statements implicitly commit the preceding and start a new transaction.
(三) Transaction Control Statements
Transaction control statements manage the changes made by DML statements and group DML statements into transactions.
These statements enable you to:
-
Make changes to a transaction permanent (
COMMIT
). -
Undo the changes in a transaction, since the transaction started (
ROLLBACK
) or since a savepoint (ROLLBACK TO SAVEPOINT
). A savepoint is a user-declared intermediate marker within the context of a transaction.
-
Set a point to which you can roll back (
SAVEPOINT
). -
Establish properties for a transaction (
SET
TRANSACTION
). -
Specify whether a deferrable integrity constraint is checked following each DML statement or when the transaction is committed (
SET CONSTRAINT
).
(四) Session Control Statements
Session control statements dynamically manage the properties of a user session.
A session is a logical entity in the database instance memory that represents the state of a current user login to a database. A session lasts from the time the user is authenticated by the database until the user disconnects or exits the database application.
Session control statements enable you to:
-
Alter the current session by performing a specialized function, such as setting the default date format (
ALTER SESSION
). -
Enable and disable roles, which are groups of privileges, for the current session (
SET ROLE
).
Session control statements do not implicitly commit the current transaction.
(五) System Control Statement
A system control statement changes the properties of the database instance.
- The only system control statement is
ALTER SYSTEM
. It enables you to change settings such as the minimum number of shared servers, terminate a session, and perform other system-level tasks.
The ALTER SYSTEM
statement does not implicitly commit the current transaction.
以上是关于ORACLEDDL包括哪些操作的主要内容,如果未能解决你的问题,请参考以下文章
急求c++代码。。。大数运算,包括(+ - * / %),用类实现。。。