En plus de mécanismes tels que :
- les fichiers journaux Data Hub,
- Log for automated analysis of historical executions of Invantive SQL-products
- Use Amazon CloudWatch for logging Invantive UniversalSQL events
- Invantive Trace voortaan in NDJSON-formaat
- API-calls loggen in NDJSON formaat voor bijvoorbeeld Elasticsearch
- Generate output from Invantive PSQL using Oracle-style dbms_output
- New dbms_audit package to facilitate high-level logging on custom apps
il est également possible de journaliser la progression dans une table de base de données.
Le code suivant peut servir de point de départ :
--
-- Copier les données source vers SQL Server.
--
-- create or replace table SyncLogs@sql
-- ( id guid not null
-- , occurrence_date datetime not null -- UTC
-- , action_type char not null -- 'I', 'D' ou 'U' pour Insert, Delete ou Update, ou 'C' pour copy, 'S' et 'E' pour start et end.
-- , table_name varchar2 null
-- , nk1 varchar2 null -- Premier élément de la clé métier.
-- , nk2 varchar2 null
-- , nk3 varchar2 null
-- , nk4 varchar2 null
-- , nk5 varchar2 null
-- , label varchar2 null -- Contexte textuel.
-- , actions varchar2 null -- Valeurs modifiées.
-- --
-- , ip_address varchar2 not null -- Champs d'audit.
-- , iuid varchar2 not null
-- , date_created datetime not null
-- , created_by varchar2 not null
-- , created_at varchar2 not null
-- , session_created varchar2 not null
-- )
begin
--
-- Démarrer le processus.
--
insert into SYNCLOGS@sql
( id
, occurrence_date
, action_type
, table_name
, label
, actions
--
, ip_address
, iuid
, date_created
, created_by
, created_at
, session_created
)
values
( newid()
, sysdateutc
, 'S'
, null
, 'Start'
, null
--
, sys_context('USERENV', 'CLIENT_IP_ADDRESS_EXTERNAL', 'mc')
, sys_context('USERENV', 'IUID', 'mc')
, sysdateutc
, sys_context('USERENV', 'CURRENT_USER', 'mc')
, sys_context('USERENV', 'APPLICATION_FULL', 'mc')
, sys_context('USERENV', 'SESSIONID', 'mc')
);
--
create or replace table mc_dpersoneel@sql
as
select *
from dpersoneel@mc
;
--
-- Enregistrer l'action de copie.
--
insert into SYNCLOGS@mss
( id
, occurrence_date
, action_type
, table_name
, label
, actions
--
, ip_address
, iuid
, date_created
, created_by
, created_at
, session_created
)
values
( newid()
, sysdateutc
, 'C'
, 'mc_dpersoneel@sql'
, 'Created'
, to_char(sqlrowcount) || ' rows'
--
, sys_context('USERENV', 'CLIENT_IP_ADDRESS_EXTERNAL', 'mc')
, sys_context('USERENV', 'IUID', 'mc')
, sysdateutc
, sys_context('USERENV', 'CURRENT_USER', 'mc')
, sys_context('USERENV', 'APPLICATION_FULL', 'mc')
, sys_context('USERENV', 'SESSIONID', 'mc')
);
--
-- Terminer le processus.
--
insert into SYNCLOGS@mss
( id
, occurrence_date
, action_type
, table_name
, label
, actions
--
, ip_address
, iuid
, date_created
, created_by
, created_at
, session_created
)
values
( newid()
, sysdateutc
, 'E'
, null
, 'Finished'
, null
--
, sys_context('USERENV', 'CLIENT_IP_ADDRESS_EXTERNAL', 'mc')
, sys_context('USERENV', 'IUID', 'mc')
, sysdateutc
, sys_context('USERENV', 'CURRENT_USER', 'mc')
, sys_context('USERENV', 'APPLICATION_FULL', 'mc')
, sys_context('USERENV', 'SESSIONID', 'mc')
);
end;