osrexp -usysdba/szoscar55 -hxx.xx.xx -p2016 -desb level=schema file=/home/用户名_时间.osr log=/home/用户名_LOG_时间.log schema=用户名
(xx.xx.xx为服务器ip地址)
备份完成后提示信息如下:
[LOG]: 模式或用户备份完成
[LOG]: --备份开始时间:2018-03-16 10:58:49---
[LOG]: --备份结束时间:2018-03-16 11:13:01---
[LOG]: --备份共耗时:(852s)---
成功终止导出, 没有出现警告。
恢复用户对象和数据的命令:
恢复用户与备份脚本用户相同,举例说明:
osrimp -usysdba/szoscar55 -hxx.xx.xx. -p2003 -dosrdb level=schema file=/home/用户名_时间.osr log=/home/用户名_LOG_时间.log schema=用户名 ignore=true nocheckvalidate=true
恢复用户与备份脚本用户不同,举例说明:
osrimp -usysdba/szoscar55 -hxx.xx.xx. -p2003 -dosrdb level=schema file=/home/用户名_时间.osr log=/home/用户名_LOG_时间.log
fromuser=用户名A touser=用户名B ignore=true nocheckvalidate=true
恢复完成后提示信息如下:
[LOG]: 表对象的各个约束信息(主键、外键、索引、数据等)恢复完成
[LOG]: 恢复完成,退出恢复流程
[LOG]: --恢复开始时间:2018-03-16 17:06:58---
[LOG]: --恢复结束时间:2018-03-16 17:07:04---
[LOG]: --恢复共耗时:(5s)---