From the course: Oracle Database 19c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Truncating tables

Truncating tables - Oracle Database Tutorial

From the course: Oracle Database 19c: Advanced SQL

Start my 1-month free trial

Truncating tables

- [Instructor] The truncate command is quite useful when manipulating tables in your Oracle database. But it can be a double-edged sword. It's fast, but it can cause issues when transaction enemicity and concurrency is expected. It also has recoverability implications. Therefore, you need to understand the consequences to use it effectively. Given what it does to a table, the truncate command acts like the Delete DML statement, it quickly deletes all rows in a table, there is no middle ground, however, it's all or nothing, it can't delete just some rows, only all of them at once. And because of this, there're some side effects that put it outside of the DML commands. Before I talk about those side effects, here's the syntax of truncate, you can truncate a table in another schema, but you must have the drop any table system privilege, which I'll also discuss in a later slide. When you truncate a table, you have the option to keep all the storage allocated along with the high watermark,…

Contents