ORACLE创建表空间、删除用户与建立用户及权限及导入导出脚本

一.创建表空间
CREATE SMALLFILE TABLESPACE XZSP DATAFILE 'F:\oracle\product\10.2.0\oradata\xaorcl\xzsp' SIZE 300M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; 


CREATE SMALLFILE TABLESPACE XZJC DATAFILE 'F:\oracle\product\10.2.0\oradata\xaorcl\xzjc' 
SIZE 300M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT 
LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE TABLESPACE MIDDLE DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\JXORCL\middle' 
SIZE 300M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT 
LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

二.删除用户
drop user xzsp cascade;
drop user xzjc cascade;
drop user middle cascade;
drop user wangzhan cascade;

drop tablespace xxx including contents and datafiles 

drop tablespace XZSP including contents and datafiles;
drop tablespace XZJC including contents and datafiles;

三.创建用户及分权

create user xzsp identified by xzsp 
default tablespace xzsp
temporary tablespace temp;
grant dba,connect to xzsp;

create user xzjc identified by xzjc 
default tablespace xzjc
temporary tablespace temp;
grant dba,connect to xzjc;

create user middle identified by middle
default tablespace middle 
temporary tablespace temp;
grant dba,connect to middle ;

create user sanyauser identified by sanyauser
default tablespace xzsp 
temporary tablespace temp;
grant dba,connect to sanyauser;

create user wangzhan identified by wangzhan
default tablespace wangzhan
temporary tablespace temp;
grant dba,connect to wangzhan;

四.导入数据库  在windows cmd 的环境中运行
imp system/xzsp@orcl file=D:\vingsoft\projects\xiancity\backup\oracle\xaorcl20110218.dmp log=D:\oraclelog\xaoracle.log fromuser=(xzsp) touser=(xzsp)
imp system/xzsp@orcl file=D:\vingsoft\projects\xiancity\backup\oracle\xaorcl20110218.dmp fromuser=xzsp touser=xzsp

imp system/xzsp@orcl file=D:\vingsoft\projects\xiancity\backup\oracle\xaorcl20110218.dmp fromuser=(xzsp,,) touser=(xzsp2,,)

imp system/xzsp@syorcl file=D:\sanya\middle_20120214-150001.dmp fromuser=(middle) touser=(middle)

imp system/system@syorcl file=E:\1\2010-03-07.dmp  fromuser=xzsp touser=xzsp

imp log=plsimp.log file=E:\dbuserforfs.DMP 
userid=fsuser/fsuser@orcle_11 fromuser=fsuser touser=fsuser buffer=30720 commit=no grants=yes ignore=yes indexes=yes rows=yes show=no constraints=yes

exp system/oracle@JIAN owner=xzsp,xzjc,middle file=f:/1/jian20010518.dmp log=f:/1/jian20010518.log

exp system/oracle@jxorcl owner=xzsp,xzjc,middle file=f:/1/jxorcl20010518.dmp log=f:/1/jxorcl20010518.log

exp system/oracle@xaorcl owner=xzsp,xzjc file=f:/1/xaorcl.dmp log=f:/1/xaorcl.log
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值