Oracle数据库备份与恢复
备份
1.conn sys/**** as sysdba
2.select dbid,name,log_mode,current_scn from v$database; --关键是要注意log_mode若是noarchivelog则执行下面的操作
3.select name from v$datafile union select name from v$controlfile;--搜索出所有的数据文件和控制文件
4.shutdown immediate
5.host copy
6.startup
恢复
1.conn sys/**** as sysdba
2.shutdown immediate
3.host copy
4.startup mount
5.revover database until cancel
6.alter database open resetlogs
逻辑备份与恢复
1.CREATE DIRECTORY dump dir AS ‘D:DUMP’;
GRANT READ, WIRTE ON DIRECTORY dump_dir TO scott;
2.在DOS环境下运行
3.D:oracleproduct10.1.0db_1BIN>expdp zzh48182/z86589947 tables=ttextperson directory=test_dir dumpfile=ttextperson.dmp
4.D:oracleproduct10.1.0db_1BIN>impdp zzh48182/z86589947 directory=test_dir dumpfile=ttextperson.dmp tables=ttextperson remap_schema=zzh48182:rhx