功能描述
按照指定的方式恢复表。如果有同名表,会报错。
权限要求
具有该表
Drop
权限。语法
FLASHBACK TABLE recycle_table_name TO BEFORE DROP [RENAME TO new_table_name];
参数说明
参数 | 是否必选 | 说明 |
recycle_table_name | 必选 | |
new_table_name | 可选 | 表恢复时的新命名。 |
示例
TDSQL [(none)]> show recyclebin;+-----------+---------------+--------------+--------------------------------+---------------------+---------------------+| tindex_id | origin_schema | origin_table | recycle_table | drop_time | purge_time |+-----------+---------------+--------------+--------------------------------+---------------------+---------------------+| 10028 | test | test2 | bin$/usodaiwngrpdoel2wnlqg==$1 | 2025-01-21 19:12:10 | 2025-01-28 19:12:10 |+-----------+---------------+--------------+--------------------------------+---------------------+---------------------+TDSQL [(none)]> flashback table `bin$/usodaiwngrpdoel2wnlqg==$1` to before drop rename to test.test3;Query OK, 0 rows affected (1.72 sec)TDSQL [(none)]> show tables;+----------------+| Tables_in_test |+----------------+| test1 || test3 |+----------------+2 rows in set (0.01 sec)