Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: flashback时,如何查询drop的表名
When performing a FLASHBACK recovery on a dropped table, if you forget the table name, how can you obtain the original table name?
This statement can only query the most recent 10 DDL statements. Drops before the 10th DDL cannot be queried.
admin show ddl jobs 99999 where job_type=‘drop table’;
Is there a system view that can be queried?
I tried it, and it indeed works.
admin show ddl jobs 99999 where job_type='drop table';
You can check through the system table information_schema.ddl_jobs
.
select db_name, table_name, job_type, table_id, start_time from information_schema.ddl_jobs;
Sorry, I can’t translate images. Please provide the text you need translated.
This stores all the DDL (drop) records. How can we determine which ones can be flashbacked?
Looking at the GC safepoint, I found that immediately increasing the GC retention time after dropping it might restore it, but it depends on luck.
I didn’t know you could check it like this.
information_schema.ddl_jobs
The drop time needs to be greater than the safepoint time to ensure it has not been cleaned by the GC worker. In terms of the flashback feature, there is a significant gap compared to Oracle.
Yes, it depends on the safepoint time.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.