我们能够将AWR元数据迁移(导入)到其它数据库。低版本号的导入到高版本号,再用高版本号的数据库生成AWR报告,也能使用一些新特性,如

SQL ordered by Physical Reads (UnOptimized)

SQL ordered by User I/O Wait Time

导出

testnode:/home/oracle$export ORACLE_SID=wy1

testnode:/home/oracle$sqlplus / as sysdba

SQL> @?/rdbms/admin/awrextr.sql

~~~~~~~~~~~~~

AWR EXTRACT

~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~  This script will extract the AWR data for a range of snapshots  ~

~  into a dump file.  The script will prompt users for the         ~

~  following information:                                          ~

~     (1) database id                                              ~

~     (2) snapshot range to extract                                ~

~     (3) name of directory object                                 ~

~     (4) name of dump file                                        ~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Databases in this Workload Repository schema

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DB Id     DB Name      Host

------------ ------------ ------------

* 3988169241 WY           testnode1

* 3988169241 WY           testnode2

The default database id is the local one: '3988169241'.  To use this

database id, press <return> to continue, otherwise enter an alternative.

Enter value for dbid:

Using 3988169241 for Database ID

Specify the number of days of snapshots to choose from

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Entering the number of days (n) will result in the most recent

(n) days of snapshots being listed.  Pressing <return> without

specifying a number lists all completed snapshots.

Enter value for num_days:

Listing all Completed Snapshots

...

DB Name        Snap Id    Snap Started

------------ --------- ------------------

WY                4706 18 Mar 2015 18:00

                  4707 18 Mar 2015 19:00   <<<

                  4708 18 Mar 2015 20:00   <<<

Specify the Begin and End Snapshot Ids

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Enter value for begin_snap: 4707    <<<<起始SNAP

Begin Snapshot Id specified: 4707   <<<<结束SNAP

Enter value for end_snap: 4708

End   Snapshot Id specified: 4708

Specify the Directory Name

~~~~~~~~~~~~~~~~~~~~~~~~~~

Directory Name                 Directory Path

------------------------------ -------------------------------------------------

DATA_PUMP_DIR                  /u01/app/oracle/product/11.2.0/db_1/rdbms/log/

EXPDP                          /tmp/expdp       <<<<<<<<<<<<<<<<

ORACLE_OCM_CONFIG_DIR          /u01/app/oracle/product/11.2.0/db_1/ccr/state

ORACLE_OCM_CONFIG_DIR2         /u01/app/oracle/product/11.2.0/db_1/ccr/state

XMLDIR                         /u01/app/oracle/product/11.2.0/db_1/rdbms/xml

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

Enter value for directory_name: EXPDP   <<<<<<<<<输入DIRECTORY,右边是文件夹所相应的物理路径.注: 假设SNAP跨度大,须要较大的空间来存放文件

Using the dump directory: EXPDP

Specify the Name of the Extract Dump File

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The prefix for the default dump file name is awrdat_4707_4708.

To use this name, press <return> to continue, otherwise enter

an alternative.

Enter value for file_name:

Using the dump file prefix: awrdat_4707_4708

|

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|  The AWR extract dump file will be located

|  in the following directory/file:

|   /tmp/expdp                <<<<文件夹   

|   awrdat_4707_4708.dmp      <<<<文件名

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|

|  *** AWR Extract Started ...

|

|  This operation will take a few moments. The

|  progress of the AWR extract operation can be

|  monitored in the following directory/file:

|   /tmp/expdp                       

|   awrdat_4707_4708.log             

|

导入:

导入过程也类似

SQL> @?/rdbms/admin/awrload

~~~~~~~~~~

AWR LOAD

~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~  This script will load the AWR data from a dump file. The   ~

~  script will prompt users for the following information:    ~

~     (1) name of directory object         ~

~     (2) name of dump file          ~

~     (3) staging schema name to load AWR data into       ~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Specify the Directory Name

~~~~~~~~~~~~~~~~~~~~~~~~~~

Directory Name         Directory Path

------------------------------ -------------------------------------------------

