首页 热点资讯 义务教育 高等教育 出国留学 考研考公
您的当前位置:首页正文

【ORACLE】DDL包括哪些操作

2023-11-13 来源:华拓网

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 CREATEALTER, or DROP.

  • Delete all the data in schema objects without removing the structure of these objects (TRUNCATE).

  •  
  • Unlike DELETETRUNCATE generates no undo data, which makes it faster than DELETE. Also, TRUNCATE does not invoke delete triggers

  • Grant and revoke privileges and roles (GRANTREVOKE).

  • Turn auditing options on and off (AUDITNOAUDIT).

  • 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.

    【ORACLE】DDL包括哪些操作

    标签:access   for   tin   sub   example   row   update   ora   int   

    小编还为您整理了以下内容,可能对您也有帮助:

    oracle中DDL DML指什么?

    DDL
    create table 创建表
    alter table 修改表
    drop table 删除表
    truncate table 删除表中所有行
    create index 创建索引
    drop index 删除索引
    当执行DDL语句时,在每一条语句前后,oracle都将提交当前的事务。如果用户使用insert命令将记录插入到数据库后,执行了一条DDL语句(如create table),此时来自insert命令的数据将被提交到数据库。当DDL语句执行完成时,DDL语句会被自动提交,不能回滚。

    DML
    insert 将记录插入到数据库
    update 修改数据库的记录
    delete 删除数据库的记录
    当执行DML命令如果没有提交,将不会被其他会话看到。除非在DML命令之后执行了DDL命令或DCL命令,或用户退出会话,或终止实例,此时系统会自动发出commit命令,使未提交的DML命令提交。

    oracle中DDL DML指什么?

    DDL
    create table 创建表
    alter table 修改表
    drop table 删除表
    truncate table 删除表中所有行
    create index 创建索引
    drop index 删除索引
    当执行DDL语句时,在每一条语句前后,oracle都将提交当前的事务。如果用户使用insert命令将记录插入到数据库后,执行了一条DDL语句(如create table),此时来自insert命令的数据将被提交到数据库。当DDL语句执行完成时,DDL语句会被自动提交,不能回滚。

    DML
    insert 将记录插入到数据库
    update 修改数据库的记录
    delete 删除数据库的记录
    当执行DML命令如果没有提交,将不会被其他会话看到。除非在DML命令之后执行了DDL命令或DCL命令,或用户退出会话,或终止实例,此时系统会自动发出commit命令,使未提交的DML命令提交。

    oracle中的DML,DDL,DCL操作分别指的什么,请通俗点。

    这几个词不是Oracle专有的词。

    DML----Data Manipulation Language 数据操纵语言

    如insert,delete,update,select(插入、删除、修改、检索)

    DDL----Data Definition Language 数据库定义语言

    如 create procere之类

    DCL----Data Control Language 数据库控制语言

    如grant,deny,revoke等,只有管理员才有这样的权限。

    什么是 DDL 语言?其中包括哪些语句?

    DDL一般指数据定义语言。

    数据库模式定义语言DDL(Data Definition Language),是用于描述数据库中要存储的现实世界实体的语言。

    常见的DDL语句:

    创建数据库CREATE DATABASE、创建数据库表格CREATE TABLE、修改数据库表格ALTER TABLE、删除数据库表格DROP TABLE、创建查询命令CREATE VIEW、修改查询命令ALTER VIEW、删除查询命令DROP VIEW、删除数据表内容TRUNCATE TABLE。

    扩展资料:

    数据定义语言(Data Definition Language, DDL) 是SQL语言集中负责数据结构定义与数据库对象定义的语言,由CREATE、ALTER与DROP三个语法所组成。

    最早是由 Codasyl (Conference on Data Systems Languages)数据模型开始,现在被纳入 SQL 指令中作为其中一个子集。

    大多数的DBMS都支持对数据库对象的DDL操作,部份数据库 (如 PostgreSQL) 可把DDL放在交易指令中,也就是它可以被撤回 (Rollback)。较新版本的DBMS会加入DDL专用的触发程序,让数据库管理员可以追踪来自DDL的修改。

    参考资料来源:百度百科——DDL

    显示全文