What is DDL? What is DML

What is DDL?

DDL stands for Data Definition Language. DDL statements can :

  • Create, alter, or drop database objects.
  • Enable you to manage privileges and roles by performing grant or revoke.
  • Truncate all data.
  • Enable you to manage auditing options by using Audit or Noaudit

You can perform most of DDLs in Oracle while database users running their jobs on the database.
An implicit COMMIT occurs immediately before the database executes a DDL statement and a COMMIT or ROLLBACK occurs immediately afterward. (Oracle Database Concepts 11gR2 official doc.)

Both System control statements (Alter System) and Session control statements (Alter Session) are examples for DDL but both of them do not perform implicit COMMIT.
Lets look :

From Session 1 :

SQL> create table t3 (i number);

Table created.

SQL> insert into t3 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t3;

I
----------
1

From Session 2 :

SQL> select * from t3;

I
----------
1

From Session 1 :

SQL> insert into t3 values (2);

1 row created.

SQL> alter system switch logfile;

System altered.

SQL> select * from t3;

I
----------
1
2

From Session 2 :

SQL> select * from t3;

I
----------
1

As you see , alter system command does not perform an implicit Commit for the insert statement performed from session 1.

What is DML?
DML stands for Data Manipulation Language. DML statements are :

CALL
DELETE
EXPLAIN PLAN
INSERT
LOCK TABLE
MERGE
SELECT
UPDATE

That is important : DML statements do not implicitly commit the current transaction. I mean you have to commit or rollback your transaction when it finishes.