ora2pg icon indicating copy to clipboard operation
ora2pg copied to clipboard

Ora2pg ignores Trigger that is disable in Oracle due to EXPORT_INVALID.

Open dcgadmin opened this issue 1 year ago • 1 comments

In Ora2pg EXPORT_INVALID is by default disable and only export or convert objects that is VALID in Oracle.

For Trigger, we have following conditions in the code, that fetch Trigger that is only Enable. Hence it is missing exporting Trigger that is disable but not invalid. Ideally the status of invalid should be driven by dba_objects view.

my $str = "SELECT TRIGGER_NAME, TRIGGER_TYPE, TRIGGERING_EVENT, TABLE_NAME, TRIGGER_BODY, WHEN_CLAUSE, DESCRIPTION, ACTION_TYPE, OWNER FROM $self->{prefix}_TRIGGERS WHERE 1=1";
	if (!$self->{export_invalid}) {
		$str .= " AND STATUS='ENABLED'";
	} elsif ($self->{export_invalid} == 2) {
		$str .= " AND STATUS <> 'ENABLED'";
	}

As per Documentation, EXPORT_INVALID types applies to

The 'VALID' or
 'INVALID' status applies to functions, procedures, packages and userdefined types.

AFAIK, we can ignore EXPORT_INVALID for checking only Enable if not, Document need to be updated accordingly. IF needed can submit a patch to merge.

dcgadmin avatar Mar 14 '24 19:03 dcgadmin