toad for oracle(导入导出实例)

本文详细介绍了Oracle数据库的导入导出操作,包括物理备份与逻辑备份的区别,逻辑备份的三种模式(表模式、用户模式、完全模式)及其具体命令,以及数据库的恢复方法。特别强调了在备份和恢复过程中的注意事项,如字符集转换和备份时间的选择。
摘要由CSDN通过智能技术生成

例:

create user his identified by his default tablespace users temporary tablespace temp;
grant connect,resource,dba to his;
create tablespace his
logging
datafile 'd:/oracle/product/10.2.0/oradata/zjxsh/his.ora' size 100M extent
management local segment space management auto;

exp his/ny@ny file=d:/0706ny full=y
exp his/his@xshis file=d:/0724xshis full=y
imp his/his@zjxshis file=d:/0724xshis.DMP fromuser=(his,chk,emr,fee,inv,med,opr,dig)touser=(his,chk,emr,fee,inv,med,opr,dig) ignore=y
imp his/his@zjxsh file=d:/0724xshis.DMP fromuser=his touser=his ignore=y
imp chk/chk@zjxsh file=d:/0724xshis.DMP fromuser=chk touser=chk ignore=y
imp emr/emr@zjxsh file=d:/0724xshis.DMP fromuser=emr touser=emr ignore=y
imp fee/fee@zjxsh file=d:/0724xshis.DMP fromuser=fee touser=fee ignore=y
imp inv/inv@zjxsh file=d:/0724xshis.DMP fromuser=inv touser=inv ignore=y
imp med/med@zjxsh file=d:/0724xshis.DMP fromuser=med touser=med ignore=y
imp opr/opr@zjxsh file=d:/0724xshis.DMP fromuser=opr touser=opr ignore=y
imp dig/dig@zjxsh file=d:/0724xshis.DMP fromuser=dig touser=dig ignore=y
imp mat/mat@zjxsh file=d:/0724xshis.DMP fromuser=mat touser=mat ignore=y
imp pas/pas@zjxsh file=d:/0724xshis.DMP fromuser=pas touser=pas ignore=y


create table name2 as select * from name1;
 insert into name3  select * from name2;(*表示表字段,按顺序插入)


有时候我们会遇到这样的情况,现有的数据库要从一个机器转移到另外一个机器上,一般我们会使用导出,导入。但是如果数据库的数据非常多,数据文件尺寸很大,那么在导出导入的过程就很可能会出现问题,并且漫长的过程也是我们无法容忍的。 在这种情况下,我们可以简单地使用操作系统的copy命令,直接进行数据库的转移。以下示例均在Redhat Fedora Core 1上的Oracle9.2.0.1中操作,其它操作系统和Oracle版本同样适用。假设我们的数据库在服务器A上,$ORACLE_BASE是/oracle,$ORACLE_HOME是 /oracle/prodUCt/9.2.0。现在我们要将此数据库转移到服务器B上,并且新的$ORACLE_BASE是/u01/oracle,$ ORACLE_HOME是/u01/oracle/product/9.2.0。SID是oraLinux。

操作步骤如下:
一. 在服务器B上安装Oracle,安装过程中不要创建数据库。
     用户的profile直接从服务器A上copy过来即可,注意需要修改原先的$ORACLE_HOME到现在的位置。
二. 如果服务器A上的Oracle使用的是spfile,那么根据此spfile创建pfile:
      create pfile from spfile;
三. 关闭服务器A上的数据库,shutdown immediate。如果数据库不允许关闭,
     那么可以使用联机备份,这种情况数据库必须处于archivelog模式,
     转移的原理和允许关闭的情况一样,此处不作讨论。
四. 备份服务器A上的所有数据文件,包括以下:
a) 所有的datafile(临时文件可以不copy,比如temp01.dbf)
b) 所有的online redo log
c) 所有的archive redo log
d) 所有的control file
e) $ORACLE_HOME/dbs/init.ora(此文件是在上面第二步中创建的)
f) $ORACLE_HOME/dbs/orapw(这是p

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值