View Database Operation Records

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 查看数据库操作记录

| username: Jolyne

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
Currently, there are a few tables in the inventory. They were deleted last night and then recreated. However, the tables mysteriously disappeared when running tasks at noon. There are no related table operation records in the DDL jobs, and no relevant records can be found in the debug logs on the dashboard. I would like to ask where else I can check the logs.
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]




| username: h5n1 | Original post link

Did you confirm the rebuild last night? It’s unlikely that several tables would show nothing after being created and running admin show ddl.

| username: Jolyne | Original post link

Confirmed that it was rebuilt using Lightning to restore the data. The table was created directly, but then the data personnel ran tasks and found that the table was missing.

| username: ShawnYan | Original post link

View all DDL records, then search through them.

| username: tidb菜鸟一只 | Original post link

SELECT * FROM INFORMATION_SCHEMA.`STATEMENTS_SUMMARY_HISTORY` a WHERE a.table_names LIKE '%dwd_fr_jbxx_ztcy_gdx%';---Check if there have been any related DDL statements executed
| username: h5n1 | Original post link

First create the table and then import with Lightning? Do you still have the Lightning logs? Check to see what information is in there.

| username: Jolyne | Original post link

I didn’t create the table. I used Dumpling to directly export both the table structure and data, and restored it directly into an empty database. Let me check the Lightning logs.

| username: Jolyne | Original post link

Empty :sweat_smile:

| username: Jolyne | Original post link

There are only some basic execution logs, and no relevant comparison table information was found.

| username: h5n1 | Original post link

Is it possible that these tables weren’t exported? What command did you use for dumpling?

| username: Qiuchi | Original post link

Previously, due to improper operation of Lightning, I removed the checkpoint and dropped the table. I’m not sure if it’s related.

| username: Jolyne | Original post link

The DDL time downloaded from this is the same as the time in admin show ddl jobs.

| username: zhanggame1 | Original post link

I don’t quite believe there is an operation to create a table.

| username: ShawnYan | Original post link

The time is definitely the same. The main point is that this is a complete DDL record, which can confirm whether there have been table creation or deletion actions.

| username: Jolyne | Original post link

Okay, I’ll create a table again today to see if a similar situation occurs.

| username: zhanggame1 | Original post link

After building, use SHOW TABLES to check.

| username: redgame | Original post link

Take a screenshot to record the process, haha.

| username: Anna | Original post link

show tables