更新时间:2023-03-17 GMT+08:00

DBC.INDICES

DSC将dbc.indices迁移为对应的mig_td_ext.vw_td_dbc_indices。

示例:databasename迁移为mig_td_ext.vw_td_dbc_tables.schemaname。

输入

1
2
3
4
5
sel databasename,tablename FROM dbc.indices
WHERE tablekind='T' and trim(databasename) = '<dbname>'
AND
( NOT(TRIM(tablename) LIKE ANY  (<excludelist>))
) AND indextype IN ( 'Q','P');

输出

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
SELECT
         mig_td_ext.vw_td_dbc_indices.schemaname
                             
, mig_td_ext.vw_td_dbc_indices.tablename

     FROM
         mig_td_ext.vw_td_dbc_indices
     WHERE
                               
mig_td_ext.vw_td_dbc_indices.tablekind =  'T'
         
AND TRIM(mig_td_ext.vw_td_dbc_indices.schemaname) =
'<dbname>'
         
AND( NOT( TRIM(mig_td_ext.vw_td_dbc_indices.tablename) LIKE ANY (
ARRAY[ < excludelist > ] ) ) )
;

在dbc.indices迁移过程中,查询应包含AND indextype IN ( 'Q','P')。否则,工具不会迁移该查询,且会记录以下错误消息:

"Query/statement is not supported as indextype should be mentioned with values 'P' and 'Q'."

dbc.sessioninfoV

输入

select username,clientsystemuserid,clientipaddress,clientprogramname 
  from dbc.sessioninfoV 
 where sessionno = 140167641814784;

输出

select usename AS username, NULL::TEXT AS clientsystemuserid
  , client_addr AS clientipaddress, application_name AS clientprogramname 
  from pg_catalog.pg_stat_activity 
 WHERE pid = 140167641814784;

dbc.sessioninfo

输入

SELECT  username
,clientsystemuserid
 ,clientipaddress
,clientprogramname
 FROM
dbc.sessioninfo
WHERE
sessionno = lv_mig_session ;

输出

select usename AS username, NULL::TEXT AS clientsystemuserid
  , client_addr AS clientipaddress, application_name AS clientprogramname 
  from pg_catalog.pg_stat_activity 
 WHERE pid = lv_mig_session;

Teradata SET QUERY_BAND,指定FOR SESSION

输入

set query_band = 'AppName=${AUTO_SYS};JobName=${AUTO_JOB};TxDate=${TX_DATE};ScriptName=${script_name};' for session ;

输出

set query_band = 'AppName=${AUTO_SYS};JobName=${AUTO_JOB};TxDate=${TX_DATE};ScriptName=${script_name};' /* for session */;

SESSION

输入

select Session ;
should be migrated as below:
SELECT pg_backend_pid();

输出

SELECT pg_backend_pid();