Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rollback (data management)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Database operation that restores a previous state}} In [[database]] technologies, a '''rollback''' is an operation which returns the database to some previous state. Rollbacks are important for database [[data integrity|integrity]], because they mean that the database can be restored to a clean copy even after erroneous operations are performed.<ref>{{Cite web|url=https://soaringeagle.biz/what-is-a-database-rollback/|title=Database Rollback β What and Why|date=3 November 2019|access-date=16 April 2022}}</ref> They are crucial for recovering from database server crashes; by rolling back any [[Database transaction|transaction]] which was active at the time of the crash, the database is restored to a consistent state. The rollback feature is usually implemented with a [[Database log|transaction log]], but can also be implemented via [[multiversion concurrency control]]. ==Cascading rollback== A cascading rollback occurs in database systems when a transaction (T1) causes a failure and a rollback must be performed. Other transactions dependent on T1's actions must also be rollbacked due to T1's failure, thus causing a cascading effect. That is, one transaction's failure causes many to fail. Practical database recovery techniques guarantee cascadeless rollback, therefore a cascading rollback is not a desirable result. Cascading rollback is scheduled by dba. ==SQL== SQL refers to Structured Query Language, a kind of language used to access, update and manipulate database. In [[SQL]], <code>ROLLBACK</code> is a command that causes all data changes since the last <code>START TRANSACTION</code> or <code>BEGIN</code> to be discarded by the [[relational database management systems]] (RDBMS), so that the state of the data is "rolled back" to the way it was before those changes were made.<ref>{{Cite web|url=https://www.sqlshack.com/rollback-sql-rolling-back-transactions-via-the-rollback-sql-query/|title=Rollback SQL: Rolling back transactions via the ROLLBACK SQL query|author=Ben Richardson|date=26 December 2019|access-date=16 April 2022}}</ref> A <code>ROLLBACK</code> statement will also release any existing [[savepoint]]s that may be in use. In most SQL dialects, <code>ROLLBACK</code>s are connection specific. This means that if two connections are made to the same database, a <code>ROLLBACK</code> made in one connection will not affect any other connections. This is vital for proper [[Concurrent programming|concurrency]]. ==Usage outside databases== Rollbacks are not exclusive to databases: any [[stateful]] [[distributed system]] may use rollback operations to maintain [[Consistency (database systems)|consistency]]. Examples of distributed systems that can support rollbacks include [[message queue]]s and [[workflow management system]]s. More generally, any operation that resets a system to its previous state before another operation or series of operations can be viewed as a rollback. ==See also== *[[Savepoint]] *[[Commit (data management)|Commit]] *[[Undo]] *[[Schema migration]] ==Notes== {{Reflist}} ==References== *{{cite book |author = Ramez Elmasri |author-link = Ramez Elmasri |title= Fundamentals of Database Systems |publisher= [[Pearson Addison Wesley]] |year= 2007|isbn= 978-0-321-36957-4 }} *[http://msdn2.microsoft.com/en-us/library/ms181299.aspx "ROLLBACK Transaction"], Microsoft SQL Server. *[https://www.pantz.org/software/mysql/mysqlcommands.html "Sql Commands"], MySQL. {{Databases}} {{Web syndication}} {{Authority control}} [[Category:Database theory]] [[Category:Transaction processing]] [[Category:Reversible computing]] [[Category:Database management systems]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Databases
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Web syndication
(
edit
)