LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-26-2008, 10:40 AM   #1
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Rep: Reputation: 30
RollBack a Dropdatabase?


I was using testing a piece of software on a database that has not been backed up. I know I know stupid me. Anyway I was using it to insert a new table, and I apparently checked a button to drop the database if it already existed and the table got dropped. grrr, not a huge deal but I would really like to be able to recover the tables.
Can a Drop Database be rolled back without the use of backups?
 
Old 05-26-2008, 11:47 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
I think it depends on your SLQ engine, and how it was set up.
For example:

Quote:
http://dev.mysql.com/doc/refman/5.0/en/commit.html
"By default, MySQL runs with autocommit mode enabled. This means that as soon as you execute a statement that updates (modifies) a table, MySQL stores the update on disk.
.
[SNIP]
.
To disable autocommit mode for a single series of statements, use the START TRANSACTION statement:
Code:
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;
With START TRANSACTION, autocommit remains disabled until you end the transaction with COMMIT or ROLLBACK. The autocommit mode then reverts to its previous state"
 
Old 05-26-2008, 06:59 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As a general rule in RDBMSes (ime), DML (data manipulation lang eg SELECT/INSERT/UPDATE/DELETE) can be rolled back IFF you are using txns (as above).
HOWEVER, DDL (data definition lang eg DROP/CREATE etc) usually can't, even with txns.
Check the docs for your DB.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to rollback erinlang101 Red Hat 2 09-20-2005 09:31 AM
urpmi rollback? Blackhawkckc Mandriva 11 03-15-2005 03:45 PM
Rollback Kernel? mrurmil Fedora 2 01-26-2005 09:44 AM
RollBack my configuration pautasso Linux - Newbie 2 08-13-2004 08:43 PM
rollback actions DriveMeCrazy AIX 6 05-16-2004 05:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration