[OracleDB] AWRのダンプファイルをエクスポート・インポート

AWR(Automatic Workload Repository)をエクスポートとインポート方法を紹介します。

AWRとはOracle Databaseの稼働統計とワークロード情報のスナップショットを自動的に収集・管理する機能です。

本番環境のAWRをエクスポートし、開発環境へインポートすることで本番環境へアクセスできない人でも AWRレポート生成することができるようになります。

なおAWR利用には「Diagnostic Pack」のライセンスが追加で必要になります。

目次

AWRのエクスポート

AWRのエクスポートは、SQL*PlusにSYSユーザでログインし以下のSQLを実行します。

@?/rdbms/admin/awrextr.sql 

対話式で取得するレポートの指定をしていきます。

★の部分が対話式で設定値を返していく箇所です。

Databases in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The default database id is the local one: '1469414445'. To use this
database id, press <return> to continue, otherwise enter an alternative.

dbidに値を入力してください:  ★</code></pre>
<p>まずは<strong>DBID</strong>を指定します</p>
<pre><code class="language-bash">Databases in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The default database id is the local one: '1469414445'. To use this
database id, press <return> to continue, otherwise enter an alternative.

dbidに値を入力してください:  ★

直近何日間のスナップショットからAWRを取得するか選択します。

デフォルトはすべてのスナップショットから選択できるようになります。

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
begin_snapに値を入力してください: ★

end_snapに値を入力してください: ★</code></pre>
<p>スナップショットの開始地点と終了地点を選択します。</p>
<pre><code class="language-bash">Specify the Directory Name
~~~~~~~~~~~~~~~~~~~~~~~~~~

Choose a Directory Name from the above list (case-sensitive).

directory_nameに値を入力してください:★

ディレクトリオブジェクトを指定します。

Specify the Name of the Extract Dump File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The prefix for the default dump file name is awrdat_310_318.
To use this name, press <return> to continue, otherwise enter
an alternative.

file_nameに値を入力してください: ★</code></pre>
<p>エクスポートする<strong>ダンプファイルのファイル名</strong>を指定します。</p>
<p>拡張子は指定する必要ありません。</p>
<h2>AWRのインポート</h2>
<p>AWRのインポートは、SQL*PlusにSYSユーザでログインし以下のSQLを実行します。</p>
<p>sql 対話式で取得するレポートの指定をしていきます。</p>
<p>★の部分が対話式で設定値を返していく箇所です。</p>
<pre><code class="language-bash">Specify the Directory Name
~~~~~~~~~~~~~~~~~~~~~~~~~~

Choose a Directory Name from the list above (case-sensitive).

directory_nameに値を入力してください: ★

ディレクトリオブジェクトを指定します。

ディレクトリパスではないので注意しください。

Specify the Name of the Dump File to Load
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please specify the prefix of the dump file (.dmp) to load:

file_nameに値を入力してください: ★</code></pre>
<p>インポートする<strong>ダンプファイルのファイル名</strong>を指定します。</p>
<p>拡張子は指定する必要ありません。</p>
<pre><code class="language-bash">Staging Schema to Load AWR Snapshot Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The next step is to create the staging schema
where the AWR snapshot data will be loaded.
After loading the data into the staging schema,
the data will be transferred into the AWR tables
in the SYS schema.

The default staging schema name is AWR_STAGE.
To use this name, press <return> to continue, otherwise enter
an alternative.

schema_nameに値を入力してください: ★

インポートするスキーマ(ステージング用のスキーマ)名を指定します。

デフォルトでは「AWR_STAGE」が指定されます。

Choose the Default tablespace for the AWR_STAGE user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choose the AWR_STAGE users's default tablespace. This is the
tablespace in which the AWR data will be staged.

Pressing <return> will result in the recommended default
tablespace (identified by *) being used.

default_tablespaceに値を入力してください: ★</code></pre>
<p><strong>インポート先の表領域</strong>を指定します。</p>
<p>「<strong>SYSAUX</strong>」を使用することをオススメします。 </p>
<pre><code class="language-bash">Choose the Temporary tablespace for the AWR_STAGE user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choose the AWR_STAGE user's temporary tablespace.

Pressing <return> will result in the database's default temporary
tablespace (identified by *) being used.

temporary_tablespaceに値を入力してください: ★

インポートするスキーマが使用する一時表領域を指定します。

Oracleの基本 ~データベース入門から設計/運用の初歩までposted with ヨメレバ

渡部 亮太,相川 潔,日比野 峻佑,岡野 平八郎,宮川 大地 技術評論社 2017-09-22

Amazonで探す

Kindleで探す

楽天ブックスで探す

楽天koboで探す

7netで探す

hontoで探す

e-honで探す

紀伊國屋書店で探す

よかったらシェアしてね!
  • URLをコピーしました!
目次