由impdp导入引起的oracle用户权限的问题

IMPDP导入数据提示'insufficient privileges' 环境描述: 这几天利用expdp/impdp工具配置一台数据库用作备用库,在主库上发生故障时能快迅将业务切到备库上(Data guard还在研究中),而且为了保证两台服务器都能用使用,每个月交替接管业务。 Oracle 库里的数据主要分为2部份,第1部份业务基础数据大约为4G(有几十张表),第2部份运营数据为1张分区表大约在2T左右(数据比较大),利用expdp导出时也分为两部份进行,以下错误 阅读详情

      根据业务要求需要将数据库上的TEST用户下的所有对象复制到一个新建的用户TEST2上,但不需要表数据。想到的办法是先用expdp的CONTENT=METADATA_ONLY参数导出元数据,然后使用impdp的remap_schema=TEST:TEST2来转换,完成业务要求。

      提交给业务部门后,又提出要求需要将TEST2业务表使用的表空间与索引表空间分配到指定表空间并分开。

使用如下策略完成:

      首先使用expdp将TEST2导出,命令如下:

      nohup expdp system/system directory=expdp schemas=test2 dumpfile=test0213.dmp logfile=test0213.log  &

      然后修改数据的表空间并排除索引导入,命令如下:

      nohup impdp system/system directory=expdp  dumpfile=test0213.dmp logfile=test0213_table.log remap_tablespace=TEST:TEST_DATA  schemas=TEST2 exclude=index &

      再修改索引的表空间并只导入索引,命令如下:

      nohup impdp system/system directory=expdp1  dumpfile=test0213.dmp logfile=test0213_index.log remap_tablespace=TEST:TEST_INDEX schemas=TEST2 include=index  &

     导入完成后通过dba_segments查看验证发现segment_type为index的tablespace仍难有为TEST的,进一步查看是因为该索引为数据库创建主键约束时自动创建的索引,使用下面的命令进行修改:

      ALTER INDEX INDEX_NAME REBUILD TABLESPACE TEST_INDEX;

      完成后提交给业务部门,结果又提出TEST2用户拥有查询TEST用户对象的权限,要求去除掉。

     经过验证核实,TEST只赋予了connect 以及resource权限,正常情况是不能访问其他用户的信息的,但该用户确实存在该种情况。

     通过查找user_role_privs(查看用户拥有的角色权限,如connect,resource),user_tab_privs(查看用户拥有 查询、修改其他用户的下指定的表权限),仍为发现异常。可以判断问题出在以TEST用户导出时默认将该用户的权限信息导出,而导入时又将该权限赋予了新用户TEST2,导致TEST2拥有一些特殊权限。

     使用plsql develop工具查看TEST2用户的创建语句,发现有大量权限赋予,其中保护grant select any table权限,从而导致其拥有查询其他用户的权限,权限信息如下:

