How can we help you today? How can we help you today?
yzguy
let me see if I can simplify this.  We start by running this statement on our db (drop the table, nothing existing): CREATE TABLE BATCH (   batch_id NUMBER GENERATED BY DEFAULT AS IDENTITY,   coor_id VARCHAR2(50 BYTE) NOT NULL,   stts VARCHAR2(30 BYTE),   batch_dt DATE,   crt_nm VARCHAR2(256 BYTE) DEFAULT USER,   crt_dtm TIMESTAMP DEFAULT SYSTIMESTAMP,   last_udt_usr_nm VARCHAR2(256 BYTE) DEFAULT USER,   last_udt_dtm TIMESTAMP DEFAULT SYSTIMESTAMP ); then we SAVE that script in a script location, then use schema compare to compare the script location to our db, and it "sees" a difference between the script location and the db table (even though there is not any).  Schema compare thinks it needs to make the db table an identity, when in fact it ALREADY is.  The problem here is schema compares ability to determine that the column is an identity is not working, on this db. This works fine on another db, and I suspect will work fine for you.  I suspect there is something wrong with one of our db's (or rights missing, or something different) as this works fine on another.  My problem is that I don't know what schema compare is looking at, so I don't know where to start looking for problems.  / comments
let me see if I can simplify this.  We start by running this statement on our db (drop the table, nothing existing):CREATE TABLE BATCH (  batch_id NUMBER GENERATED BY DEFAULT AS IDENTITY,  coor_id ...
0 votes
I did some more digging.  At first I thought this was a general issue that would happen any time a table was recreated by schema compare (like when you have column order enforced and add a column in the middle), but then when I tried to reproduce it on a different server, I was unable to.  I was actually pretty surprised at how well it did handle it (so good job there [image] ). So here is what I learned: I am pretty sure the issue is that schema compare is NOT able to correctly determine that the column is already an identity in the db.  We are comparing a script location to a live db, then generating the release script as part of our release process.  The script generated is what I posted above, where the table is recreated, data inserted, and sequence not updated to start at a higher number.   Our release process ALSO compares the db back to the script location, to create a "backout" script.  This back out script looks like this: ---------------------------- WHENEVER SQLERROR EXIT SQL.SQLCODE -- -- Script generated by Schema Compare for Oracle 5.2.3.1222 on 13/03/2020 15:56:52 -- SET DEFINE OFF ALTER TABLE espsvc_owner."BATCH" MODIFY batch_id DROP IDENTITY; ALTER TABLE espsvc_owner."BATCH" MODIFY (batch_id NUMBER DEFAULT espsvc_owner."ISEQ$$_23832".nextval NOT NULL); ------------------------------ This tells me that schema compare thinks that the db column is NOT an identity, and just that the default value is the sequence.nextval. This same process will happen over and over.  If the release script runs, and redgate makes the table what it thinks it needs, the next release of the SAME table code, will generate the SAME release script. I'm pretty sure it is comparing a column that is identity in the scripts folder, to the db, and thinking that the db column is NOT an identity (when in fact it is, schema compare made the script to ensure that last release), and EVERY release results in the same script that messes up the sequence number. Now I'm pretty sure there is something not quite right in our db (at least this one, I am not able to reproduce this issue in another), but I don't know exactly what I am looking for.  Can you tell me what schema compare is looking at to determine a columns properties, like is it an identity? So we can check that on this db, to see if we have a db issue that needs to be addresses so that schema compare can properly read the table structure? / comments
I did some more digging.  At first I thought this was a general issue that would happen any time a table was recreated by schema compare (like when you have column order enforced and add a column i...
0 votes
in case anyone else needs to know, this statement needs to return 1 for the user trying to commit changes SELECT HAS_PERMS_BY_NAME('YourDBName', 'DATABASE', 'ALTER') / comments
in case anyone else needs to know, this statement needs to return 1 for the user trying to commit changes SELECT HAS_PERMS_BY_NAME('YourDBName', 'DATABASE', 'ALTER')
0 votes