Submitting forms on the support site are temporary unavailable for schedule maintenance. If you need immediate assistance please contact technical support. We apologize for the inconvenience.
Generation of change scripts for object types is invalid
설명
Toad generates invalid change scripts for object types. Steps to reproduce the issue:
create 2 empty schemas for comparison: in this example, COMP1 (target) and COMP2 (Source)
run this in COMP1
CREATE OR REPLACE TYPE my_type AS OBJECT ( id NUMBER, name VARCHAR2(100) );
create table my_type_table of my_type; run this in the other COMP2
CREATE OR REPLACE TYPE my_type AS OBJECT ( id NUMBER, name VARCHAR2(100) );
create table my_type_table of my_type;
ALTER TYPE my_type ADD ATTRIBUTE (email VARCHAR2(100)) cascade; Note: Oracle tracks the changes to the TYPE in DBA_TYPE_VERSIONS. There you can see the versions of the type before and after the ALTER TYPE statement. Toad uses the version info here to compare and sync
Compare them using COMP2 as source and COMP1 as target.
The only object types you need to include are tables and types
The sync script looks like below.
ALTER TYPE COMP1.my_type ADD ATTRIBUTE (email VARCHAR2(100)) cascade;
CREATE OR REPLACE TYPE COMP1.my_type AS OBJECT ( id NUMBER, name VARCHAR2(100) ) ALTER TYPE my_type ADD ATTRIBUTE (email VARCHAR2(100)) cascade /
SHOW ERRORS;
ALTER TABLE COMP1.MY_TYPE_TABLE ADD (EMAIL VARCHAR2(100 BYTE));
Bug: The only valid statement here is the first one.
The “Create or replace type” is unnecessary because we already altered it.
“Show errors” is actually harmless.
The “Alter table” is invalid because you can’t add columns to type tables.
로그인 필요
프리미엄 기술 문서를 보려면 로그인해야 하며 최신 유지 관리 계약이 있어야 합니다.