パフォーマンスの評価のためにテスト・システムをマスキングすると、マスキング後のオブジェクト統計保持に役立ちます。マスキング前スクリプトを追加して統計を一時表にエクスポートして、マスキングの終了後にマスキング後スクリプトを使用してリストアすることで、これを行います。
「マスク前スクリプト」テキスト・ボックスを使用して、マスキングの開始前に実行する必要のある任意のユーザー指定のSQLスクリプトを指定します。
「マスク後スクリプト」テキスト・ボックスを使用して、マスキング完了後に実行するSQLスクリプトを指定します。マスキングでデータが変更されるため、ブックをリバランスしたり、ロープアップ・モジュールや集計モジュールを呼び出して関連情報と集計情報の整合性を維持するなどのタスクも実行できます。
次に、統計を保持するためのマスク前およびマスク後スクリプトの例を示します。
この例に、統計を保持するためのマスク前スクリプトを示します。
variable sts_task VARCHAR2(64); /*Step :1 Create the staging table for statistics*/ exec dbms_stats.create_stat_table(ownname=>'SCOTT',stattab=>'STATS'); /* Step 2: Export the table statistics into the staging table. Cascade results in all index and column statistics associated with the specified table being exported as well. */ exec dbms_stats.export_table_stats(ownname=>'SCOTT',tabname=>'EMP', partname=>NULL,stattab=>'STATS',statid=>NULL,cascade=>TRUE,statown=>'SCOTT'); exec dbms_stats.export_table_stats(ownname=>'SCOTT',tabname=>'DEPT', partname=>NULL,stattab=>'STATS',statid=>NULL,cascade=>TRUE,statown=>'SCOTT'); /* Step 3: Create analysis task */ 3. exec :sts_task := DBMS_SQLPA.create_analysis_task(sqlset_name=> 'scott_test_sts',task_name=>'SPA_TASK', sqlset_owner=>'SCOTT'); /*Step 4: Execute the analysis task before masking */ exec DBMS_SQLPA.execute_analysis_task(task_name => 'SPA_TASK', execution_type=> 'explain plan', execution_name => 'pre-mask_SPA_TASK');
この例に、統計を保持するためのマスク後スクリプトを示します。
*Step 1: Import the statistics from the staging table to the dictionary tables*/ exec dbms_stats.import_table_stats(ownname=>'SCOTT',tabname=>'EMP', partname=>NULL,stattab=>'STATS',statid=>NULL,cascade=>TRUE,statown=>'SCOTT'); exec dbms_stats.import_table_stats(ownname=>'SCOTT',tabname=>'DEPT', partname=>NULL,stattab=>'STATS',statid=>NULL,cascade=>TRUE,statown=>'SCOTT'); /* Step 2: Drop the staging table */ exec dbms_stats.drop_stat_table(ownname=>'SCOTT',stattab=>'STATS'); /*Step 3: Execute the analysis task before masking */ exec DBMS_SQLPA.execute_analysis_task(task_name=>'SPA_TASK', execution_type=>'explain plan', execution_name=>'post-mask_SPA_TASK'); /*Step 4: Execute the comparison task */ exec DBMS_SQLPA.execute_analysis_task(task_name =>'SPA_TASK', execution_type=>'compare', execution_name=>'compare-mask_SPA_TASK');
関連項目:
データ・マスキング・ジョブのスケジュール時にこれらのスクリプトの場所を指定する方法を説明する手順は、「パフォーマンス評価のためのテスト・システムのマスキング」を参照してください