欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle 导入DBF故障存储文件

程序员文章站 2022-08-02 18:50:14
创建表空间及用户CREATE TABLESPACE OracleDBFDATAFILE 'D:\app\zhoulx\oradata\bdc\OracleDBF.DBF' SIZE 100M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED -- 这里是你设置数据库存 ......

创建表空间及用户
create tablespace oracledbf
datafile 'd:\app\zhoulx\oradata\bdc\oracledbf.dbf' size 100m autoextend on next 20m maxsize unlimited -- 这里是你设置数据库存放的地方,可以自己选定位置
permanent
default storage(initial 64k minextents 1 maxextents 2147483645)
minimum extent 64k
logging
online
/
create user oracledbf identified by salis default tablespace oracledbf temporary tablespace temp;
/
grant dba to oracledbf with admin option
/
grant select any dictionary to oracledbf with admin option
/
grant select any sequence to oracledbf with admin option
/
grant select any table to oracledbf with admin option
/
grant select any transaction to oracledbf with admin option
/
grant unlimited tablespace to oracledbf with admin option
/
grant create session,resource to oracledbf with admin option
/
grant create any view to oracledbf
/

数据泵导入
查询目录
select * from dba_directories
创建目录
create directory database as 'e:\database' --这一步可以忽略

--------------------------------------------------------------------------------------------------------

这一步在命令行输入
导入
impdp oracleuser/oracleuserpassword@oracle地址(例如:127.0.0.1) directory='e:\database' dumpfile=oracledbf.dmp schemas=oracledbf  -- e:\database 是你存放dbf文件的位置

--imp oracleuser/oracleuserpassword@oracle地址(例如:127.0.0.1) directory='e:\database' dumpfile=oracledbf.dmp schemas=oracledbf  -- e:\database 是你存放dbf文件的位置
导出
expdp oracleuser/oracleuserpassword@oracle地址(例如:127.0.0.1)directory='e:\database' dumpfile=oracledbf.dmp schemas=oracledbf  -- e:\database 是你存放dbf文件的位置

--exp oracleuser/oracleuserpassword@oracle地址(例如:127.0.0.1)directory='e:\database' dumpfile=oracledbf.dmp schemas=oracledbf  -- e:\database 是你存放dbf文件的位置
---------------------------------------------------------------------------------------------------------
删除用户再创建
drop user oracledbf cascade;
/
create user oracledbf identified by salis default tablespace oracledbf temporary tablespace temp;
/
grant dba to oracledbf with admin option
/
grant select any dictionary to oracledbf with admin option
/
grant select any sequence to oracledbf with admin option
/
grant select any table to oracledbf with admin option
/
grant select any transaction to oracledbf with admin option
/
grant unlimited tablespace to oracledbf with admin option
/
grant create session,resource to oracledbf with admin option
/
grant create any view to oracledbf
/