Kbase P86347: How do I check whether my oracle database and progress database is in sync?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  29/06/2004 |
|
Status: Unverified
GOAL:
How do I check whether my oracle database and progress database is in sync?
GOAL:
Is there a data server utility that can help me identify problems with my oracle database table and index definitions?
GOAL:
What 4GL code can be used to help trouble shoot progress and oracle database problems?
GOAL:
Program to detect differences between Progress db and schema holder
FACT(s) (Environment):
Oracle DataServer
FIX:
When you have a progress database and an oracle database but not a good schema holder, there is no data server utility that can help you verify table and index definitions against both the progress and Oracle.
Following processes can be used to validate whether the progress and the oracle databases are in sync.
1. Schema pull to create schema holder from oracle database
2. Connect to both progress database and schema holder
3. Running following code. You will need to change the two GLOBAL-DEFINE's at the top of the program to match progress db name and schema holder name.
&GLOBAL-DEFINE PROG progdbname
&GLOBAL-DEFINE ORA schholder-name
DEF VAR X AS CHAR.
DEF VAR y AS CHAR.
DEF VAR comp_prog AS INT.
DEF VAR comp_ora AS INT.
DEF BUFFER prog_db FOR {&PROG}._db.
DEF BUFFER prog_file FOR {&PROG}._file.
DEF BUFFER prog_index FOR {&PROG}._index.
DEF BUFFER prog_index_field FOR {&PROG}._index-field.
DEF BUFFER ora_file FOR {&ORA}._file.
DEF BUFFER ora_index FOR {&ORA}._index.
DEF BUFFER ora_index_field FOR {&ORA}._index-field.
SESSION:APPL-ALERT-BOXES = YES.
FOR EACH prog_db.
FOR EACH prog_file OF prog_db WHERE _file-num > 0 AND _file-num < 32000:
X = REPLACE(prog_file._file-name,"-","_").
FIND ora_file WHERE ora_file._file-name = X NO-ERROR.
IF NOT AVAILABLE ora_file THEN
MESSAGE "Table " X " not found in schema holder".
ELSE DO:
FOR EACH prog_index OF prog_file:
Y = REPLACE(prog_index._index-name,"-","_").
FIND ora_index OF ora_file
WHERE ora_index._index-name = Y NO-ERROR.
IF NOT AVAILABLE ora_index THEN
MESSAGE "Index " Y "for table " X " not found in schema holder".
ELSE DO:
ASSIGN comp_prog = 0
comp_ora = 0.
FOR EACH prog_index_field OF prog_index:
comp_prog = comp_prog + 1.
END.
FOR EACH ora_index_field OF ora_index:
comp_ora = comp_ora + 1.
END.
IF comp_prog <> comp_ora THEN
MESSAGE "Index " Y " of table " X " has " comp_prog " components in the progress db
AND " comp_ora " IN the SCHEMA holder".
END.
END.
END.
END.
END.