From 4412918da76acf75978989cb73f06313f03cb559 Mon Sep 17 00:00:00 2001 From: Sualeh Fatehi Date: Sun, 20 Sep 2015 00:33:37 -0400 Subject: [PATCH] Maintaining compatibility with older Oracle versions --- schemacrawler-docs/sc_oracle.txt | 116 ++++-------------- .../CONSTRAINT_COLUMN_USAGE.sql | 9 +- .../oracle.information_schema/EXT_INDEXES.sql | 9 +- .../EXT_SYNONYMS.sql | 9 +- .../oracle.information_schema/EXT_TABLES.sql | 9 +- .../EXT_TABLE_CONSTRAINTS.sql | 21 +++- .../FOREIGN_KEYS.sql | 18 ++- .../oracle.information_schema/ROUTINES.sql | 9 +- .../oracle.information_schema/SEQUENCES.sql | 9 +- .../TABLE_CONSTRAINTS.sql | 9 +- .../oracle.information_schema/TRIGGERS.sql | 9 +- .../oracle.information_schema/VIEWS.sql | 9 +- 12 files changed, 127 insertions(+), 109 deletions(-) diff --git a/schemacrawler-docs/sc_oracle.txt b/schemacrawler-docs/sc_oracle.txt index 046902031c..830e1ecc03 100644 --- a/schemacrawler-docs/sc_oracle.txt +++ b/schemacrawler-docs/sc_oracle.txt @@ -4,8 +4,8 @@ System Information ======================================================================== generated by SchemaCrawler 14.03.03 -generated on 2015-09-19 18:24:08 -database version Oracle Oracle Database 12c Release 12.1.0.1.0 - 64bit Production +generated on 2015-09-20 00:31:41 +database version Oracle Oracle Database 11g Release 11.2.0.4.0 - 64bit Production driver version Oracle JDBC driver 12.1.0.2.0 @@ -77,15 +77,15 @@ CHECK_UPPERCASE_STATE [check constraint] STATE ALTER TABLE "SCHEMACRAWLER"."AUTHORS" ADD CONSTRAINT "CHECK_UPPERCASE_STATE" CHECK (State=UPPER(State)) ENABLE; -SYS_C004888 [check constraint] +SYS_C003908 [check constraint] ID ALTER TABLE "SCHEMACRAWLER"."AUTHORS" MODIFY ("ID" NOT NULL ENABLE); -SYS_C004889 [check constraint] +SYS_C003909 [check constraint] FIRSTNAME ALTER TABLE "SCHEMACRAWLER"."AUTHORS" MODIFY ("FIRSTNAME" NOT NULL ENABLE); -SYS_C004890 [check constraint] +SYS_C003910 [check constraint] LASTNAME ALTER TABLE "SCHEMACRAWLER"."AUTHORS" MODIFY ("LASTNAME" NOT NULL ENABLE); @@ -162,11 +162,11 @@ FK_Z_AUTHOR [foreign key constraint] ALTER TABLE "SCHEMACRAWLER"."BOOKAUTHORS" ADD CONSTRAINT "FK_Z_AUTHOR" FOREIGN KEY ("AUTHORID") REFERENCES "SCHEMACRAWLER"."AUTHORS" ("ID") ENABLE; -SYS_C004898 [check constraint] +SYS_C003918 [check constraint] BOOKID ALTER TABLE "SCHEMACRAWLER"."BOOKAUTHORS" MODIFY ("BOOKID" NOT NULL ENABLE); -SYS_C004899 [check constraint] +SYS_C003919 [check constraint] AUTHORID ALTER TABLE "SCHEMACRAWLER"."BOOKAUTHORS" MODIFY ("AUTHORID" NOT NULL ENABLE); @@ -183,11 +183,11 @@ CREATE TABLE "SCHEMACRAWLER"."BOOKAUTHORS" PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" - LOB ("UPDATE") STORE AS SECUREFILE ( - TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 - NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES - STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 - PCTINCREASE 0 + LOB ("UPDATE") STORE AS BASICFILE ( + TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION + NOCACHE LOGGING + STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 + PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ; @@ -254,15 +254,15 @@ FK_PREVIOUSEDITION [foreign key constraint] ALTER TABLE "SCHEMACRAWLER"."BOOKS" ADD CONSTRAINT "FK_PREVIOUSEDITION" FOREIGN KEY ("PREVIOUSEDITIONID") REFERENCES "SCHEMACRAWLER"."BOOKS" ("ID") ENABLE; -SYS_C004893 [check constraint] +SYS_C003913 [check constraint] ID ALTER TABLE "SCHEMACRAWLER"."BOOKS" MODIFY ("ID" NOT NULL ENABLE); -SYS_C004894 [check constraint] +SYS_C003914 [check constraint] TITLE ALTER TABLE "SCHEMACRAWLER"."BOOKS" MODIFY ("TITLE" NOT NULL ENABLE); -SYS_C004895 [check constraint] +SYS_C003915 [check constraint] PUBLISHERID ALTER TABLE "SCHEMACRAWLER"."BOOKS" MODIFY ("PUBLISHERID" NOT NULL ENABLE); @@ -304,70 +304,6 @@ CREATE TABLE "SCHEMACRAWLER"."Global Counts" -SCHEMACRAWLER.PLAN_TABLE [table] ------------------------------------------------------------------------- - STATEMENT_ID VARCHAR2(30) - "TIMESTAMP" DATE - REMARKS VARCHAR2(80) - OPERATION VARCHAR2(30) - OPTIONS VARCHAR2(30) - OBJECT_NODE VARCHAR2(128) - OBJECT_OWNER VARCHAR2(30) - OBJECT_NAME VARCHAR2(30) - OBJECT_INSTANCE NUMBER(38, 0) - OBJECT_TYPE VARCHAR2(30) - OPTIMIZER VARCHAR2(255) - SEARCH_COLUMNS NUMBER - ID NUMBER(38, 0) - PARENT_ID NUMBER(38, 0) - POSITION NUMBER(38, 0) - COST NUMBER(38, 0) - CARDINALITY NUMBER(38, 0) - BYTES NUMBER(38, 0) - OTHER_TAG VARCHAR2(255) - PARTITION_START VARCHAR2(255) - PARTITION_STOP VARCHAR2(255) - PARTITION_ID NUMBER(38, 0) - OTHER LONG - DISTRIBUTION VARCHAR2(30) - -Definition - [definition] -CREATE TABLE "SCHEMACRAWLER"."PLAN_TABLE" - ( "STATEMENT_ID" VARCHAR2(30 BYTE), - "TIMESTAMP" DATE, - "REMARKS" VARCHAR2(80 BYTE), - "OPERATION" VARCHAR2(30 BYTE), - "OPTIONS" VARCHAR2(30 BYTE), - "OBJECT_NODE" VARCHAR2(128 BYTE), - "OBJECT_OWNER" VARCHAR2(30 BYTE), - "OBJECT_NAME" VARCHAR2(30 BYTE), - "OBJECT_INSTANCE" NUMBER(38,0), - "OBJECT_TYPE" VARCHAR2(30 BYTE), - "OPTIMIZER" VARCHAR2(255 BYTE), - "SEARCH_COLUMNS" NUMBER, - "ID" NUMBER(38,0), - "PARENT_ID" NUMBER(38,0), - "POSITION" NUMBER(38,0), - "COST" NUMBER(38,0), - "CARDINALITY" NUMBER(38,0), - "BYTES" NUMBER(38,0), - "OTHER_TAG" VARCHAR2(255 BYTE), - "PARTITION_START" VARCHAR2(255 BYTE), - "PARTITION_STOP" VARCHAR2(255 BYTE), - "PARTITION_ID" NUMBER(38,0), - "OTHER" LONG, - "DISTRIBUTION" VARCHAR2(30 BYTE) - ) SEGMENT CREATION IMMEDIATE - PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 - NOCOMPRESS LOGGING - STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 - PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 - BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) - TABLESPACE "USERS" ; - - - SCHEMACRAWLER.PUBLISHERS [table] ------------------------------------------------------------------------ List of book publishers @@ -378,7 +314,7 @@ List of book publishers Primary Key -SYS_C004887 [primary key] +SYS_C003907 [primary key] ID unknown Weak Associations @@ -388,7 +324,7 @@ Weak Associations Table Constraints -SYS_C004887 [primary key constraint] +SYS_C003907 [primary key constraint] ID ALTER TABLE "SCHEMACRAWLER"."PUBLISHERS" ADD PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 @@ -428,7 +364,7 @@ NULL Definition [definition] -CREATE OR REPLACE EDITIONABLE FUNCTION "SCHEMACRAWLER"."SQUIRREL_GET_ERROR_OFFSET" (query IN varchar2) return number authid current_user is l_theCursor integer default dbms_sql.open_cursor; l_status integer; begin begin dbms_sql.parse( l_theCursor, query, dbms_sql.native ); exception when others then l_status := dbms_sql.last_error_position; end; dbms_sql.close_cursor( l_theCursor ); return l_status; end; +CREATE OR REPLACE FUNCTION "SCHEMACRAWLER"."SQUIRREL_GET_ERROR_OFFSET" (query IN varchar2) return number authid current_user is l_theCursor integer default dbms_sql.open_cursor; l_status integer; begin begin dbms_sql.parse( l_theCursor, query, dbms_sql.native ); exception when others then l_status := dbms_sql.last_error_position; end; dbms_sql.close_cursor( l_theCursor ); return l_status; end; / @@ -588,14 +524,6 @@ VARCHAR2 [data type] not auto-incrementable searchable -SCHEMACRAWLER.CLR_ERP_META_HEADER_REC_TYPE [data type] - based on NULL - user defined - defined with - not nullable - not auto-incrementable - unknown - System Information @@ -611,7 +539,7 @@ product version 14.03.03 Database Information -=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=- database product name Oracle -database product version Oracle Database 12c Release 12.1.0.1.0 - 64bit Production +database product version Oracle Database 11g Release 11.2.0.4.0 - 64bit Production database user name SCHEMACRAWLER @@ -626,8 +554,8 @@ catalogs client info properties data definition causes transaction commit true data definition ignored in transactions false -database major version 12 -database minor version 1 +database major version 11 +database minor version 2 default transaction isolation 2 deletes are detected for TYPE_FORWARD_ONLY result sets false deletes are detected for TYPE_SCROLL_INSENSITIVE result sets false @@ -692,7 +620,7 @@ procedure term procedure result set holdability 1 row id lifetime ROWID_VALID_FOREVER schema term schema -schemas ANONYMOUS, APPQOSSYS, AUDSYS, CTXSYS, DBSNMP, DIP, GSMADMIN_INTERNAL, GSMCATUSER, GSMUSER, OUTLN, RDSADMIN, SCHEMACRAWLER, SYS, SYSBACKUP, SYSDG, SYSKM, SYSTEM, XDB, XS$NULL +schemas APPQOSSYS, CTXSYS, DBSNMP, DIP, OUTLN, RDSADMIN, SCHEMACRAWLER, SYS, SYSTEM search string escape / SQL keywords ACCESS, ADD, ALTER, AUDIT, CLUSTER, COLUMN, COMMENT, COMPRESS, CONNECT, DATE, DROP, EXCLUSIVE, FILE, IDENTIFIED, IMMEDIATE, INCREMENT, INDEX, INITIAL, INTERSECT, LEVEL, LOCK, LONG, MAXEXTENTS, MINUS, MODE, NOAUDIT, NOCOMPRESS, NOWAIT, NUMBER, OFFLINE, ONLINE, PCTFREE, PRIOR, all_PL_SQL_reserved_ words SQL state type 0 diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/CONSTRAINT_COLUMN_USAGE.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/CONSTRAINT_COLUMN_USAGE.sql index 8f7da41051..2c4aff28bd 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/CONSTRAINT_COLUMN_USAGE.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/CONSTRAINT_COLUMN_USAGE.sql @@ -16,7 +16,14 @@ FROM INNER JOIN ALL_USERS USERS ON TABLE_CONTRAINTS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND TABLE_CONTRAINTS.TABLE_NAME NOT LIKE 'BIN$%' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_INDEXES.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_INDEXES.sql index 94d1c1b3bf..8e890cae9b 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_INDEXES.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_INDEXES.sql @@ -10,7 +10,14 @@ FROM INNER JOIN ALL_USERS USERS ON INDEXES.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND INDEXES.TABLE_NAME NOT LIKE 'BIN$%' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_SYNONYMS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_SYNONYMS.sql index 48fb4f982a..d84260e4d4 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_SYNONYMS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_SYNONYMS.sql @@ -10,7 +10,14 @@ FROM INNER JOIN ALL_USERS USERS ON SYNONYMS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND SYNONYMS.TABLE_NAME NOT LIKE 'BIN$%' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLES.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLES.sql index 922bc7df56..6c035e56ae 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLES.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLES.sql @@ -9,7 +9,14 @@ FROM INNER JOIN ALL_USERS USERS ON TABLES.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5}$') AND TABLES.TABLE_NAME NOT LIKE 'BIN$%' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLE_CONSTRAINTS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLE_CONSTRAINTS.sql index 1be35c0485..69a136163b 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLE_CONSTRAINTS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/EXT_TABLE_CONSTRAINTS.sql @@ -9,7 +9,14 @@ FROM INNER JOIN ALL_USERS USERS ON CONSTRAINTS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND CONSTRAINTS.TABLE_NAME NOT LIKE 'BIN$%' @@ -26,9 +33,15 @@ FROM INNER JOIN ALL_USERS USERS ON CONSTRAINTS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') - AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{6}$') - AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5}$') + AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND CONSTRAINTS.TABLE_NAME NOT LIKE 'BIN$%' AND CONSTRAINT_TYPE = 'R' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/FOREIGN_KEYS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/FOREIGN_KEYS.sql index 412629ae72..cacae18a7f 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/FOREIGN_KEYS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/FOREIGN_KEYS.sql @@ -22,11 +22,25 @@ FROM ALL_USERS FU WHERE 1 = 1 AND F.OWNER = FU.USERNAME - AND FU.ORACLE_MAINTAINED != 'Y' + AND FU.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(FU.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(FU.USERNAME, '^FLOWS_[0-9]{5,6}$') AND P.OWNER = PU.USERNAME - AND PU.ORACLE_MAINTAINED != 'Y' + AND PU.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(PU.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(PU.USERNAME, '^FLOWS_[0-9]{5,6}$') AND F.CONSTRAINT_TYPE = 'R' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/ROUTINES.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/ROUTINES.sql index 0f3414adae..e14c4dc390 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/ROUTINES.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/ROUTINES.sql @@ -11,7 +11,14 @@ FROM INNER JOIN ALL_USERS USERS ON PROCEDURES.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND PROCEDURES.AUTHID = 'CURRENT_USER' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/SEQUENCES.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/SEQUENCES.sql index 562de807a8..8848dce3d1 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/SEQUENCES.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/SEQUENCES.sql @@ -14,7 +14,14 @@ FROM INNER JOIN ALL_USERS USERS ON SEQUENCES.SEQUENCE_OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') ORDER BY diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/TABLE_CONSTRAINTS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/TABLE_CONSTRAINTS.sql index 712c1ebd95..bce7d0bb73 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/TABLE_CONSTRAINTS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/TABLE_CONSTRAINTS.sql @@ -16,7 +16,14 @@ FROM INNER JOIN ALL_USERS USERS ON CONSTRAINTS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND CONSTRAINTS.TABLE_NAME NOT LIKE 'BIN$%' diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/TRIGGERS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/TRIGGERS.sql index 2c5f5ec31e..80158f98e4 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/TRIGGERS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/TRIGGERS.sql @@ -33,6 +33,13 @@ FROM INNER JOIN ALL_USERS USERS ON TRIGGERS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') diff --git a/schemacrawler-oracle/src/main/resources/oracle.information_schema/VIEWS.sql b/schemacrawler-oracle/src/main/resources/oracle.information_schema/VIEWS.sql index 03727052e3..e4817b4562 100644 --- a/schemacrawler-oracle/src/main/resources/oracle.information_schema/VIEWS.sql +++ b/schemacrawler-oracle/src/main/resources/oracle.information_schema/VIEWS.sql @@ -10,7 +10,14 @@ FROM INNER JOIN ALL_USERS USERS ON VIEWS.OWNER = USERS.USERNAME WHERE - USERS.ORACLE_MAINTAINED != 'Y' + USERS.USERNAME NOT IN + ('ANONYMOUS', 'APEX_PUBLIC_USER', 'BI', 'CTXSYS', 'DBSNMP', 'DIP', + 'EXFSYS', 'FLOWS_30000', 'FLOWS_FILES', 'HR', 'IX', 'LBACSYS', + 'MDDATA', 'MDSYS', 'MGMT_VIEW', 'OE', 'OLAPSYS', 'ORACLE_OCM', + 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'OWBSYS', 'PM', 'SCOTT', 'SH', + 'SI_INFORMTN_SCHEMA', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', + 'SYS', 'SYSMAN', 'SYSTEM', 'TSMSYS', 'WKPROXY', 'WKSYS', 'WK_TEST', + 'WMSYS', 'XDB', 'XS$NULL') AND NOT REGEXP_LIKE(USERS.USERNAME, '^APEX_[0-9]{6}$') AND NOT REGEXP_LIKE(USERS.USERNAME, '^FLOWS_[0-9]{5,6}$') AND VIEWS.VIEW_NAME NOT LIKE 'BIN$%'