热备份和完全恢复实例模拟演示代码
先创建表,输入数据,然后备份。之后删除表数据,完全恢复,得到有表里面有数据的状态?
SQL> conn / as sysdba
SQL> create tablespace test datafile ‘d:\test.dbf’ size 1M;
需要归档模式
ARCHIVE LOG LIST;
设置归档模式
SQL> SHUTDOWN;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
SQL> alter tablespace test begin backup
SQL> host copy d:\test.dbf c:\test.dbf
SQL> alter tablespace test end backup
SQL> create table test (a int ,b int ) tablespace test
SQL> insert into test values(1,1)
SQL> insert into test values(1,2)
SQL> commit
SQL> shutdown
SQL> host del d:\test.dbf
SQL> startup
SQL> alter database datafile 'd:\test.dbf' offline;
SQL> host copy c:\test.dbf d:\test.dbf
SQL> alter database recover datafile 'd:\test.dbf'
SQL> alter database datafile 'd:\test.dbf' online;
SQL> alter database open
SQL> select * from test