Обсуждение: Undo Update

Поиск
Список
Период
Сортировка

Undo Update

От
Rajesh Kumar
Дата:
Hi friends

I was given a query to update the record in table A with where clause. But I executed it in production mistakenly without where clause so it updated incorrectly for all rows.

How do I resolve this?

Re: Undo Update

От
Holger Jakobs
Дата:
I'm afraid you will have to execute the SQL statement undoing it. Of you don't know the previous values, you're out of luck.

Then a backup is your best friend.


Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
Hi friends

I was given a query to update the record in table A with where clause. But I executed it in production mistakenly without where clause so it updated incorrectly for all rows.

How do I resolve this?

Re: Undo Update

От
Rajesh Kumar
Дата:
In that case, how to take a backup specifically before that update and are there any prequisites such as stopping the server when it happens? And then backup like that?

On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:
I'm afraid you will have to execute the SQL statement undoing it. Of you don't know the previous values, you're out of luck.

Then a backup is your best friend.


Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
Hi friends

I was given a query to update the record in table A with where clause. But I executed it in production mistakenly without where clause so it updated incorrectly for all rows.

How do I resolve this?

Re: Undo Update

От
Søren Laursen
Дата:

Den tors. 10. aug. 2023 kl. 11.18 skrev Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
In that case, how to take a backup specifically before that update and are there any prequisites such as stopping the server when it happens? And then backup like that?

On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:
I'm afraid you will have to execute the SQL statement undoing it. Of you don't know the previous values, you're out of luck.

Then a backup is your best friend.


Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
Hi friends

I was given a query to update the record in table A with where clause. But I executed it in production mistakenly without where clause so it updated incorrectly for all rows.

How do I resolve this?

Re: Undo Update

От
jp.pozzi@izzop.net
Дата:
Hello,

Restore the data ....

Regards

JP P

> Hi friends
> 
> I was given a query to update the record in table A with where clause.
> But I executed it in production mistakenly without where clause so it
> updated incorrectly for all rows.
> 
> How do I resolve this?



Re: Undo Update

От
Ron
Дата:
Ask your database administrator about PITR (Point In Time Recovery).

On 8/10/23 04:17, Rajesh Kumar wrote:
In that case, how to take a backup specifically before that update and are there any prequisites such as stopping the server when it happens? And then backup like that?

On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:
I'm afraid you will have to execute the SQL statement undoing it. Of you don't know the previous values, you're out of luck.

Then a backup is your best friend.


Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
Hi friends

I was given a query to update the record in table A with where clause. But I executed it in production mistakenly without where clause so it updated incorrectly for all rows.

How do I resolve this?

--
Born in Arizona, moved to Babylonia.