Skip to main content

Difference Between DDL, DML and DCL Commands

DDL

Data Definition Language (DDL) statements are used to define the database structure or schema. 
  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT - add comments to the data dictionary
  • RENAME - rename an object

DML

Data Manipulation Language (DML) statements are used for managing data within schema objects.
  • SELECT - retrieve data from the a database
  • INSERT - insert data into a table
  • UPDATE - updates existing data within a table
  • DELETE - deletes all records from a table, the space for the records remain
  • MERGE - UPSERT operation (insert or update)
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency

DCL

Data Control Language (DCL) statement.
  • GRANT - gives user's access privileges to database
  • DENY - to disallow specified users from performing specified tasks.
  • REVOKE - withdraw access privileges given with the GRANT command

TCL

Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
  • COMMIT - save work done
  • SAVEPOINT - identify a point in a transaction to which you can later roll back
  • ROLLBACK - restore database to original since the last COMMIT
  • SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

Comments

Popular posts from this blog

Oracle Import getting stuck Processing object type SCHEMA_EXPORT/

Oracle Import getting stuck Processing object type SCHEMA_EXPORT/ /database1/rdbm6/export> tail -200f impdp_D.SPORTS_03192012.log ;;; Import: Release 11.2.0.2.0 - Production on Mon Mar 19 15:34:10 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "SYS"."SYS_IMPORT_FULL_02" successfully loaded/unloaded Starting "SYS"."SYS_IMPORT_FULL_02":  "/******** AS SYSDBA" REMAP_SCHEMA=SPORTS:SPORTS DIRECTORY=dpump_dir DUMPFILE=expdp_D.SPORTS_02282012.dmp LOGFILE = impdp_D.SPORTS_03192012.log REMAP_TABLESPACE = SPORTS_DATA_TS:SPORTS_DATA_TS , SPORTS_INDEX_TS:SPORTS_INDEX_TS Processing object type SCHEMA_EXPORT/USER ORA-31684: Object type USER:"SPORTS" already exists Processing object type SCHEMA_EXPORT/ROLE_GRANT Proc

ORA-06550, WMSYS.LT_EXPORT_PKG.schema_info_exp

When you do full database export it fails will following errors as below. Export: Release 11.2.0.1.0 - Production on Mon Sep 30 12:04:38 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA schemas=user1 directory=data_pump_dir dumpfile=user1.dmp logfile=user1.log Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 0 KB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE ORA-39127: unexpected error from call to export_string :=WMSYS.LT_EXPORT_PKG.schema_info_exp('user1&

How to make the email Address Dummy in Oracle Database?

How to make the email Address Dummy in Oracle Database? Query to make the email Address as dummy, update <tablename> set <Columnname> = '@' || <Columnname> where <Columnname>  is not null; Query to Remove the email Address as dummy, update <tablename> set <Columnname>= substr(<Columnname>,2,length(<Columnname>)) where <Columnname> is not null;