DDL sync/matching Questions

Hello All,
Our developers us Toad to generate DDL to check into version control.
We are currently using toad 16.3 and 17.0
We want to run our integrity checker against stateful objects. The same way we do stateless objects.
I am having trouble matching the toad output. I assume Toad has its proprietary code doing a lot of cleanup behind the scenes to generate the output.
I picked a complicated table out the gate so I didnt get excited thinking this would be easy.
I was trying to fix the table ddl to share it but there was so much to remove and foreign key references but here are a few things Im trying to iron out.

We dont want to have indexs grouped with table ddl. I say that because if there is a performance issue and an index needs to be added on the fly we would then have an integrity checker warning till its removed or a new release is done and we dont use it but Oracle has the auto indexing feature.

TOAD Script options:



How can I remove below from the table ddl with the script options?
CREATE BITMAP INDEX SURG_USAGE_IX03 ON SURG_USAGE
(TRN_MTH)
TABLESPACE L1_IDX
LOCAL (
PARTITION FY2014
TABLESPACE L1_IDX
(SUBPARTITION FY2014_M_04
TABLESPACE L1_IDX,

the columns in Toad output remove precision if its 0. This is an easy replace but didnt know your thoughts. both seem fine to me so not a big deal to ignore.
SURG_USAGE_SEQ_ID NUMBER(11),
Oracle ddl output
SURG_USAGE_SEQ_ID NUMBER(11,0),

I started working on this yesterday so forgive the ugly multiple replaces. I do plan on opening an Oracle SR about some of the things showing up in the DDL that seem like they should be removed with some of their transformation settings.
SQL> SET TRIM ON
SQL> SET TRIMSPOOL ON
SQL> SET SERVEROUT ON SIZE 100000
SQL> SET LONG 2147483
SQL> SET LONGCHUNKSIZE 300000
SQL> SET PAGESIZE 0
SQL> WHENEVER SQLERROR CONTINUE
SQL> BEGIN
2 --DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES',TRUE);
3 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'EXPORT',TRUE); -- this will give sub partition DDL
4 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'COLLATION_CLAUSE','NEVER'); -- teams not using nor do we see teams using any time soon
5 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS',TRUE); -- if false it will omit constraints
6 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS_AS_ALTER',FALSE); -- if set to true it will it will do a seperate alter table
7 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'EMIT_SCHEMA',FALSE);
8 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'FORCE',TRUE); -- force build views
9 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY',TRUE);
10 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PHYSICAL_PROPERTIES',FALSE);-- doesnt seem to do anything
11 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SIZE_BYTE_KEYWORD',TRUE);
12 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE',FALSE);
13 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
14 DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'TABLESPACE',TRUE); -- generates TS info
15 END;
16 /

PL/SQL procedure successfully completed.

SQL> SELECT REPLACE (
2 REPLACE (
3 REPLACE (
4 REPLACE (
5 REPLACE (
6 REPLACE (DBMS_METADATA.GET_DDL (OBJECT_TYPE, OBJECT_NAME, OWNER), '"')
7 , ',0),', '),')
8 ,'PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255')
9 ,' NO INMEMORY')
10 ,') SEGMENT CREATION IMMEDIATE',')')
11 ,'NOCOMPRESS READ WRITE ,',',')
12 FROM DBA_OBJECTS
13 WHERE 1 = 1 AND OBJECT_TYPE = 'TABLE' AND OBJECT_NAME = ('SURG_USAGE') AND OWNER IN ('SUPERCOOL')
14 /

-- Compare between EXPORT TRANS FALSE, TOAD, TRUE

I also plan on reaching out to our windows team because I know powershell has some really nice file clean up functions.

Any easy ideas on how to clean this up? I have looked into linking the team coding but having issues due to cer log ins.

Thanks
Dave

Hi Dave,
Do you want to remove the index completely from the output? If so, uncheck indexes here

I could add an option to show NUMBER(11,0) instead of NUMBER(11) if that will make your life easier, but that won't help you unless you're willing to wait for the next Toad version, or try the beta.

Regarding the rest of your message, I'm not sure what, if anything, I can offer. But if formatting is a problem, you could maybe run both Oracle's DDL and Toad's through Toad's formatter to get you closer.

-John

There is a special meme for me on the index miss :laughing:.
For the 11,0 its not that big a deal, replace is simple enough for that.

I did talk to out TFS/Version Control lead and he did ask to look back into the team coding. Maybe that could ease a lot of this.

As always thanks for the fast response. I also always get told no when I want to install the beta version of toad.
Just submitted approval for the 2024 release. Everytime the major version changes I have to submit it to get approved. I see the next one is 2025, guess I should have noticed that before I submitted the 2024 lol.
They also said all AI features will be disable. :slightly_frowning_face:
Do those reach back to a quest server or is everything local, sorry not a question here but figured I'd ask?
Dave

Toad has AIExplain which returns plain English explanation of code. It sends your code to Quest's servers. The code is not retained in any way and only used to perform the explanation.

As you've probably noticed, the version number is going to change every year now. They were so arbitrary before. The major version number changes were no more meaningful than the minor number changes. A version is a version. You had a good run with 12.x though. 12.0, 12.1, 12.5. 12.6, 12.7, 12.8, 12.9, 12.10, 12.11, 12.12! :smiley:

Thanks, I get it but its a government system. Its hard for internal users to get access to stuff. Let alone sending it to a private sector system.
Would be nice create an internal system for government computers and updates done on quest systems then replicates updates, but thats wishful thinking.

they are and not sure why the approval isnt vender and software specific but hey stop with the logic.
Ha, that was before I started working on computers. Im old but was late to the game, hit my 10 year mark this year and never turned back.......even though Oracle makes me think of running daily lol.
Good chat, now I need to hit up your forum on linking toad TC to devops server