文档首页 > > 工具指南> DSC SQL语法迁移工具> SQL语法迁移参考> Teradata语法迁移> DBC.INDICES

DBC.INDICES

分享
更新时间:2020/04/21 GMT+08:00

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();
分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!非常感谢您的反馈,我们会继续努力做到更好!
反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

智能客服提问云社区提问