dmp文件导入oracle

命令行运行:sqlplus登录

1. 创建目录
create or replace directory dump_oracle_db as 'F:\oracle_db';
--说明:
--dump_oracle_db--目录名
--F:\oracle_db--目录指向的文件夹
2. 查看创建的目录
select * from dba_directories;
3. 把dmp文件放到这个文件夹下
4. 创建用户
create user zfpt40 identified by oracle;
--说明:
--zfpt40--用户名(相当于数据库名)
5. 授权
grant dba to zfpt40;
grant read,write on directory dump_oracle_db to zfpt40;
6. 退出
exit;
7. 执行导入
impdp zfpt40/oracle@orcl dumpfile=ZFPT40_20181129_060716.DMP directory=DUMP_ORACLE_DB
--说明
--zfpt40/oracle--zfpt40是上面新建的用户名,oracle是给这个用户名设置的密码
--ZFPT40_20181129_060716.DMP--dmp文件名
--DUMP_ORACLE_DB--上面新建的目录


附:
扩充表空间:
ALTER TABLESPACE USERS ADD DATAFILE 'D:\APP\ZHAOYU\ORADATA\ORCL\USERS02.DBF' SIZE 30720M ;
alter tablespace temp add tempfile 'D:\APP\ZHAOYU\ORADATA\ORCL\temp03.dbf' size 5120m;

查询表空间利用情况:
select * from (
Select a.tablespace_name,
to_char(a.bytes/1024/1024,'99,999.999') total_bytes,
to_char(b.bytes/1024/1024,'99,999.999') free_bytes,
to_char(a.bytes/1024/1024 - b.bytes/1024/1024,'99,999.999') use_bytes,
to_char((1 - b.bytes/a.bytes)*100,'99.99') || '%'use
from (select tablespace_name,
sum(bytes) bytes
from dba_data_files
group by tablespace_name) a,
(select tablespace_name,
sum(bytes) bytes
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
union all
select c.tablespace_name,
to_char(c.bytes/1024/1024,'99,999.999') total_bytes,
to_char( (c.bytes-d.bytes_used)/1024/1024,'99,999.999') free_bytes,
to_char(d.bytes_used/1024/1024,'99,999.999') use_bytes,
to_char(d.bytes_used*100/c.bytes,'99.99') || '%'use
from
(select tablespace_name,sum(bytes) bytes
from dba_temp_files group by tablespace_name) c,
(select tablespace_name,sum(bytes_cached) bytes_used
from v$temp_extent_pool group by tablespace_name) d
where c.tablespace_name = d.tablespace_name
)
order by tablespace_name

 

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值