oracle导出dmp文件失败_oracle导出数据库dmp文件

2022-09-27 09:57:20 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

–创建用户

create user anhui identified by anhui

-给予用户权限

grant create session to anhui

grant connect,resource to anhui;

-创建表空间

1)先导dmp文件,报错:tablespace ‘FMIS_LOB’ does not exist

2)然后创建表空间

create tablespace FMIS_LOB DATAFILE ‘/data/db/shandong/FMIS_LOB.dbf’ Size 10240M AUTOEXTEND ON next 10M;

–加空间(空间不够时,加空间)

ALTER TABLESPACE rsapsr3 ADD DATAFILE ‘/data/shanghaiproject/rsapsr3_03.dbf’ Size 20480M AUTOEXTEND ON next 10M;

alter database datafile ‘/data/db/guiyang/FMIS1000.dbf’ offline drop;

drop tablespace FMIS1000 including contents and datafiles;

create tablespace FMIS1000 DATAFILE ‘/data/db/guiyang/FMIS1000.dbf’ Size 10240M AUTOEXTEND ON next 10M;

-导dmp文件

1) 用xshell连接服务器

2)连接之后,执行命令 su – oracle

3)执行命令

imp shandong/shandong@10.121.55.19/db file=/data/dmp/shandong/shuju-20180502/shuju2.dmp log=/data/dmp/shuju2.log full=y

(如果报错:only a DBA can import a file exported by another DBA,则给用户赋予权限grant dba to tianjin;)

-删除表的策略

select OBJECT_NAME,POLICY_GROUP,POLICY_NAME from user_policies;

exec dbms_rls.drop_grouped_policy(‘shandong’,‘XTYHXX’,‘SYS_DEFAULT’,‘PLC_XTYHXX’);//参数分别为用户名,OBJECT_NAME,POLICY_GROUP,POLICY_NAME

-导出dmp

导出dmp

exp shandong/shandong@10.121.55.3/bigdata file=/data/export-dmp/a.dmp log=/data/export-dmp/a.log tables=”(XTGLDXIDMC,XTCS,XTGLDXLX,XTENUMBANK)”

重启oracle

(1) 以oracle身份登录数据库,命令:su -oracle

(2) 进入Sqlplus控制台,命令:sqlplus /nolog

(3) 以系统管理员登录,命令:connect / as sysdba

(4) 启动数据库,命令:startup

(5) 如果是关闭数据库,命令:shutdown immediate

(6) 退出sqlplus控制台,命令:exit

(7) 进入监听器控制台,命令:lsnrctl

(8) 启动监听器,命令:start

(9) 退出监听器控制台,命令:exit

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/179081.html原文链接:https://javaforall.cn

0 人点赞