Migrating AWR data OracleDatabase allows us to transmit AWR data between several databases. This is useful when you want to analyze AWR data on a separate system. To transmit AWR data, you must extract the AWR snapshot data from the source database and load the data into the target database. The following describes how
Migrating AWR data Oracle Database allows us to transmit AWR data between several databases. This is useful when you want to analyze AWR data on a separate system. To transmit AWR data, you must extract the AWR snapshot data from the source database and load the data into the target database. The following describes how
Migrate AWR data
Oracle Database allows us to transmit AWR data between several databases. This is useful when you want to analyze AWR data on a separate system. To transmit AWR data, you must extract the AWR snapshot data from the source database and load the data into the target database. The following describes how to extract and load AWR data on Oracle Database.
1. Extract AWR data
The awrextr. SQL script can be used to extract a series of AWR snapshot Data from the database to the Data Pump export file. After exporting the AWR snapshot data, you can transfer the dump file to another database to which you want to load the data. To run the awrextr. SQL script, you must connect to the database as a SYS user.
The steps for extracting AWR data are as follows:
- In the sqlplus command line, enter:
@ $ ORACLE_HOME/rdbms/admin/awrextr. SQL
Displays the Database List in AWR schema.
- DBID of the database from which AWR data is to be extracted:
Enter value for dbid: 220853307
- Specifies the number of days of the snapshot IDs you want to list.
Enter value for num_days: 2
4. Specify the start and end snapshot_id to define the range of AWR data to be extracted:
Enter value forbegin_snap: 31
Enter value for end_snap: 41
- Specify the name of the directory object to store the exported dump file (which must be created in advance ):
Sys @ PROD> createdirectory db_dir as '/home/oracle/backup ';
Enter value for directory_name: DB_DIR
- Specify the name of the exported dump file (The. dmp suffix is automatically added ):
Enter value for file_name: awrdata_31_41
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
| The AWR extract dump file will be located
| In the following directory/file:
|/Home/oracle/backup
| Awrdata_31_41.dmp
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
| *** AWR Extract Started...
|
| This operation will take a few moments.
| Progress of the AWR extract operation can be
| Monitored in the following directory/file:
|/Home/oracle/backup
| Awrdata_31_41.log
|
Elapsed: 00: 00: 00.06
Elapsed: 00: 01: 41.66
End of AWR ExtractAWR
The data export time is determined by the AWR data volume to be exported. After export, You can transmit the data to other database systems.
[Oracle @ prod backup] $ ls-lt
Total 10196
-Rw-r ----- 1 oracle oinstall10407936 Mar 9 21:36 awrdata_31_41.dmp
-Rw-r -- 1 oracleoinstall 15577 Mar 9 awrdata_31_41.log
2. Load AWR data
After the exported dump file is transferred to the target database, you can use the awrload. SQL script to load the extracted AWR data. The awrload. SQL script first creates a transit schema to load the Data Pump file into the database. The data is then transmitted from the intermediate schema to the corresponding AWR table. To run the awrload. SQL script, you must connect to the database as SYS.
Steps for loading AWR data:
- At the sqlplus command prompt, enter:
@ $ ORACLE_HOME/rdbms/admin/awrload. SQL
Displays a list of directory objects.
- Directory object corresponding to the directory where the exported dump file is located:
Entervalue for directory_name: DB_DIR
- Specify the prefix of the exported dump file (. dmp suffix will be automatically added ):
Enter valuefor file_name: awrdata_31_41
- Name of the intermediate schema to be loaded into AWR:
Enter value for schema_name: AWR_STAGE
- Specify the default tablespace of the intermediate schema:
Enter value for default_tablespace: SYSAUX
- Specify the temporary tablespace of the intermediate schema:
Enter value for temporary_tablespace: TEMP
- After performing the preceding operations, a schema named AWR_STAGE is created in the database to load AWR data. After AWR data is loaded into AWR_STAGE schema, the data is passed into the AWR table in SYS schema:
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
| Loading the AWR data from the following
| Directory/file:
|/Home/oracle/backup
| Awrdata_31_41.dmp
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
|
| *** AWR Load Started...
|
| This operation will take a few moments.
| Progress of the AWR load operation can be
| Monitored in the following directory/file:
|/Home/oracle/backup
| Awrdata_31_41.log
|
Elapsed: 00: 00: 00.02
Elapsed: 00: 00: 56.56
Elapsed: 00: 00: 16.11
... DroppingSTAGE_AWR user
The loading time is determined by the AWR data volume to be loaded. After AWR data is loaded, the intermediate schema is automatically deleted.
Http://blog.csdn.net/xiangsir/article/details/8666184