AGREE_AWRREPORT_DIR        /tmp/xunjian

DATA_PUMP_DIR         /u01/app/oracle/admin/orcl/dpdump/

EXPDP          /arch/expdp       <<<<<<<<<<<<<<<<<<<<<<

ORA10G_PUMP         /u01/app/oracle/datapump/ora10g

ORACLE_OCM_CONFIG_DIR        /u01/app/oracle/product/11.2.0/db_1/ccr/state

XMLDIR          /u01/app/oracle/product/11.2.0/db_1/rdbms/xml

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

Enter value for directory_name: EXPDP  <<<<<<<<<<<<<<<<输入DIRECTORY名称

Using the dump directory: EXPDP

Specify the Name of the Dump File to Load

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please specify the prefix of the dump file (.dmp) to load:

Enter value for file_name: awrdat_4707_4708        <<<<<<<<<<<<<<<输入文件名称(不包括后缀.dmp)

Loading from the file name: awrdat_4707_4708.dmp

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.

Enter value for schema_name:          <<<<<<<<<<<<<<回车,取默认值

Using the staging 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.

TABLESPACE_NAME

--------------------------------------------------------------------------------

CONTENTS      DEFAULT TABLESPACE

--------------------------- ------------------

SYSAUX

PERMANENT      *

USERS

PERMANENT

Pressing <return> will result in the recommended default

tablespace (identified by *) being used.

Enter value for default_tablespace:          <<<<<<<<<<<<<回车,取默认值

Using tablespace SYSAUX as the default tablespace for the AWR_STAGE

Choose the Temporary tablespace for the AWR_STAGE user

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Choose the AWR_STAGE user's temporary tablespace.

TABLESPACE_NAME

--------------------------------------------------------------------------------

CONTENTS      DEFAULT TEMP TABLESPACE

--------------------------- -----------------------

TEMP

TEMPORARY      *

Pressing <return> will result in the database's default temporary

tablespace (identified by *) being used.

Enter value for temporary_tablespace:          <<<<<<<<<<<<<回车,取默认值

Using tablespace TEMP as the temporary tablespace for AWR_STAGE

... Creating AWR_STAGE user

|

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|  Loading the AWR data from the following

|  directory/file:

|   /arch/expdp

|   awrdat_4707_4708.dmp

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|

|  *** AWR Load Started ...

|

|  This operation will take a few moments. The

|  progress of the AWR load operation can be

|  monitored in the following directory/file:

|   /arch/expdp

|   awrdat_4707_4708.log

|

...

---------------------------------------------------

道行尚浅,欢迎拍砖。

转载请注明出处.

