Oracle数据库操作中常用bat文件

(1)创建数据库

sqlplus "sys/allview@allview as sysdba"
 
create tablespace realstar
   datafile 'c:/oracle/oradata/allview/realstar.ora'
   size 5m
   reuse
   autoextend on
   next 512k
   maxsize unlimited;

 create tablespace ewfimg
   datafile 'c:/oracle/oradata/allview/ewfimg.ora'
   size 5m
   reuse
   autoextend on
   next 512k
   maxsize unlimited;

 create tablespace ycch
   datafile 'c:/oracle/oradata/allview/ycch.ora'
   size 5m
   reuse
   autoextend on
   next 512k
   maxsize unlimited;

 create tablespace da
   datafile 'c:/oracle/oradata/allview/da.ora'
   size 5m
   reuse
   autoextend on
   next 512k
   maxsize unlimited;

 create user realstar
   identified by realstar
   default tablespace realstar
   temporary tablespace temp
   quota unlimited on realstar;

 create user realimg
   identified by realimg
   default tablespace ewfimg
   temporary tablespace temp
   quota unlimited on ewfimg;


 create user ycch
   identified by ycch
   default tablespace ycch
   temporary tablespace temp
   quota unlimited on ycch;

 create user da
   identified by da
   default tablespace da
   temporary tablespace temp
   quota unlimited on da;

 grant connect,resource,dba to realstar;

 grant connect,resource,dba to da;

 grant connect,resource,dba to ycch;

 grant connect,resource,dba to realimg;

 (2)自动导入

imp da/da@yzfc file=F:/da%date:~4,10%.dmp full=y
imp realimg/realimg@yzfc file=F:/realimg%date:~4,10%.dmp full=y
imp ycch/ycch@yzfc file=F:/ycch%date:~4,10%.dmp full=y
imp realstar/realstar@yzfc file=F:/realstar%date:~4,10%.dmp full=y

(3)自动导出

exp da/da@yzfc file=F:/da%date:~4,10%.dmp
exp realimg/realimg@yzfc file=F:/realimg%date:~4,10%.dmp
exp ycch/ycch@yzfc file=F:/ycch%date:~4,10%.dmp
exp realstar/realstar@yzfc file=F:/realstar%date:~4,10%.dmp
exp sde/sde@yzgis file=F:/sde%date:~4,10%.dmp

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值