grant administer any sql tuning set to TEST2;
grant administer database trigger to TEST2;
grant administer sql management object to TEST2;
grant administer sql tuning set to TEST2;
grant advisor to TEST2;
grant alter any assembly to TEST2;
grant alter any cluster to TEST2;
grant alter any cube to TEST2;
grant alter any cube dimension to TEST2;
grant alter any dimension to TEST2;
grant alter any edition to TEST2;
grant alter any index to TEST2;
grant alter any indextype to TEST2;
grant alter any library to TEST2;
grant alter any materialized view to TEST2;
grant alter any mining model to TEST2;
grant alter any operator to TEST2;
grant alter any outline to TEST2;
grant alter any procedure to TEST2;
grant alter any role to TEST2;
grant alter any sequence to TEST2;
grant alter any sql profile to TEST2;
grant alter any table to TEST2;
grant alter any trigger to TEST2;
grant alter any type to TEST2;
grant alter database to TEST2;
grant alter profile to TEST2;
grant alter resource cost to TEST2;
grant alter rollback segment to TEST2;
grant alter session to TEST2;
grant alter system to TEST2;
grant alter tablespace to TEST2;
grant alter user to TEST2;
grant analyze any to TEST2;
grant audit any to TEST2;
grant audit system to TEST2;
grant backup any table to TEST2;
grant become user to TEST2;
grant change notification to TEST2;
grant comment any mining model to TEST2;
grant comment any table to TEST2;
grant create any assembly to TEST2;
grant create any cluster to TEST2;
grant create any context to TEST2;
grant create any cube to TEST2;
grant create any cube build process to TEST2;
grant create any cube dimension to TEST2;
grant create any dimension to TEST2;
grant create any directory to TEST2;
grant create any edition to TEST2;
grant create any index to TEST2;
grant create any indextype to TEST2;
grant create any job to TEST2;
grant create any library to TEST2;
grant create any materialized view to TEST2;
grant create any measure folder to TEST2;
grant create any mining model to TEST2;
grant create any operator to TEST2;
grant create any outline to TEST2;
grant create any procedure to TEST2;
grant create any sequence to TEST2;
grant create any sql profile to TEST2;
grant create any synonym to TEST2;
grant create any table to TEST2;
grant create any trigger to TEST2;
grant create any type to TEST2;
grant create any view to TEST2;
grant create assembly to TEST2;
grant create cluster to TEST2;
grant create cube to TEST2;
grant create cube build process to TEST2;
grant create cube dimension to TEST2;
grant create database link to TEST2;
grant create dimension to TEST2;
grant create external job to TEST2;
grant create indextype to TEST2;
grant create job to TEST2;
grant create library to TEST2;
grant create materialized view to TEST2;
grant create measure folder to TEST2;
grant create mining model to TEST2;
grant create operator to TEST2;
grant create procedure to TEST2;
grant create profile to TEST2;
grant create public database link to TEST2;
grant create public synonym to TEST2;
grant create role to TEST2;
grant create rollback segment to TEST2;
grant create sequence to TEST2;
grant create session to TEST2;
grant create synonym to TEST2;
grant create table to TEST2;
grant create tablespace to TEST2;
grant create trigger to TEST2;
grant create type to TEST2;
grant create user to TEST2;
grant create view to TEST2;
grant debug any procedure to TEST2;
grant debug connect session to TEST2;
grant delete any cube dimension to TEST2;
grant delete any measure folder to TEST2;
grant delete any table to TEST2;
grant drop any assembly to TEST2;
grant drop any cluster to TEST2;
grant drop any context to TEST2;
grant drop any cube to TEST2;
grant drop any cube build process to TEST2;
grant drop any cube dimension to TEST2;
grant drop any dimension to TEST2;
grant drop any directory to TEST2;
grant drop any edition to TEST2;
grant drop any index to TEST2;
grant drop any indextype to TEST2;
grant drop any library to TEST2;
grant drop any materialized view to TEST2;
grant drop any measure folder to TEST2;
grant drop any mining model to TEST2;
grant drop any operator to TEST2;
grant drop any outline to TEST2;
grant drop any procedure to TEST2;
grant drop any role to TEST2;
grant drop any sequence to TEST2;
grant drop any sql profile to TEST2;
grant drop any synonym to TEST2;
grant drop any table to TEST2;
grant drop any trigger to TEST2;
grant drop any type to TEST2;
grant drop any view to TEST2;
grant drop profile to TEST2;
grant drop public database link to TEST2;
grant drop public synonym to TEST2;
grant drop rollback segment to TEST2;
grant drop tablespace to TEST2;
grant drop user to TEST2;
grant execute any assembly to TEST2;
grant execute any class to TEST2;
grant execute any indextype to TEST2;
grant execute any library to TEST2;
grant execute any operator to TEST2;
grant execute any procedure to TEST2;
grant execute any program to TEST2;
grant execute any type to TEST2;
grant execute assembly to TEST2;
grant export full database to TEST2;
grant flashback any table to TEST2;
grant flashback archive administer to TEST2;
grant force any transaction to TEST2;
grant force transaction to TEST2;
grant global query rewrite to TEST2;
grant grant any object privilege to TEST2;
grant grant any privilege to TEST2;
grant grant any role to TEST2;
grant import full database to TEST2;
grant insert any cube dimension to TEST2;
grant insert any measure folder to TEST2;
grant insert any table to TEST2;
grant lock any table to TEST2;
grant manage scheduler to TEST2;
grant manage tablespace to TEST2;
grant merge any view to TEST2;
grant on commit refresh to TEST2;
grant query rewrite to TEST2;
grant restricted session to TEST2;
grant resumable to TEST2;
grant select any cube to TEST2;
grant select any cube dimension to TEST2;
grant select any mining model to TEST2;
grant select any sequence to TEST2;
grant select any table to TEST2;
grant select any transaction to TEST2;
grant under any table to TEST2;
grant under any type to TEST2;
grant under any view to TEST2;
grant update any cube to TEST2;
grant update any cube build process to TEST2;
grant update any cube dimension to TEST2;
grant update any table to TEST2;


