-- 删除view
obclient [test]> drop view v_t1;
Query OK, 0 rows affected (0.069 sec)
-- 进入了回收站,TYPE是VIEW
obclient [test]> show recyclebin;
+-----------------------------------------+---------------+-------+----------------------------+
| OBJECT_NAME | ORIGINAL_NAME | TYPE | CREATETIME |
+-----------------------------------------+---------------+-------+----------------------------+
| __recycle_$_1757569992_1760079409863928 | t1 | TABLE | 2025-10-10 14:56:49.880738 |
| __recycle_$_1757569992_1760079418566256 | v_t1 | VIEW | 2025-10-10 14:56:58.565607 |
+-----------------------------------------+---------------+-------+----------------------------+
2 rows in set (0.004 sec)
-- 用flashback view语法恢复,报错语法不支持
obclient [test]> flashback view v_t1 to before drop;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'view v_t1 to before drop' at line 1
-- 用flashback table闪回VIEW,正常成功
obclient [test]> flashback table v_t1 to before drop;
Query OK, 0 rows affected (0.071 sec)
-- 查询视图,报错,因为依赖的表之前drop了
obclient [test]> select * from v_t1;
ERROR 1356 (42S22): View 'test.v_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-- 闪回表
obclient [test]> flashback table t1 to before drop;
Query OK, 0 rows affected (0.075 sec)
-- 再查询视图,正常可用
obclient [test]> select * from v_t1;
+------+------+
| id | name |
+------+------+
| 1 | A |
| 2 | B |
| 3 | C |
+------+------+
3 rows in set (0.163 sec)