oracle备份及恢复
一、導(dǎo)出數(shù)據(jù)庫
exp 用戶名/密碼@ORCL file=D:\data.dmp owner=用戶名 plsql的使用:1、登錄你要導(dǎo)出的數(shù)據(jù)庫;2、工具→導(dǎo)出表:二、導(dǎo)入數(shù)據(jù)庫:
1、創(chuàng)建表空間:create tablespace AJBG datafile 'F:\oracleData\AJBG.dbf' size 100m autoextend on next 50m;
2、創(chuàng)建用戶并分配表空間:
create user用戶名 identified by 密碼 default tablespace 表空間 temporary tablespace 臨時表空間 ;
3、給用戶分配權(quán)限:
grant connect, resource, dba to 用戶名,【用戶名2】;
4、導(dǎo)入數(shù)據(jù)庫:
imp kang/123456@localhost/ORACLE file=“C:\daochu.dmp” full=y ignore=y”
使用plsql導(dǎo)入:
1、登錄其他用戶;
2、創(chuàng)建表空間:
create tablespace AJBG datafile ‘F:\oracleData\AJBG.dbf’ size 100m autoextend on next 50m;
注:在創(chuàng)建表空間的時候要和導(dǎo)入數(shù)據(jù)的表空間名一樣,如果不知道用記事本打開dmp文件,然后搜索tablespace。
3、找到user表:
鼠標(biāo)右鍵點(diǎn)擊新增
將剛才的表空間分配給你要創(chuàng)建的用戶;
點(diǎn)擊角色權(quán)限:
分配這三個權(quán)限,點(diǎn)擊應(yīng)用;
然后退出當(dāng)前登錄的用戶,登錄剛才創(chuàng)建的用戶:
點(diǎn)擊工具→導(dǎo)入表
點(diǎn)擊導(dǎo)入,數(shù)據(jù)庫導(dǎo)入成功!
注:數(shù)據(jù)庫導(dǎo)入后,大家如果想檢查一下導(dǎo)入的是否合適,使用:
select count(*) from user_table;這是查詢數(shù)據(jù)庫中表的個數(shù);
總結(jié)
以上是生活随笔為你收集整理的oracle备份及恢复的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle主键自动增长
- 下一篇: 图片验证码生成代码