解决办法:使用dba用户进行权限收回,命令如下:

revoke administer any sql tuning set from  TEST2;
revoke administer database trigger from TEST2;
revoke administer sql management object from TEST2;


至此,终于完成业务要求,也顺便将该次碰到的问题及解决思路汇总。

oracel数据库 impdp导入.dmp文件的操作 首先创建一个新用户,保证和导出dmp文件时的用户名,密码以及对应的表空间名相同。 不多说,直接上图 (基本只用改下面备注中文部分,根据需求对应替换就行) 1.创建用户 create user 用户 identified by 口令; 2.创建一个表空间 create tablespace 表空间变量名 logging datafile ‘路径\表空间名.dbf’ size 50m aut... 阅读详情

相关推荐

Oracle数据泵expdp和impdp导入导出详解

Oracle数据泵expdp和impdp导入导出详解

tttzzzqqq2018的博客 1万+

impdp权限 oracle,data pump expdp/impdp丢失权限角色 grant role的问题

对于使用data pump的 数据迁移,expdp/impdp可能存在丢失权限角色 grant role的问题对于此类问题 , 可以考虑使用 下面的expdp/impdp脚本仅仅导出希望导出的用户的权限和相关角色JOB_NAME=EXPDP_USERSDIRECTORY=DTPUMPFULL=YDUMPFILE=users_privs.dmpLOGFILE=users_expdp.logINCLU...

weixin_29479863的博客 1039

SPMI、PMBus、AVSBus:三大电源管理总线对比与选型指南

在现代电子系统中,电源管理是确保高性能与低功耗平衡的核心技术。其原理在于通过数字通信协议,实现电源管理单元(PMIC)与用电芯片间的精准“对话”,从而动态调整供电。这项技术的核心价值在于提升系统能效、增强可靠性并简化设计。其应用场景广泛,从智能手机、服务器到汽车电子无处不在。具体实现上,衍生出了三大主流协议:为移动嵌入式高度集成的SPMI总线、专注于工业标准监控的PMBus总线,以及追求极致实时能效的AVSBus总线。理解SPMI在复杂时序控制与PMBus在标准化配置方面的异同,是进行电源架构选型与调试的关

ithome 473

oracle impdp/expdp 的权限问题

直接运行 expdp scott/tiger 系统报错: ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-39145: directory object parameter must be specified and non-null 网上说要把在 data_dump_dir

Halou, I'm a DBA! 1万+

手动测试台架搭建,让你的车载测试更轻松

如果你也在经常进行车载测试,就知道有时候手头的设备并不能完全满足需求。 在我之前的测试中,发现了一些问题,但是却找不到根本原因。于是,我开始思考如何打造一个更为完美的手动测试台架,让测试变得更加轻松。 经过不断地实践和调试,我终于成功搭建出了一个能够满足自己需求的测试台架。现在,我想和大家分享这个搭建的经验,希望能够帮助到在车载测试领域工作的小伙伴们,让你们的测试更加准确、高效!

weixin_67553250的博客 1万+

Linux 内核中 ARP 协议的全链路解析:从触发机制到物理层发送

核心设计思想按需解析:减少不必要的 ARP 请求,降低网络负载。分层解耦:协议栈各层(邻居子系统、Netfilter、驱动)职责分离,提高扩展性。ARP的核心作用是将IP映射为MAC地址,确保数据链路层能正确封装帧。其触发时机围绕“未知MAC地址需求”展开,覆盖通信初始化、缓存更新、网络变更及维护等多种场景。

