[SQL][MCSA]70-463 考試預備 ( 3/4 )

[SQL][MCSA]70-463 考試預備 ( 3/4 )

Utility

  • dtexec ( http://msdn.microsoft.com/zh-tw/library/hh231187.aspx )
    • 可用於可存取所有封裝組態 ( 如參數、連接、屬性、變數、記錄與進度指標 ) 及執行封裝功能。 dtexec 公用程式。
    • 可您從下列來源載入封裝:Integration Services 伺服器、.ispac 專案檔案、Microsoft SQL Server 資料庫、SSIS 封裝存放區及檔案系統。
    • 當使用 dtexec 執行舊版本 (  SQL Server 2005 or SQL Server 2008 ) 封裝時,會暫時將封裝升級為 SQL Server 2012 版本。 但無法使用它儲存這些升級的變更。
    • 具有 32 位元 64 位元版本。
  • dtexecui ( http://msdn.microsoft.com/zh-tw/library/ms180378.aspx )
    • 此公用程式會以 GUI 的方式啟動,設定好相關執行參數後,可執行儲存在下列三個位置之一的封裝:Microsoft SQL Server 資料庫、SSIS 封裝存放區及檔案系統。
    • 此公用程式僅具有是 32 位元版本。
  • dtutil ( http://msdn.microsoft.com/zh-tw/library/ms162820.aspx )
    • 此公用程式用來管理 SSIS 封裝,可對封裝進行複製、移動、刪除封裝,或確認封裝是否存在
    • 可對存放在下列三個位置所儲存的任何 SSIS 封裝進行管理:Microsoft SQL Server 資料庫、SSIS 封裝存放區和檔案系統。
  • SSISUpgrade ( http://msdn.microsoft.com/zh-tw/library/cc280547 )
    • 可升級以舊版 Integration Services 所建立的封裝,至 SQL Server 2012 所使用的 Integration Services 格式。
    • 也可以使用 SQL Server 的 Standard、Enterprise 和 Developer Edition 中使用 SSIS 封裝升級精靈,兩者是相同的。
  • gacutil ( http://msdn.microsoft.com/zh-tw/library/ms403356.aspx )
    • 撰寫 IS 之自訂物件的程式碼之後,必須建立並部署組件,以及將其整合到 SSIS 設計工具,才可供封裝使用,並進行測試及偵錯。
    • 此公用程式可將工作組件安裝到全域組件快取 (GAC)。

 


 

DQS

  • DQS 是一個知識驅動的資料品質專案。可讓您透過建立知識庫,然後使用該知識庫執行各種重要的資料品質工作,包括更正、充實、標準化刪除重複資料
  • DQS 可使用參考資料提供者所提供的雲端式 Reference Data Services,執行資料清理。
  • Data Quality Services 包括 Data Quality Server 和 Data Quality Client。這些元件可讓您與其他 SQL Server 作業分開執行 Data Quality Services。 兩者都是從 SQL Server 安裝程式安裝的。
    • Data Quality Server 會安裝在 SQL Server 2012 Database Engine 之上,並且包含三個資料庫:DQS_MAIN、DQS_PROJECTS 和 DQS_STAGING_DATA。最低需求至少需要 2 GB 記憶體。當使用 SQL Server 安裝程式安裝完畢之後,必須執行 DQSInstaller.exe 才能完成 Data Quality Server 的安裝。
    • Data Quality Client 用於連接到 Data Quality Server 的獨立應用程式,其提供高度直覺式的圖形化使用者介面,讓您可以執行資料品質作業,以及其他與 DQS 相關的管理工作。最低需求為 .NET Framework 4.0 IE 6.0 SP1 或更新的版本。

 


 

MDS

  • Master Data Services (MDS) 是用於主要資料管理的 SQL Server 方案。 其目標在於編譯可維護的主要清單。 MDM 專案一般包含內部商業程序的評估與重組,以及 MDM 技術的實作。 成功的 MDM 方案結果是可以分析的可靠集中式資料,以進行更好的商業性決策。
  • 「模型」組織主要資料的結構。 實作過程可以有一個或多個模型,每個模型會將類似的資料類型群組在一起。
  • 「實體」是 Master Data Services 模型中包含的物件。 每個實體都含有會員,也就是您所管理之主要資料的資料列。
  • 「屬性」是 Master Data Services 實體中包含的物件。 屬性值描述實體的成員。 屬性可用來描述分葉成員、合併成員或集合。
    • 自由格式」( Free-Form )的屬性,允許以自由格式輸入文字、數字、日期或連結。
    • 網域屬性」( Domain-base ) 是由其他實體成員擴展其值的屬性。 。

    實體中的網域屬性

    • 檔案屬性」用來儲存檔案、文件或影像。

 

  • 「階層」是一個樹狀目錄,您可以用它來執行以下作業: 1.分組類似的成員供組織使用。  2.合併及摘要成員來進行報告和分析。
    • 明確階層
    • 衍生階層
      • 遞迴階層」是包含遞迴關聯性的衍生階層。 當實體有基於實體本身的網域屬性時,就會有遞迴關聯性。

mds_conc_recursive_UI_example_anchored

 

 


 

SSIS Logging

  • Log Provider
    • 「文字檔」記錄提供者,它會將記錄項目以逗號分隔值 (CSV) 的格式寫入 ASCII 文字檔。 此提供者的預設副檔名為 .log。
    • 「SQL Server Profiler」 記錄提供者,它可寫入追蹤檔,您可以使用 SQL Server Profiler 檢視該追蹤檔。 此提供者的預設副檔名為 .trc,不支援 64 位元的封裝。
    • 「SQL Server」 記錄提供者,它可將記錄項目寫入 SQL Server 資料庫的 sysssislog 資料表中。
    • 「Windows 事件」記錄提供者,它可將項目寫入本機電腦上之「Windows 事件」記錄的「應用程式」記錄中。
    • 「XML 檔案」記錄提供者,它可將記錄檔寫入 XML 檔案中。 此提供者的預設副檔名為 .xml。
  • Logging levels
    • 「None」: 關閉記錄功能。 只記錄封裝執行狀態。
    • Basic」: 此為預設值。記錄所有事件,自訂和診斷事件除外。
    • Performance」: 只記錄效能統計資料,以及 OnError 和 OnWarning 事件。
    • Verbose」: 記錄所有事件,包括自訂和診斷事件。 會將過程中的每個步驟都詳記紀錄產生一筆資料,可透過 catalog.execution_data_statistics 檢視顯示。

 


 

專案部屬模式相關指令

  • 建立環境 ( 主要指令 : catalog.create_environment )
EXEC [SSISDB].[catalog].[create_environment] @environment_name=N'環境C', @environment_description=N'', @folder_name=N'測試用'

GO
  • 在環境下建立環境變數 ( 主要指令 : catalog.create_environment_variable )
DECLARE @var sql_variant = N'新環境變數值'
EXEC [SSISDB].[catalog].[create_environment_variable] @variable_name=N'SetParameter1', @sensitive=False, @environment_name=N'環境C', @folder_name=N'測試用', @value=@var, @data_type=N'String'
GO
  • 將環境跟專案設定關聯 ( 主要指令 : catalog.create_environment_reference )
Declare @reference_id bigint
EXEC [SSISDB].[catalog].[create_environment_reference] @environment_name=N'環境C', @reference_id=@reference_id OUTPUT, @project_name=N'MyTest', @folder_name=N'測試用', @reference_type=R
Select @reference_id
  • 設定專案變數對應所使用的環境變數 ( 主要指令 catalog.set_object_parameter_value )
EXEC [SSISDB].[catalog].[set_object_parameter_value] @object_type=20, @parameter_name=N'PrjParam1', @object_name=N'MyTest', @folder_name=N'測試用', @project_name=N'MyTest', @value_type=R, @parameter_value=N'SetParameter1'
GO
  • 指定使用特定環境執行封裝 ( 在 create_execution 的時候指定 reference_id )
-- reference_id 可透過以下指令取得
-- Select * from SSISDB.catalog.environment_references
Declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution] @package_name=N'Package.dtsx', @execution_id=@execution_id OUTPUT, @folder_name=N'測試用', @project_name=N'MyTest', @use32bitruntime=False, @reference_id=4
Select @execution_id
DECLARE @var0 smallint = 1
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id,  @object_type=50, @parameter_name=N'LOGGING_LEVEL', @parameter_value=@var0
EXEC [SSISDB].[catalog].[start_execution] @execution_id
  • 指定特定資料流程元件和流程名稱,將流過此部分的資料轉出成為檔案 ( 主要指令 catalog.add_data_tap )
Declare @execution_id bigint
Exec SSISDB.Catalog.create_execution @folder_name='Packages',@project_name='SSISPackages', @package_name='Package.dtsx',@reference_id=Null, @use32bitruntime=False, @execution_id=@execution_id OUTPUT

Exec SSISDB.Catalog.set_execution_parameter_value @execution_id,50, 'LOGGING_LEVEL', 0

Exec SSISDB.Catalog.add_data_tap @execution_id, @task_package_path='\Package\Data Flow Task', @dataflow_path_id_string = 'Paths[OLE DB Source.OLE DB Source Output]', @data_filename = 'output0.txt'

Exec SSISDB.Catalog.start_execution @execution_id
  • 可透過 [SSISDB].[catalog].[executions] 取得封裝執行狀況

image

 


   

升級封裝

升級方式

類型

執行使用 SSIS 2012 dtexec 公用程式執行舊版本封裝 暫時性,每次執行都需轉換
使用 SSDT 開啟舊版本封裝檔案,或者是在現有專案下開啟舊版本封裝檔案。 如果有儲存,則下次開起就不用在花時間等待升級。
使用SSDT 內的「SSIS 封裝升級精靈」或者是直接在命令列執行SSISUpgrade.exe 進行升級 升級是永久性的。

 


 

參考資料

  • What are slowly changing dimensions (SCD)? ( http://blog.sqlauthority.com/2007/07/28/sql-server-data-warehousing-interview-questions-and-answers-part-3/ )
    • SCD is abbreviation of Slowly changing dimensions. SCD applies to cases where the attribute for a record varies over time. There are three different types of SCD.
      1. Type 1 : The new record replaces the original record. Only one record exist in database – current data
      2. Type 2 : A new record is added into the customer dimension table. Two records exist in database – current data and previous history data.
      3. Type 3 : The original data is modified to include new data. One record exist in database – new information are attached with old information in same row
  • What is surrogate key?
    • Surrogate key is a substitution for the natural primary key. It is just a unique identifier or number for each row that can be used for the primary key to the table. The only requirement for a surrogate primary key is that it is unique for each row in the table. It is useful because the natural primary key can change and this makes updates more difficult.Surrogated keys are always integer or numeric.
    • A Surrogate Key is a type of key in a table which uniquely identifies each record, but has no business meaning attached to it. It is merely a value used to uniquely identify a record in a table.
  • What is junk dimension?
    • A number of very small dimensions might be lumped together to form a single dimension, a junk dimension – the attributes are not closely related. Grouping of Random flags and text Attributes in a dimension and moving them to a separate sub dimension is known as junk dimension.
  • What are conformed dimensions?
    • Conformed dimensions mean the exact same thing with every possible fact table to which they are joined. They are common to the cubes.
    • A Conformed Dimension is a Dimension which connects to multiple Fact Tables across one or more Data Marts (cubes). A Confirmed Dimension is physically implemented across multiple Data Marts with exactly the same structure, attributes, values (dimension members), meaning and definition. Each instance means exactly the same thing providing the exact same context irrespective of the Fact Table to which it is connected or the Data Mart to which it belongs.

 

http://blog.sqlauthority.com/2007/07/26/sql-server-data-warehousing-interview-questions-and-answers-part-1/

http://blog.sqlauthority.com/2007/07/27/sql-server-data-warehousing-interview-questions-and-answers-part-2/

http://blog.sqlauthority.com/2007/07/28/sql-server-data-warehousing-interview-questions-and-answers-part-3/

http://www.mssqltips.com/sqlservertip/2662/sql-server-analysis-services-interview-questions-part-ii--dimensions/