expdp按照schemas导出数据后,packages以及function失效(编译后仍然失效)
作者:互联网
好久没有写帖子了,凑一篇帖子吧,开发需要我从线上的库按照用户模式导出所有数据,他们进行测试。
领导的意思是生产数据还需要删除敏感的数据。
执行的语句如下:
expdp ttfc/密码 directory=RDS_CLD_10 network_link=RDS_CLD_11 dumpfile=RDS_CLD_11_%yy%%mm%%dd%_%Thh%%Tmm%.dmp logfile=RDS_CLD_11_%yy%%mm%%dd%_%Thh%%Tmm%.log schemas=racttfc compression=ALL
select 'grant '||PRIVILEGE || ' on '||owner||'.'||TABLE_NAME||' to '||' sjttfc ;' from user_tab_privs;grant UPDATE on RACTTFC.TOAD_PLAN_TABLE to sjttfc ;
grant SELECT on RACTTFC.TOAD_PLAN_TABLE to sjttfc ;
grant INSERT on RACTTFC.TOAD_PLAN_TABLE to sjttfc ;
grant DELETE on RACTTFC.TOAD_PLAN_TABLE to sjttfc ;
grant SELECT on RACTTFCCHECK.LOT_BET_DETAIL_CHECK to sjttfc ;
grant INSERT on RACTTFCCHECK.LOT_BET_DETAIL_CHECK to sjttfc ;
alter tablespace NB_TBS_YOBET add datafile '/oradata/ttfc/NB_TBS_YOBET11.dbf' size 2g autoextend on next 256m;
alter tablespace NB_TBS_YOBET add datafile '/oradata/ttfc/NB_TBS_YOBET12.dbf' size 2g autoextend on next 256m;
alter tablespace NB_INX_TBS_YOBET add datafile '/oradata/ttfc/NB_INX_TBS_YOBET03.dbf' size 2g autoextend on next 256m;
impdp 'ttfc/"密码"' directory=expdp_dump dumpfile=RDS_CLD_11_20200422_1153.DMP logfile=RDS_CLD_11_20200422.log remap_schema=racttfc:sjttfc TABLE_EXISTS_ACTION=replace
然后RACTTFC删除敏感数据
select 'delete from ' || TABLE_NAME || ' where PLATFORM_IDENT in (' || '''qa''' || ',' || '''qc''' || ',' || '''qe''' || ',' ||
'''qd''' || ');'
from user_tab_columns
where colUmn_name = 'PLATFORM_IDENT';
and TABLE_NAME IN (select tname from tab where TABTYPE = 'TABLE');
后面在进行统计信息的收集,以及失效对象的编译,意外的是,还是有一些对象无效,生产上是有效的,以下是现在无效的对象
生产上没有问题的如下:
打开编译后还失败的packages,然后就从生产上找到相应的自定义的类:
然后:
CREATE OR REPLACE TYPE "TABLETYPE" as table of VARCHAR2(32676);
CREATE OR REPLACE TYPE "TYPE_ARRINT" IS varray(10) OF int;
CREATE OR REPLACE TYPE "TYPE_ARRSTR" IS varray(10) OF VARCHAR2(50);
然后重新编译失效的对象,OK,成功了
为啥有3个自定义的类没有导过来,expdp没有exclude排除对象,还在后续思考中……
标签:function,expdp,RDS,grant,TBS,TABLE,sjttfc,失效,NB 来源: https://www.cnblogs.com/hmwh/p/12780086.html