数字人生 372

PLSQL导入dmp文件完整步骤

PLSQL导入dmp文件完整步骤

weixin_63610637的博客 1万+

同步调相机启动与并网控制技术方案

同步调相机起动与并网控制技术方案采用背靠背变流器系统,通过静止变频器(SFC)策略实现无原动机驱动的同步电机从静止到同步转速的平稳起动。方案详细阐述了硬件自检、模块初始化、转子位置检测等关键环节,重点解决启动转矩为零、冲击电流大等挑战。系统基于STM32或C2000系列控制器,包含网侧/机侧变流器、检测保护单元及通信接口,通过励磁脉冲和电压响应分析实现高精度转子初始定位,为后续并网提供必要条件。代码级实现涵盖了ADC自检、数字IO验证及通信端口测试等核心功能。

huanghm88的专栏 312

记录一次oracle解决使用imp导入时报错ORA-01435: 用户不存在

oracle解决imp导入报错ORA-01435:用户不存在

xioxi 2879

知识追踪实战:lstm+ Multi-head Attention注意力机制的学生做题成绩预测实战

知识追踪实战:lstm+ Multi-head Attention注意力机制的学生做题成绩预测实战

2224

【ARM Coresight | AMBA BUS | Cache 与 MMU/MPU | CoreLink | GCC | CSH 专栏导读】

1. ARM Coresight(SoC-400/SoC-600) 专栏 2. ARMv8/v9 CPU/Cache 专栏 3. Linux ARM AMBA 总线 专栏 4. Trace32/DS-5 专栏。。。

CodingCos的博客 8255

Linux环境下导入dmp 详细步骤!

操作流程 1.su - oracle 2. sqlplus / as sysdba 3.创建表空间 Create tablespace TELEMT DATAFILE ‘\home\TELEMT.DBF’ Size 5120M autoextend on next 100M; 4.新增用户 CREATE USER telant_test IDENTIFIED BY telant_test DEFA...

weixin_44611956的博客 7439

lammps教程:MS转data文件出错原因分析及解决办法

使用ms建模是lammps建模的一种重要方法,但是ms建模转换为data过程中经常会出现各种各样的错误。 ms模型转data文件流程分两部分,一是ms建模、forcite设置力场并导出car文件,二是msi2lmp将car转为data文件。 任何一个环节出错都会导致无法得到data文件,最容易出错的是forcite力场设置环节。 forcite力场设置出错原因有很多,一个原因是缺乏某类原子的力场参数。 msi2lmp软件只能转换cvff或pcff力场的car文件,因此,如果力场中不包含某类原子的参数,在设置

lammps_jiayou的博客 5062

oracle全库导入命令解析,oracle数据库全库的导出导入实战手册

Oracle数据库导入导出(expdp/impdb)1、全库导出(expdp参考shell脚本)#!/bin/bash#导入环境变量source /home/oracle/.bash_profileexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1/export PATH=...

weixin_34791959的博客 969

【PX4学习笔记】3. PX4 固件烧写(1 探索过程)

飞控型号:cube orange【PX4官方用户指南中关于cube orange的描述】 飞控载板型号:Mini Carrier Board【迷你载板说明文档】 固件安装参考:The Cube User Manual V1.0

【人工智障 | 计算鸡视觉 | 机器孩】 7678

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Oracle:使用Impdp导入dmp文件的详细过程

完全转载自:https://www.cnblogs.com/afei1013/p/13123784.html 这一天为了导入这个Oracle的dmp文件,简直就是血泪史,因本人对Oracle并不是很会,随意踩了很多小白会踩的坑,因此特意记录一下过程,防备下次的使用。 1、首先将你需要的dmp文件准备好,将其放在Oracle安装目录的任意位置,但是如果你想按照我的步骤来,就和我安装到相同的目录,否则会和第五步的impdp语句中 DATA_PUMP_DIR 所指向的路径不一致。 2、创建表..