AWR元数据的迁移或导入到其它数据库的更多相关文章

  1. 一步步实现ABAP后台导入EXCEL到数据库【1】

    在SAP的应用当中,导入.导出EXCEL文件的情况是一个常见的需求,有时候用户需要将大量数据定期导入到SAP的数据库中.这种情况下,使用导入程序在前台导入可能要花费不少的时间,如果能安排导入程序为后台 ...

  2. 用 BigDump 工具导入超大 MySQL 数据库备份文件

    用 BigDump 工具导入超大 MySQL 数据库备份文件  创建于 2010-07-01, 周四 00:00  作者 白建鹏 在<Joomla! 1.5 网站防黑9条戒律>这篇文章中, ...

  3. Android 数据库升级中数据保持和导入已有数据库

    一.数据库升级: 在我们的程序中,或多或少都会涉及到数据库,使用数据库必定会涉及到数据库的升级,数据库升级带来的一些问题,如旧版本数据库的数据记录的保持,对新表的字段的添加等等一系列问题,还记得当我来 ...

  4. DBF导入到Oracle数据库

    今天我遇到了一个需求,是将一个DBF文件导入到Oracle库中,之前一直使用的是公司提供的迁移工具,但是不知道怎么回事今天一直报DBF文件无法访问之类的错误,尝试多次之后,一气之下弃之不用,另寻他法. ...

  5. 一步步实现ABAP后台导入EXCEL到数据库【3】

    在一步步实现ABAP后台导入EXCEL到数据库[2]里,我们已经实现计划后台作业将数据导入数据库的功能.但是,这只是针对一个简单的自定义结构的导入程序.在实践应用中,面对不同的表.不同的导入文件,我们 ...

  6. PL/SQLDeveloper导入导出Oracle数据库方法

    前一篇博客介绍了Navicat工具备份Oracle的方法,这篇博客介绍一下使用PL/SQL Developer工具导入导出Oracle数据库的方法. PL/SQL Developer是Oracle数据 ...

  7. 怎样把excel的数据导入到sqlserver2000数据库中

    在做程序的时候有时需要把excel数据导入到sqlserver2000中,以前没从外部导入过数据,今天刚做了一下导入数据,感觉还是蛮简单的,没做过之前还想着多么的复杂呢,下面就来分享一下我是如何把ex ...

  8. [转]PL/SQLDeveloper导入导出Oracle数据库方法

    原文地址:http://www.2cto.com/database/201405/305452.html 1.Oracle数据库导出步骤 1.1 Tools→Export User Objects.. ...

  9. 如何使用NPOI 导出到excel和导入excel到数据库

    近期一直在做如何将数据库的数据导出到excel和导入excel到数据库. 首先进入官网进行下载NPOI插件(http://npoi.codeplex.com/). 我用的NPOI1.2.5稳定版. 使 ...

随机推荐

  1. 用Razor来生成模板 using razor for template

    原文发布时间为:2011-09-15 -- 来源于本人的百度文章 [由搬家工具导入] http://razorengine.codeplex.com/

  2. Servlet乱码解决

    后端收前端 1.post乱码 可以通过 request.setCharacterEncoding("utf-8");  这样在后端可以接收中文 2.get乱码(手动解决) 可以通过 ...

  3. 语法错误: 标识符“__RPC__out_xcount_part” 解决方法

    1.错误描述 2.解决方案:将 $(DXSDK_DIR)\Include; 放到最后面,如下

  4. 【Visual Studio】解决错误 fatal error C1010: unexpected end of file while looking for precompiled head(转)

    原文转自 http://blog.csdn.net/liuqiyao_01/article/details/38867145 在编译VS时候,出现fatal error C1010: unexpect ...

  5. 键盘事件keydown、keypress、keyup

    事件触发顺序:keydown - > keypress - > keyup   中文输入法:   firfox:输入触发keydown,回车确认输入触发keyup chrome:输入触发k ...

  6. VS恢复默认设置

    通过“导入和导出设置”实现VS恢复默认设置 1.快捷步骤 工具 → 导入和导出设置 → 重置所有设置 → 下一步 → 选择“是否保存当前设置”,下一步 → 选择“要重置的开发语言(如,Visual C ...

  7. HDU 6251 Inkopolis(2017 CCPC-Final,I题,环套树 + 结论)

    题目链接 HDU 6251 题意 给出一个$N$个点$N$条边的无向图.然后给出$M$个操作,每个操作为$(x, y, z)$,表示把连接 $x$和$y$的边的颜色改成$z$. 求这张无向图中所有边的 ...

  8. 洛谷——P3387 【模板】缩点

    P3387 [模板]缩点 题目背景 缩点+DP 题目描述 给定一个n个点m条边有向图,每个点有一个权值,求一条路径,使路径经过的点权值之和最大.你只需要求出这个权值和. 允许多次经过一条边或者一个点, ...

  9. 分享Kali Linux 2017年第17周镜像文件

     分享Kali Linux 2017年第17周镜像文件  Kali Linux官方于4月23日发布2017年的第17周镜像.这次维持了11个镜像文件的规模.默认的Gnome桌面的4个镜像,E17.KD ...

  10. CSS:水平居中与垂直居中

    CSS居中算是一个比较基础的问题,在实际运用中,需要考虑到的一般是两种情况,一种是主要是表现为文字,图片等行内元素的居中,一种是指 div 等块级标签元素的居中. 水平居中 1.行内元素 行内元素(主 ...