oracle创建表空间,创建用户以及授权

打开windows系统的运行对话框,快捷键是win + R
输入cmd 然后回车,在弹出的窗体里拷贝下面的脚本并执行

先cd\ 回车


//用sys账号登录,密码toone,这里要改成你的,下面是ipmstjdt机器的
sqlplus sys/toone2009@sghys as sysdba  (回车,下面的每条脚本拷贝后,按回车执行)

//删除原有用户
drop user xadt cascade;

//删除原有表空间
drop tablespace xadt including contents and datafiles;

//删除原有临时表空间
drop tablespace xadt_temp including contents and datafiles;

//创建临时表空间,盘符对应ipmstjdt机器的路径
create temporary tablespace xadt_temp
tempfile 'D:\oracle\product\10.2.0\db_2\orcl10\xadt_temp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local; 


//创建数据表空间,盘符对应ipmstjdt机器的路径
create tablespace xadt
logging
datafile 'D:\oracle\product\10.2.0\db_2\orcl10\xadt.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;


//创建用户并指定表空间
create user xadt identified by "111111"
default tablespace xadt
temporary tablespace xadt_temp;

//给用户授予权限
grant connect,resource,dba to xadt;

//以后以该用户登录,创建的任何数据库对象都属于xadt_temp 和xadt表空间,这就不用在每创建一个对象给其指定表空间了

//退出sqlplus环境
exit

//导入命令, 注意dmp文件是用exp命令导出才行,即imp 命令对应exp  而impdp对应expdp
imp xadt/111111@sghys full=y ignore=y file=C:\xadt_20120307.dmp grants=y;

//导出命令
EXP xadt/111111@sghys BUFFER=64000 FILE=C:\xadt_20110714.DMP OWNER=xadt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值