oracle 备份


cmd-》sqlplus
登陆用户名:conn as sysdba
口令:为空

--创建临时表空间
create temporary tablespace  xzsp_liuan_temp 
tempfile 'E:\oracle_data\xzsp_wuxi_temp.dbf' 
size 32m 
autoextend on 
next 32m
extent management local;

--创建表空间
create tablespace xzsp_liuan
logging
datafile 'E:\oracle_data\xzsp_liuan.dbf' 
size 32m 
autoextend on 
next 32m
extent management local;

--创建用户
create user xzsp_liuan identified by "123"
default tablespace xzsp_liuan
temporary tablespace xzsp_liuan_temp;

--授权
grant connect,resource,dba to xzsp_liuan;


===================================================================================


create user xzsp_liuan identified by "123"
default tablespace xzsp_liuan;
--还原库
imp xzsp_linshu/123@orcl fromuser=xzsp_linshu touser=xzsp_linshu file=''  ignore=y;
--备份库
exp xzsp_linshu/123@orcl file='c:\xzsp_linshu20110720.dmp'  

--删除表空间
drop tablespace  gx_zjjk  including contents and datafiles; 
drop tablespace  xzsp_langxi  including contents and datafiles;

--删除用户
drop user gx_zjjk cascade;


alter user jx_zjjk account unlock;

drop tablespace xzsp_nt including contents and datafiles CASCADE CONSTRAINTS;


--备份数据库(oracle11G备份到oracle10G)

EXPDP USERID='xzsp_fuyun/zwfw123TH@orcl as sysdba' schemas=xzsp_fuyun directory=DATA_PUMP_DIR dumpfile=xzsp_fuyun20120831.dmp logfile=xzsp_fuyun20120831.log version=10.2.0.1.0

目录:app\Administrator\admin\orcl\dpdump下生成


--还原库(oracle11G还原到oracle10G)

将xzsp_fuyun20120801.dmp文件拷贝到了admin\orcl\dpdump目录下

IMPDP USERID='xzsp_fuyun/123@orcl as sysdba' schemas=xzsp_fuyun directory=DATA_PUMP_DIR dumpfile=1.DMP logfile=xzsp_fuyun.log version=10.2.0.1.0












http://wenku.baidu.com/view/c7d426fbaef8941ea76e05d1.html
http://baike.baidu.com/view/2973562.htm

你可能感兴趣的:(oracle)