
table model(按表处理的模式)
backupone user's table(备份一个用户下的表)
exp test/test
rows=y indexes=n compress=n buffer=65536 feedback=100000 volsize=0
file=exp_table_yyyymmdd.dmp log=exp_table_yyyymmdd.log
tables=test_table1,test_table2
recoverall table(导入全部备份的表)
imp test2/test2
fromuser=test touser=test2 rows=y indexes=n commit=y buffer=65536
feedback=100000 ignore=y volsize=0 file=exp_table_yyyymmdd.dmp
log=imp_table_yyyymmdd.log
recoversome table of all table(导入备份的部分表)
imp test2/test2
fromuser=test touser=test2 rows=y indexes=n commit=y buffer=65536
feedback=100000 ignore=y volsize=0 file=exp_table_yyyymmdd.dmp
log=imp_table_yyyymmdd.log tables=test_table1
user model(用户模式)
backupall someone's object(备份一个用户的所有的数据对象)
exp test/test
rows=y indexes=n compress=n buffer=65536 feedback=100000 volsize=0 owner=test file=exp_user_yyyymmdd.dmp
log=exp_user_yyyymmdd.log
recoverall someone's object
imp test2/test2
fromuser=test touser=test2 rows=y indexes=n commit=y buffer=65536
feedback=100000 ignore=y volsize=0 file=exp_user_yyyymmdd.dmp
log=imp_user_yyyymmdd.log
recoversome table of all someone's object
imp test2/test2
fromuser=test touser=test2 rows=y indexes=n commit=y buffer=65536
feedback=100000 ignore=y volsize=0 file=exp_user_yyyymmdd.dmp log=imp_user_yyyymmdd.log
tables=test_table1,test_table2,test_table3
full model
backupthe full db for all
exp system/manager
rows=y indexes=n compress=n buffer=65536 feedback=100000 volsize=0 full=y
inctype=complete file=exp_fulldb_yyyymmdd.dmp log=exp_fulldb_yyyymmdd.log
backupthe full db for increment
exp system/manager
rows=y indexes=n compress=n buffer=65536 feedback=100000 volsize=0 full=y
inctype=incremental file=exp_fulldb_zl_yyyymmdd.dmp
log=exp_fulldb_zl_yyyymmdd.log
注意:inctype是8i的9i已经不用了
recoverall date for full backup
imp system/manager
rows=y indexes=n commit=y buffer=65536 feedback=100000 ignore=y volsize=0
full=y file=exp_fulldb_yyyymmdd.dmp log=imp_fulldb_yyyymmdd.log
recoverall date for increment backup
imp system/managerrows=y indexes=n commit=y buffer=65536 feedback=100000 ignore=y vol
size=0
full=y inctype=restore file=exp_fulldb_zl_yyyymmdd.dmplog=imp_fulldb_zl_yyyymmdd.log
使用数据泵备份echo 正在备份 中通钢构Oracle-CRM数据库,请稍等......
expdp 用户名/密码 exclude=statistics parallel=6 dumpfile=文件名.dmp logfile=文件名.txt
Oracle 11g数据导入到10g
一、在11g服务器上,使用expdp命令备份数据
11g 导出语句:EXPDP USERID='facial/facial@orcl as sysdba' schemas=facialdirectory=DATA_PUMP_DIR dumpfile=test.dmp logfile=test.log version=10.2.0.1.0
二、在10g服务器上,使用impdp命令恢复数据
准备工作:1.建库2.建表空间3.建用户并授权4.将test.dmp拷贝到10g的dpdump目录下
--创建表空间
create tablespace TS_Facial datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\Facial.DBF' size 500M autoextend on next 50M
--创建用户
create user Facial identified by Facial default tablespace TS_Facial
--授权给用户
grant connect,resource,dba to Facial
test.dmp 和 test.log 放在E:\oracle\product\10.2.0\admin\orcl\dpdump目录下
10g 导入语句:IMPDP USERID='facial/facial@orcl as sysdba' schemas=facialdirectory=DATA_PUMP_DIR dumpfile=test.dmp logfile=test.log version=10.2.0.1.0
oracle10g 数据导入到oracle11g 中:
在oracle10g 上执行:Exp ts/ts@orcl file=D:\tianshan.dmp
在oracle11g 上创建好表空间和用户后执行:Imp ts/ts@orcl file=D:\tianshan.dmp
Oracle11g 数据导入到oracle10g 中:
1.在oracle11g 服务器命令行中用expdp 导出数据
expdp ts/ts@orcl directory=expdp_dir dumpfile=tianshan.dmp logfile=tianshan.log version=10.2.0.1.0 (schemas=ccense)
2.在oracle10g 服务器DOS 命令行中用IMPDP 导入数据:
把oracle11g 的备份文件放到oracl10g 服务器的impdp_dir 目录中,并创建好相应的用户和表空间,然后执行下面的命令:
impdp ts/ts@orcl directory=impdp_dir dumpfile=tianshan.dmp logfile=tianshan.log version=10.2.0.1.0 (schemas=ccense)
Oracle 的imp/exp 组件的一个 *** 作原则就是向下兼容,且有一些规则:
1、低版本的exp/imp 可以连接到高版本(或同版本)的数据库服务器,但高版本的exp/imp 不能连接到低版本的数据库服务器。
2、高版本exp 出的dmp 文件,低版本无法imp(无法识别dmp 文件);低版本exp 出的dmp 文件,高版本可以imp(向下兼容)。
3、从Oracle 低版本Export 的数据可以Import 到Oracle 高版本中,但限于Oracle 的相邻版本,如从Oracle 7 到 Oracle 8。对于两个不相邻版本间进行转换,如从Oracle 6 到 Oracle 8,则应先将数据输入到中间版本—Oracle 7,再从中间数据库转入更高版本Oracle 8。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)