Linux でインポート後にスキーマの行数を確認する
データベーススキーマのインポート後に、スキーマの各テーブルの行数データを作成します。作成したデータをスキーマのエクスポート前に作成したデータと比較します。
- 次のコマンドを実行します。sqlplus protect/<パスワード>@protect
- 次のコマンドを実行し、PL または SQL 関数を作成して行数を確認します。SQL>create or replace functionrow_count (p_tablename in varchar2)return numberasl_count number;beginexecute immediate'select count(*)from ' || p_tablenameinto l_count;return l_count;end;/
- 次のクエリーを実行してスキーマの各テーブルの行数データを作成します。SQL>spool rowCount_ater_import.txtSQL>select table_name, row_count(table_name) num_of_rowsfrom user_tables;SQL>spool offrowCount_after_import.txtが実行ディレクトリに作成されます。
- rowCount_after_import.txtのデータとエクスポート操作前に作成したrowCount_before_export.txtファイルを比較します。