Compare and contrast TRUNCATE and DELETE for a table.
Answers were Sorted based on User's Feedback
Basically truncate is a DDL and Delete is DML. You can use
delete to remove rows depending on certain criteria and it
generated redo logs and can be rolled back before you
commit the transaction, Where as the truncate is used to
remove all the data in the table. Once you execute this
command u can not rollback this transaction.and commit is
not required for the truncate statement
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / taral desai
truncate is faster then delete... truncate don't generate
rollback. truncated data can't be recovered
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / amsu
Truncate is a DDL and delete is a DML command. Once you
truncate a table you cannot rollback where as you can
rollback from the delete command. When you truncate a
table it release the space and it resets the highwater
mark. Delete won't release the space and it won't resets
the highwater mark.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sridhar
truncate and delete are deltes all rows in the table but truncate is much faster than delete.
and if u delete row in the delte deletion of each gets logged in the transaction log.
truncate there is no way to log in transaction log
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kishore
truncate removes all the rows from a table
it can't be rollback
delete removes all /specific rows from a table
it can be rollback
drop removes whole table
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / monal
IN MSSQLSERVER TRUNCATE RESETS IDENTITY VALUE OF COLUMN
WHILE DELETE DOESN'T RESETS IDENTITY VALUE OF COLUMN
| Is This Answer Correct ? | 0 Yes | 1 No |
suppose you want to audit specific activities on sensitive data. How can you achieve that?
Hi This is request to DBA man Q. I have installed Oracle 10g Express edition in Linux fedora Core 6.When i have run the following script for ORACLE _HOME environment variable setting . script is ". /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh" variable is set but it is working only in current session. If i restart the system again i should run that script. So haw to set permanently ? even i have try with export command for that environment set it also does not work. Q. When i run sqlplus in shell prompt It is working but when i give user name and password the following error come out i.e # sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 2 19:45:40 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: system Enter password: ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux Error: 2: No such file or directory I have also proper partition of disk means swap memory are available. # fdisk -l Disk /dev/sda: 40.0 GB, 40060403712 bytes 255 heads, 63 sectors/track, 4870 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 1275 10241406 7 HPFS/NTFS /dev/sda2 1276 4870 28876837+ f W95 Ext'd (LBA) /dev/sda5 1276 3187 15358108+ 7 HPFS/NTFS /dev/sda6 3188 4672 11928231 83 Linux /dev/sda7 4673 4863 1534176 82 Linux swap / Solaris
What is the dataguard background process??
which background process invoke at the time of upgradation tell me???
What are the recovery models for a database? : sql server DBA
how can you record information about current session?
any body know about orawaves do they really provide placements in their unique placement program
How would you determine who has added a row to a table?
How would you go about increasing the buffer cache hit ratio?
As a part of your job, what are the DBCC commands that you commonly use for database maintenance?
Which autogrowth database setting is good? : sql server DBA
wat is global index and local indes
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)