Closed joguess closed 2 years ago
OK It won't work because it gives me wrong syntax :
SELECT A.TABLE_NAME, A.PARTITION_NAME, A.SUBPARTITION_NAME, A.SUBPARTITION_POSITION, B.SUBPARTITIONING_TYPE, A.TABLE_OWNER, B.PARTITION_COUNT FROM DBA_TAB_SUBPARTITIONS A, DBA_PART_TABLES B WHERE A.TABLE_NAME = B.TABLE_NAME AND (B.SUBPARTITIONING_TYPE = 'RANGE' OR B.SUBPARTITIONING_TYPE = 'LIST' OR B.SUBPARTITIONING_TYPE = 'HASH') AND ( NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p1) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p2) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p3) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p4) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p5) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p6) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p7) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p8) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p9) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p10) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p11) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p12) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p13) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p14) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p15) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p16) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p17) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p18) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p19) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p20) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p21) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p22) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p23) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p24) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p25) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p26) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p27) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p28) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p29) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p30) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p31) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p32) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p33) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p34) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p35) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p36) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p37) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p38) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p39) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p40) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p41) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p42) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p43) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p44) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p45) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p46) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p47) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p48) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p49) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p50) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p51) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p52) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p53) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p54) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p55) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p56) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p57) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p58) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p59) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p60) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p61) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p62) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p63) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p64) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p65) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p66) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p67) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p68) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p69) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p70) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p71) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p72) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p73) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p74) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p75) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p76) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p77) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p78) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p79) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p80) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p81) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p82) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p83) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p84) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p85) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p86) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p87) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p88) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p89) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p90) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p91) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p92) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p93) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p94) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p95) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p96) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p97) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p98) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p99) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p100) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p101) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p102) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p103) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p104) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p105) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p106) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p107) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p108) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p109) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p110)) AND A.TABLE_OWNER ='TOTO TITI TATA' AND B.OWNER=A.TABLE_OWNER
AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, TABLE_NAME FROM DBA_OBJECT_TABLES) AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, MVIEW_NAME FROM DBA_MVIEWS UNION ALL SELECT LOG_OWNER, LOG_TABLE FROM DBA_MVIEW_LOGS)ORDER BY A.TABLE_OWNER,A.TABLE_NAME,A.PARTITION_NAME,A.SUBPARTITION_POSITION
SELECT A.TABLE_NAME, A.PARTITION_NAME, A.SUBPARTITION_NAME, A.SUBPARTITION_POSITION, B.SUBPARTITIONING_TYPE, A.TABLE_OWNER, B.PARTITION_COUNT FROM DBA_TAB_SUBPARTITIONS A, DBA_PART_TABLES B WHERE A.TABLE_NAME = B.TABLE_NAME AND (B.SUBPARTITIONING_TYPE = 'RANGE' OR B.SUBPARTITIONING_TYPE = 'LIST' OR B.SUBPARTITIONING_TYPE = 'HASH') AND ( NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p1) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p2) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p3) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p4) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p5) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p6) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p7) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p8) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p9) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p10) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p11) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p12) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p13) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p14) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p15) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p16) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p17) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p18) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p19) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p20) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p21) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p22) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p23) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p24) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p25) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p26) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p27) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p28) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p29) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p30) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p31) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p32) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p33) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p34) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p35) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p36) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p37) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p38) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p39) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p40) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p41) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p42) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p43) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p44) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p45) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p46) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p47) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p48) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p49) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p50) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p51) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p52) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p53) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p54) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p55) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p56) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p57) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p58) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p59) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p60) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p61) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p62) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p63) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p64) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p65) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p66) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p67) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p68) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p69) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p70) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p71) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p72) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p73) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p74) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p75) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p76) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p77) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p78) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p79) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p80) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p81) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p82) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p83) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p84) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p85) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p86) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p87) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p88) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p89) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p90) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p91) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p92) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p93) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p94) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p95) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p96) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p97) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p98) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p99) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p100) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p101) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p102) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p103) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p104) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p105) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p106) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p107) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p108) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p109) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p110)) AND A.TABLE_OWNER ='TOTO TITI TATA' AND B.OWNER=A.TABLE_OWNER
AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, TABLE_NAME FROM DBA_OBJECT_TABLES) AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, MVIEW_NAME FROM DBA_MVIEWS UNION ALL SELECT LOG_OWNER, LOG_TABLE FROM DBA_MVIEW_LOGS)ORDER BY A.TABLE_OWNER,A.TABLE_NAME,A.PARTITION_NAME,A.SUBPARTITION_POSITION
How can I modify the code to have what I expect ?
I would like to have TABLE_OWNER IN like this:
SELECT A.TABLE_NAME, A.PARTITION_NAME, A.SUBPARTITION_NAME, A.SUBPARTITION_POSITION, B.SUBPARTITIONING_TYPE, A.TABLE_OWNER, B.PARTITION_COUNT FROM DBA_TAB_SUBPARTITIONS A, DBA_PART_TABLES B WHERE A.TABLE_NAME = B.TABLE_NAME AND (B.SUBPARTITIONING_TYPE = 'RANGE' OR B.SUBPARTITIONING_TYPE = 'LIST' OR B.SUBPARTITIONING_TYPE = 'HASH') AND ( NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p1) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p2) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p3) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p4) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p5) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p6) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p7) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p8) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p9) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p10) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p11) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p12) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p13) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p14) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p15) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p16) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p17) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p18) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p19) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p20) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p21) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p22) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p23) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p24) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p25) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p26) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p27) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p28) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p29) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p30) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p31) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p32) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p33) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p34) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p35) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p36) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p37) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p38) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p39) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p40) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p41) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p42) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p43) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p44) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p45) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p46) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p47) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p48) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p49) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p50) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p51) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p52) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p53) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p54) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p55) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p56) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p57) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p58) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p59) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p60) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p61) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p62) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p63) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p64) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p65) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p66) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p67) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p68) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p69) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p70) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p71) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p72) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p73) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p74) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p75) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p76) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p77) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p78) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p79) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p80) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p81) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p82) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p83) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p84) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p85) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p86) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p87) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p88) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p89) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p90) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p91) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p92) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p93) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p94) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p95) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p96) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p97) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p98) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p99) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p100) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p101) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p102) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p103) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p104) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p105) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p106) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p107) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p108) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p109) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p110)) AND A.TABLE_OWNER IN ('TOTO','TITI','TATA') AND B.OWNER=A.TABLE_OWNER
AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, TABLE_NAME FROM DBA_OBJECT_TABLES) AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, MVIEW_NAME FROM DBA_MVIEWS UNION ALL SELECT LOG_OWNER, LOG_TABLE FROM DBA_MVIEW_LOGS)ORDER BY A.TABLE_OWNER,A.TABLE_NAME,A.PARTITION_NAME,A.SUBPARTITION_POSITION
SELECT A.TABLE_NAME, A.PARTITION_NAME, A.SUBPARTITION_NAME, A.SUBPARTITION_POSITION, B.SUBPARTITIONING_TYPE, A.TABLE_OWNER, B.PARTITION_COUNT FROM DBA_TAB_SUBPARTITIONS A, DBA_PART_TABLES B WHERE A.TABLE_NAME = B.TABLE_NAME AND (B.SUBPARTITIONING_TYPE = 'RANGE' OR B.SUBPARTITIONING_TYPE = 'LIST' OR B.SUBPARTITIONING_TYPE = 'HASH') AND ( NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p1) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p2) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p3) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p4) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p5) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p6) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p7) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p8) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p9) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p10) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p11) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p12) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p13) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p14) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p15) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p16) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p17) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p18) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p19) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p20) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p21) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p22) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p23) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p24) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p25) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p26) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p27) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p28) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p29) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p30) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p31) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p32) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p33) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p34) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p35) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p36) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p37) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p38) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p39) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p40) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p41) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p42) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p43) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p44) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p45) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p46) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p47) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p48) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p49) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p50) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p51) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p52) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p53) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p54) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p55) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p56) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p57) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p58) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p59) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p60) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p61) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p62) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p63) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p64) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p65) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p66) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p67) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p68) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p69) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p70) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p71) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p72) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p73) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p74) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p75) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p76) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p77) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p78) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p79) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p80) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p81) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p82) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p83) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p84) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p85) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p86) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p87) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p88) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p89) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p90) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p91) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p92) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p93) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p94) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p95) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p96) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p97) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p98) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p99) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p100) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p101) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p102) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p103) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p104) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p105) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p106) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p107) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p108) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p109) AND NOT REGEXP_LIKE(UPPER(A.TABLE_NAME), :p110)) AND A.TABLE_OWNER IN ('TOTO','TITI','TATA') AND B.OWNER=A.TABLE_OWNER
AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, TABLE_NAME FROM DBA_OBJECT_TABLES) AND (A.TABLE_OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, MVIEW_NAME FROM DBA_MVIEWS UNION ALL SELECT LOG_OWNER, LOG_TABLE FROM DBA_MVIEW_LOGS)ORDER BY A.TABLE_OWNER,A.TABLE_NAME,A.PARTITION_NAME,A.SUBPARTITION_POSITION
Configuration directive SCHEMA only supports a single schema name. If you want to export multiple schema then proceed to multiple ora2pg project, one by schema.
wow ok. I modified the export_schema.ksh and I added a list of schema, I put it inside a second loop for. I can give you the code if you want it. Thanks.
you can always post the script here, it could help someone that is looking for the same thing. Thanks.
#!/bin/sh
#-------------------------------------------------------------------------------
#
# Created by joguess the Oracle database admin, version 2022
#
#-------------------------------------------------------------------------------
SOURCE_TYPE="PACKAGE VIEW TRIGGER FUNCTION PROCEDURE PARTITION TYPE MVIEW"
EXPORT_TYPE="TABLE PACKAGE VIEW GRANT SEQUENCE TRIGGER FUNCTION PROCEDURE TABLESPACE PARTITION TYPE MVIEW DBLINK SYNONYM DIRECTORY"
SCHEMA="TITI TOTO TATA"
namespace="."
unit_cost=5
ora2pg -t SHOW_TABLE -c $namespace/config/ora2pg.conf > $namespace/reports/tables.txt
ora2pg -t SHOW_COLUMN -c $namespace/config/ora2pg.conf > $namespace/reports/columns.txt
ora2pg -t SHOW_REPORT -c $namespace/config/ora2pg.conf --dump_as_html --estimate_cost > $namespace/reports/report.html
for etype in $(echo $EXPORT_TYPE | tr " " "\n")
do
for eschema in $(echo $SCHEMA | tr " " "\n")
do
ltype=`echo $etype | tr '[:upper:]' '[:lower:]'`
ltype=`echo $ltype | sed 's/y$/ie/'`
echo "Running: ora2pg -p -t $etype -o $ltype$eschema.sql -n $eschema -b $namespace/schema/${ltype}s -c $namespace/config/ora2pg.conf"
ora2pg -p -t $etype -o $ltype$eschema.sql -n $eschema -b $namespace/schema/${ltype}s -c $namespace/config/ora2pg.conf
ret=`grep "Nothing found" $namespace/schema/${ltype}s/$ltype.sql 2> /dev/null`
if [ ! -z "$ret" ]; then
rm $namespace/schema/${ltype}s/$ltype.sql
fi
done
done
for etype in $(echo $SOURCE_TYPE | tr " " "\n")
do
for eschema in $(echo $SCHEMA | tr " " "\n")
do
ltype=`echo $etype | tr '[:upper:]' '[:lower:]'`
ltype=`echo $ltype | sed 's/y$/ie/'`
echo "Running: ora2pg -t $etype -o $ltype$eschema.sql -n $eschema -b $namespace/sources/${ltype}s -c $namespace/config/ora2pg.conf"
ora2pg -t $etype -o $ltype$eschema.sql -n $eschema -b $namespace/sources/${ltype}s -c $namespace/config/ora2pg.conf
ret=`grep "Nothing found" $namespace/sources/${ltype}s/$ltype.sql 2> /dev/null`
if [ ! -z "$ret" ]; then
rm $namespace/sources/${ltype}s/$ltype.sql
fi
done
done
echo
echo
echo "To extract data use the following command:"
echo
echo "ora2pg -t COPY -o data.sql -b $namespace/data -c $namespace/config/ora2pg.conf"
echo
exit 0
Hello
Actually if we choose EXPORT_SCHEMA 1 and CREATE_SCHEMA 1
ora2pg will run a big sql query where username are "not in" the system users and those we have defined :
I would prefer that ora2pg would run a "in" query and we would have chosen the user we want to export (and not those that we don't want).
By the way , if we put the name of the oracle schema that we want to export like this :
--Export Oracle schema to PostgreSQL schema EXPORT_SCHEMA 0
--Oracle schema/owner to use SCHEMA toto titi tata
will ora2pg export the schemas toto titi tata ??
Thanks. I think this point is not clear.
J.