qq_41297934的博客 7507

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

oracle impdp导入full,使用数据泵impdp导入数据

前一些测试里面,通过expdp导出了各种数据库表、模式、表空间以及全库。在这里,我们就通过之前导出来的逻辑备份文件,使用impdp工具把导出的文件逆向导入数据库里面。----使用数据泵impdp导入数据:--策略1:查看Scott用户拥有的表:SQL> select tname from tab;TNAME------------------------------BONUSDEPTEMPH...

weixin_35917193的博客 3136

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

解决:impdp导入.dmp文件

首先创建一个新用户,保证和导出dmp文件时的用户名,密码以及对应的表空间名相同。 不多说,直接上图 (基本只用改下面备注中文部分,根据需求对应替换就行) 1.创建用户 create user 用户 identified by 口令; 2.创建一个表空间 create tablespace 表空间变量名 logging datafile ‘路径\表空间名.dbf’ size 50m autoext...

MelanceXin的博客 2万+

oracle impdp数据库导入

oracle impdp数据库导入写在前面废话不多说报错喽导入数据报错一导入数据报错二导入数据报错三 写在前面 刚到新环境,要在本地搭建开发环境,数据库也需要使用 本地库,收到一个包含数据库dmp文件的数据包,让在本地导库。以前都是运维搭好环境直接开发,怎么做?于是百度呗,搜索资料,学习也是一种能力。网上相关资料也多,不过并不都完整,而且自己动手实践时总会有各种不一样的情况,这也才是程序开发的特点...

weixin_39075191的博客 3280

【Oracle】使用expdp/impdp导入导出用户数据库数据

业务场景:从Windows上的Oracle数据库将某个用户下的所有数据迁移到Linux上的Oracle数据库下的另一个用户中。其中两个数据库版本是一致的,均为11.2.0.1。可以看成是两个Oracle数据库下用户数据的导入导出。 数据导入导出的流程就是使用expdp导出数据,然后使用impdp导入数据。(使用expdp/impdp需要Oracle版本不低于10g) expdp导出某个用户下的所用数据 在windows系统上创建一个文件夹,用于存放导出的数据。本文创建的文件夹位置为:D:\oracle.

suelta_th的博客 1万+

impdp导入报权限问题

检查文件系统、directory、用户权限均正常,并且导入过一次也正常。发现是个触发器,并且重编译发生错误,所以干脆删掉。根据报错查看编译出错的对象。

lmxx2020的博客 510

Oracle 创建用户,表空间,以及导入数据

Oracle 创建用户,表空间,以及导入数据

m0_60526787的博客 1023

导出oracle全库数据,oracle数据库全库的导出导入实战手册

Oracle数据库导入导出(expdp/impdb)1、全库导出(expdp参考shell脚本)#!/bin/bash#导入环境变量source /home/oracle/.bash_profileexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1/export PATH=...

weixin_31742871的博客 3361

Oracle中expdp与impdp--导入和导出操作步骤

Oracle expdp 与impdp 一, 根据用户导出导入数据(用户和表空间都相同): 这些命令必须在Oracle 工具执行: create directory dpdata1 as ‘E:\oracle_home\product\backup’; 这个E:\oracle_home\product\backup必须存在也就是在E盘创建这个目录; grant create...

菜鸟清风 5176

Oracle impdp 创建用户避坑指南(表空间配额,权限)

Oracle数据泵remap_tablesapce,remapschema参数与表空间配额、权限注意点

ChunkWen的博客 1977

Oracle利用impdp 导入数据库的归纳

我们知道,当我们要导入一个数据库的时候,说起来很简单,但是其中会遇到各种问题,这个就占个位置慢慢整理吧: 1, 利用impdp导入数据库分类     a, 完整导入:就是加入full=y这个关键词,不能和schemas, tables,等关键词重用  impdp \"/ as sysdba\" full=y directory=expdump dumpfile=test1.dmp logfi

wonderjjm的专栏 1万+
上一篇: ORACLE 11G双节点RAC配置单实例DG
下一篇: nginx的https代理配置
orabing
博客等级 码龄10年 5粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值