ITPub博客

首页 > 数据库 > Oracle > linux下的数据库备份

linux下的数据库备份

Oracle 作者:zhanglongchao 时间:2010-12-30 17:23:35 0 删除 编辑

要学习的还很多,留在博客里存档比存在电脑里要保险的多。

在oracle用户下,oracle/bin目录下才有exp和imp的命令。

su - oracle

导出数据库:
exp test/test log=/tmp/exp.log file=/tmp/exp.dmp full=y
--//删除用户
drop user 用户名 cascade; --//执行该语句请小心,会级联删除该用户下所有对象。
--//创建临时表空间
create temporary tablespace temp
  2  tempfile '/tmp/oracle10g/tmp.dbf'      
  3  size 64m autoextend on
  4  next 64m maxsize 2048m
  5  extent management local;
--//创建数据表空间
 create tablespace test logging
  2  datafile '/tmp/oracle10g/test.dbf'
  3  size 64m autoextend on
  4  next 64m maxsize 2048m
  5  extent management local;
--//创建用户并指定表空间
create user test identified by test 
  2  default tablespace test 
  3  temporary tablespace temp;
--//给用户授予权限
grant dba,connect,resource to test;
导入数据库:
imp test/test file=/tmp/exp.dmp ignore=y full=y

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26059892/viewspace-1116983/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-07-15