SnowConvert AI - Missing Objects Report

什么是“缺失对象”?

缺失对象术语用于指代码单元引用的源代码中缺失的 DDL 定义。下表显示了每种支持的语言中哪些元素可能缺失对象。

Object

Teradata

Oracle

Transact-SQL

Redshift

BigQuery

Spark

Databricks

Hive

Vertica

PostgreSQL

Greenplum

Netezza

Azure Synapse

IBM DB2

Table

View

Procedure

Function

Macro

Package Function

Package Procedure

*Package

Join Index

Index

Synonym

Database Link

Type

Materialized View

Trigger

Sequence

Constraint

备注

如果上面部分列出了星号(“*”),则表示该对象用于从自身调用不被视为 DDL 语句的属性,例如常量、变量或游标。

我在哪里可以找到它?

缺失对象报告可以在名为 "reports" 的文件夹中找到,该文件夹位于转换的输出文件夹中。文件本身的名称以 "MissingObjectReferences" 开头,因此可以轻松找到。

文件的格式为 .CSV

它包含什么信息?

缺失对象报告包含有关转换时找到的所有缺失对象的以下信息:

描述

PartitionKey

转换的唯一标识符。

FileName

对象所在文件的名称。

Caller_CodeUnit

引用缺失元素的代码单元的类型。

Caller_CodeUnit_Database

部署引用缺失元素的代码单元所在的数据库。目前,只有 SQL Server 对象可以拥有数据库。

Caller_CodeUnit_Schema

部署引用缺失元素的代码单元所在的架构。

Caller_CodeUnit_Name

引用缺失元素的代码单元的名称。

Caller_CodeUnit_FullName

引用缺失元素的代码单元的完全限定名称。

Referenced_Element_Database

部署缺失元素的数据库。目前,只有 SQL Server 对象可以拥有数据库。

Referenced_Element_Schema

部署缺失元素的架构。

Referenced_Element_Name

缺失元素的名称。

Referenced_Element_FullName

缺失元素的完全限定名称。

Line

引用所在文件内的行号。

Relation_Type

Shows the type of relation used through the caller code unit and the MISSING reference.

已知问题

警告

Variables defined in shell files used in script files like .bteq are considered missing objects because their definition is not part of the input files that SnowConvert AI processes. E.g. the myDB variable is defined in the shell file but this is a file that is not part of the input for SnowConvert AI. Only the .bteq file will be processed and therefore, line 5 will be marked as a missing reference.

export myDB=exampleDatabase
bteq < example.bteq
Copy
.LABEL EX_SQE

create multiset volatile table DR as
   select * from ${myDB}.myTable;
Copy

警告

如果未在提取的对象中指定包的架构,则通过拆分包来预处理 Oracle 工作负载可能会导致额外的缺失引用。

原始代码

CREATE package Schema1.Package1
IS
  CREATE TABLE Table1 (
    col1 INTEGER
  );
  
  CREATE PROCEDURE Proc1
    BEGIN
      SELECT * FROM Schema1.Table1;
    END

END   
Copy

请注意,在这种情况下,Table1 是在架构 Schema1 中自动创建,因此第 9 行中的引用可以正确解析。但是,如果在迁移之前执行了包拆分过程,生成的文件如下所示:

包拆分过程后修改的代码

  CREATE TABLE Table1 (
    col1 INTEGER1
  ); 
Copy
CREATE PROCEDURE Proc1
    BEGIN
        SELECT * FROM Schema1.Table1;
    END
Copy

文件 Schema1_Proc1.sql 第 3 行的引用将被标记为缺失引用,因为 Table1 不是在架构 Schema1 中明确创建。

语言: 中文