Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [truncate]

An operation that removes all rows in a table without causing any triggered action

20 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
1k views

How to disable TRUNCATE on whole database or for particular table?

Is it possible to disable TRUNCATE operation on the entire PostgreSQL database, or on a specific table?
jnemecz's user avatar
  • 121
2 votes
0 answers
142 views

MySQL Queries Truncate Causing Connection Spikes

We have a MySQL Master Instance & Read (failover only) on AWS. MySQL 5.6 Aurora running Magento. Performance is great, and better than standard MySQL (we have high traffic site so see the benefits)...
Mark's user avatar
  • 21
2 votes
0 answers
158 views

LOG BACKUP is TRUNCATING in Log Shipping

I had configured Log shipping from INSTANCE1 to INSTANCE2. For the past few days, am able to find that the log backup is truncating only at the midnight. Due to this, LSRestore Job in INSTANCE2 got ...
Vinesh Senthilvel's user avatar
1 vote
0 answers
134 views

MySQL : Huge table truncation in replication environment

We have 2 tables of size 186G and 63G that are no longer in use and needs to be truncated from the database. I cannot directly run the truncate table statement on the master DB as it has 14 replicas ...
msbeast's user avatar
  • 11
1 vote
1 answer
696 views

Long TRUNCATE operations

On Microsoft SQL Server 2019, there is a lot of long temp tables TRUNCATE operations with time over 5..10 seconds. Easy query like "TRUNCATE TABLE #tt22" can take over 15 seconds. It's an ...
aqis's user avatar
  • 11
1 vote
0 answers
2k views

Cannot truncate a table referenced in a foreign key constraint even with no child data?

With a ON DELETE RESTRICT restriction, I understand that you can't delete a row in the parent table if a reference exist in the child table, but is it expected behavior that even if the child table is ...
IMB's user avatar
  • 169
1 vote
0 answers
177 views

Stop MySql InnoDB truncate on reboot

How can I stop a truncate of a MySql innodb? When I restart the database it tries to continue the truncating which leads to the problem of the log group capacity exceeding. To increase this limit it ...
Jobeso's user avatar
  • 111
1 vote
0 answers
2k views

How to truncate a table without locking it?

I have a SYSTEM's table AUD$ in ORACLE's database that is constantly being populated (whenever a DB user logs in to DB - a records is written to AUD$). The table AUD$ has like 100 million records (...
korodani's user avatar
  • 123
1 vote
0 answers
471 views

Adding IF Exist to truncate statement while looping through DBs

Please, I am trying to add if exists statement to the code below such that it only print truncate statements on all DBs where the table= dbo.log only exist. (SQL Server 2016) IF (EXISTS (SELECT * ...
Djoe2000ng's user avatar
1 vote
1 answer
2k views

MySQL events with TRUNCATE and INSERT

Can I create event that would first TRUNCATE table and then make INSERT? I know how to TRUNCATE and INSERT in separate events but need to do it immediately one after the other. I just don't know the ...
CroDexter's user avatar
1 vote
1 answer
43 views

Deleting data from some but not all tables

I've got a moderately large sql server db for which some data is imported from an external system, and some is entered through the front end or set up when the app is set up. I want to delete all the ...
user avatar
1 vote
0 answers
92 views

Prevent truncate without denying ALTER permission

Is there a way to disallow users from truncating a table without denying ALTER permission on the table? Users should be able to maintain the standard ALTER permissions (adding columns to a table, etc.)...
Weston Sankey's user avatar
1 vote
1 answer
407 views

Effect of TRUNCATE TABLE different from DELETE on subsequent queries

I always thought of TRUNCATE TABLE as an equivalent of DELETE, except that: 1) TRUNCATE can be used only in some cases (no FK referencing table, user must have ALTER permission etc) 2) TRUNCATE is ...
carlo.borreo's user avatar
  • 1,487
0 votes
0 answers
223 views

Truncate table takes too long waiting db file async i/o submit

I've got Oracle 12c data warehouse database on oracle Linux 7.3, and there's job that truncating one table. Table has size of 5GB And always truncate takes about hour with waiting for "db file ...
Sebastian 's user avatar
0 votes
0 answers
837 views

Data truncated after importing a MySQL 5.7 dump into MySQL 8

I am trying to import a 12G MySQL 5.7 dump (on ubuntu 16.04) into a MySQL 8.0 database (on ubuntu 20.04). Half way through the import exits and returns the following error: ERROR 1265 (01000) at line ...
merlin's user avatar
  • 303
0 votes
0 answers
56 views

What EventClass is a TRUNCATE?

Trying to query why all records are being deleted from a table, nothing comes up with eventclass = 47 (delete) - perhaps its a truncate so I want to query it in the trace file thanks
jack's user avatar
  • 379
0 votes
2 answers
210 views

DBCC Shrinkfile after full backup restoration but before differential restoration

My database full backup file size is 760 GB and differential would be around 20 GB but the database size is around 2TB. As it is a production database, so to apply only a minimum downtime, i want to ...
kalpna's user avatar
  • 1
0 votes
1 answer
51 views

backup of databases - consistently back up databases with control of log truncates

My question is how can I back up my database by controlling the log truncates? I need to perform a testing with VEBF (Veeam Endpoint Backup FREE). A test case that I have to make now is that I have ...
j.walt's user avatar
  • 33
0 votes
2 answers
656 views

Why we can FLASHBACK DROP table where it is DDL command and hence autocommited?

DROP and TRUNCATE both are DDL commands and both are autocommited.Then why we can recover DROP table by using FLASHBACK(unless it is purge) and why we can not recover TRUNCATED data(don't consider ...
Paresh's user avatar
  • 81
-2 votes
0 answers
15 views

Getting Rquest has been Truncated error while uploading audio files using php

I am getting "request has been truncated" error when I upload 3 audios of 50MB each using php. Below are some of the variables which I have already set in the php.ini file : ...
Vishal's user avatar
  • 1