Difference between delete and truncate - Interview question | OrclData

Опубликовано: 05 Октябрь 2024
на канале: Learnomate Technologies
263
4

Enroll to the Oracle DBA real time interview Question
====================================================
https://learnomate.org/courses/oracle...

WhatsApp me for Training - https://wa.link/gi7fv2

Starting new Oracle DBA batch in next week.
Please connect with me if you are interested.
Batch will start from next week
Time - 9am ist (11:30 PM EST)
Duration - 45 days
Daily one hour
Contact - +91 9960262955
Email - [email protected]
Fees - 15k (300$)

Two installments can be available

Syllabus -

https://www.learnomate.org/syllabus

Review -

https://www.learnomate.org/reviews

YouTube Channel

   • Starting NEW REAL TIME ORACLE DBA Batch  

Registration

https:www.learnomate.org/register

WhatsApp me
https://wa.link/usfz52

Facebook Page
  / learnomate  

LinkedIn
  / ankushthavali   RUNCATE
TRUNCATE is a DDL command
TRUNCATE is executed using a table lock and whole table is locked for remove all records.
We cannot use Where clause with TRUNCATE.
TRUNCATE removes all rows from a table.
Minimal logging in transaction log, so it is performance wise faster.
TRUNCATE TABLE removes the data by deallocating the data pages used to store the table data and records only the page deallocations in the transaction log.
Identify column is reset to its seed value if table contains any identity column.
To use Truncate on a table you need at least ALTER permission on the table.
Truncate uses the less transaction space than Delete statement.
Truncate cannot be used with indexed views.
DELETE
DELETE is a DML command.
DELETE is executed using a row lock, each row in the table is locked for deletion.
We can use where clause with DELETE to filter & delete specific records.
The DELETE command is used to remove rows from a table based on WHERE condition.
It maintain the log, so it slower than TRUNCATE.
The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row.
Identity of column keep DELETE retain the identity.
To use Delete you need DELETE permission on the table.
Delete uses the more transaction space than Truncate statement.
Delete can be used with indexed views.