Oracl hundred percent migrate databases, tables and data is not lost, error recovery reminder

Must:
Use exp / imp command (PLSQL not introduced)


Ready to work

select 'alter table '||table_name||' allocate extent;' from user_tables;

sql query execution copy, do not throw table

exp:

===========================
@echo off   
echo ================================================   
echo  Windows环境下Oracle数据库的自动备份脚本  
echo  1. 使用当前日期命名备份文件。  
echo ================================================    
::设置用户名、密码和要备份的数据库。  
::set USER=detection1  
::set PASSWORD=detection1  
::set DATABASE=orcl  
::以“YYYYMMDD”格式取出当前时间。
set year=%DATE:~0,4%
rem get month 
set month=%DATE:~5,2%
rem get data 
set date=%DATE:~8,2%
rem get mydate 
set mydate=%year%%month%%date%  
::创建备份目录。
if not exist "D:\YtForever\YTPQM\DB\backup\"       mkdir D:\YtForever\YTPQM\DB\backup\   
set DATADIR=D:\YtForever\YTPQM\DB\backup\  
exp detection1/[email protected]/orcl  file=%DATADIR%\detection1_%mydate%.dmp
exp ytdetection1/[email protected]/orcl  file=%DATADIR%\ytdetection1_%mydate%.dmp

exit  

Local Remote can, configured, save the bat, double-click operation


imp

imp wqs803/[email protected]/orcl file=E:\wqs803_20190916.DMP full=y ignore=y;

Guess you like

Origin blog.51cto.com/zl0828/2438286