如何恢复被删除的视图

在误删视图以后可以通过以下方法恢复:

SQL> alter user scott identified by tiger account unlock;

User altered.

SQL> grant create view to scott;

Grant succeeded.

SQL> grant flashback on user_views to scott;

Grant succeeded.

SQL> connect scott/tiger

Connected.

SQL> create view huang as select * from emp;

View created.

SQL> drop view huang;

View dropped.

SQL> select text from user_views as of timestamp to_date('201008091520','yyyymmddhh24miss') where view_name='HUANG';

TEXT

--------------------------------------------------------------------------------

select "EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO" from emp

 

你可能感兴趣的:(BACKUP&RECOVER,ORACLE)