当前位置:  数据库>oracle

DUMP的AWR报告如何导入到Oracle详解

    来源: 互联网  发布时间:2017-06-02

    本文导语: AWR的dump文件导出 1.在导出数据之前,一般需要创建以下路径: DATA_PUMP_DIR EXP IMP DATA_FILE_DIR     23:54:29 sys@felix SQL>create directoryexp as '/u01/exp';   Directory created.   23:55:33 sys@felix SQL>create directorydate_dir as'/u01/dir';   Directory created.   2.导...

AWR的dump文件导出

1.在导出数据之前,一般需要创建以下路径:

DATA_PUMP_DIR

EXP

IMP

DATA_FILE_DIR

 

 

23:54:29 sys@felix SQL>create directoryexp as '/u01/exp';

 

Directory created.

 

23:55:33 sys@felix SQL>create directorydate_dir as'/u01/dir';

 

Directory created.

 

2.导出AWR数据

在$Oracle_HOME/rdbms/admin目录下,我们会看到很多以awr开头的sql脚本

 

可以使用awrextr.sql脚本导出AWR数据到dmp文件,实现AWR数据的迁移。步骤大致如下:

 

00:03:54 sys@felix SQL>@?/rdbms/admin/awrextr

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

AWR EXTRACT

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

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

~This script will extract the AWR data for arange 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 WorkloadRepository schema

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

 

DB IdDB NameHost

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

* 3569708122 FELIXfelix

 

The default database id isthe local one: '3569708122'.To use this

database id, press to continue, otherwise enter an alternative.

 

---这里输出的是本oracle的dbid

 

Enter value for dbid: 3569708122

 

Using 3569708122 for DatabaseID

 

 

Specify the number of days ofsnapshots to choose from

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

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

(n) days of snapshots beinglisted.Pressing without

specifying a number lists allcompleted snapshots.

 

 

Enter value for num_days: 3

 

Listing the last 3 days ofCompleted Snapshots

 

DB NameSnap IdSnap Started

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

FELIX15 08 Nov 2013 00:00

16 08 Nov 2013 01:01

17 08 Nov 2013 02:00

18 08 Nov 2013 03:00

19 08 Nov 2013 04:00

20 08 Nov 2013 05:00

21 08 Nov 2013 06:11

22 08 Nov 2013 07:00

23 08 Nov 2013 08:00

24 08 Nov 2013 09:00

25 08 Nov 2013 10:00

26 08 Nov 2013 11:00

27 08 Nov 2013 12:00

28 08 Nov 2013 13:00

29 08 Nov 2013 14:00

30 09 Nov 2013 21:12

31 09 Nov 2013 22:00

32 09 Nov 2013 23:00

33 10 Nov 2013 00:00

 

 

Specify the Begin and EndSnapshot Ids

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

Enter value for begin_snap: 26

Begin Snapshot Id specified: 26

 

Enter value for end_snap: 29

EndSnapshot Id specified: 29

 

 

Specify the Directory Name

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

 

Directory NameDirectory Path

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

DATA_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/s

ales_history/

 

DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpdump/

DATE_DIR/u01/dir

EXP/u01/exp

LOG_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/l

og/

 

MEDIA_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/p

roduct_media/

 

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

SS_OE_XMLDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry/

 

SUBDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry//2002/Sep

 

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

 

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

 

Enter value for directory_name: DATE_DIR---记得要大写

 

Using the dump directory:DATE_DIR

 

Specify the Name of theExtract Dump File

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

The prefix for the defaultdump file name is awrdat_26_29.

To use this name, press to continue, otherwise enter

an alternative.

 

Enter value for file_name: AWREXPIMP

 

Using the dump file prefix:AWREXPIMP

|

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

|The AWR extract dump file will be located

|in the following directory/file:

|/u01/dir

|AWREXPIMP.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:

|/u01/dir

|AWREXPIMP.log

|

 

End of AWR Extract

 

 

AWR的dump文件的导入:

 

 

1.导入之前需要创建DIREXTORY,将要导入的文件存放到此路径的操作系统目录下:

Create directory data_dir as'/u01/dir';

 

2.我们使用$ORACLE_HOME/rdbms/admin/awrload.sql脚本加载awr导出的dump文件数据:

00:15:27 sys@felixSQL>@?/rdbms/admin/awrload

~~~~~~~~~~

AWR LOAD

~~~~~~~~~~

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

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

~script will prompt users for the followinginformation:~

~(1) name of directory object~

~(2) name of dump file~

~(3) staging schema name to load AWR datainto~

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

 

Specify the Directory Name

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

 

Directory NameDirectory Path

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

DATA_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/s

ales_history/

 

DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpdump/

DATE_DIR/u01/dir

EXP/u01/exp

LOG_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/l

og/

 

MEDIA_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/p

roduct_media/

 

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

SS_OE_XMLDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry/

 

SUBDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry//2002/Sep

 

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

 

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

 

Enter value fordirectory_name: DATE_DIR

 

Using the dump directory:DATE_DIR

 

Specify the Name of the DumpFile to Load

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

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

 

Enter value for file_name:AWREXPIMP

 

Loading from the file name:AWREXPIMP.dmp

 

Staging Schema to Load AWRSnapshot Data

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

The next step is to createthe staging schema

where the AWR snapshot datawill be loaded.

After loading the data intothe staging schema,

the data will be transferredinto the AWR tables

in the SYS schema.

 

 

The default staging schemaname is AWR_STAGE.

To use this name, press to continue, otherwise enter

an alternative.

 

Enter value for schema_name:AWRUSE

 

Using the staging schemaname: AWRUSE

 

Choose the Default tablespacefor the AWRUSE user

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

Choose the AWRUSE users'sdefault tablespace.This is the

tablespace in which the AWRdata will be staged.

 

TABLESPACE_NAMECONTENTS

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

DEFAULT TABLESPACE

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

EXAMPLEPERMANENT

 

 

STATSPACKPERMANENT

 

 

SYSAUXPERMANENT

*

 

USERSPERMANENT

 

 

 

Pressing willresult in the recommended default

tablespace (identified by *)being used.

 

Enter value for default_tablespace:USERS

 

Using tablespace USERS as thedefault tablespace for the AWRUSE

 

 

Choose the Temporarytablespace for the AWRUSE user

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

Choose the AWRUSE user'stemporary tablespace.

 

TABLESPACE_NAMECONTENTS

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

DEFAULT TEMP TABLESPACE

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

STATSPACKTEMPTEMPORARY

 

 

TEMPTEMPORARY

*

 

 

Pressing willresult in the database's default temporary

tablespace (identified by *)being used.

 

Enter value fortemporary_tablespace: TEMP

 

Using tablespace TEMP as thetemporary tablespace for AWRUSE

 

 

... Creating AWRUSE user

 

|

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

|Loading the AWR data from the following

|directory/file:

|/u01/dir

|AWREXPIMP.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:

|/u01/dir

|AWREXPIMP.log

|

begin

*

ERROR at line 1:

ORA-20105: unable to move AWRdata to SYS

ORA-06512: at"SYS.DBMS_SWRF_INTERNAL", line 2950

ORA-20107: not allowed tomove AWR data for local dbid

ORA-06512: at line 3

 

 

... Dropping AWRUSE user

 

End of AWR Load

00:17:56 sys@felix SQL>

 

 

Schaema小插曲:schema名称必须是oracle数据库中不存在的,不然会异常退出:

 

*************************************************************************************************************************************************************

导出AWR的dump文件:

 

23:50:40 sys@felixSQL>createuser awrexp identified byoracle account unlock;

 

User created.

 

 

23:52:41 sys@felixSQL>grantdba to awrexp;

 

Grant succeeded.

 

00:11:46 sys@felixSQL>@?/rdbms/admin/awrload

~~~~~~~~~~

AWR LOAD

~~~~~~~~~~

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

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

~script will prompt users for the followinginformation:~

~(1) name of directory object~

~(2) name of dump file~

~(3) staging schema name to load AWR datainto~

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

 

Specify the Directory Name

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

 

Directory NameDirectory Path

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

DATA_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/s

ales_history/

 

DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpdump/

DATE_DIR/u01/dir

EXP/u01/exp

LOG_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/l

og/

 

MEDIA_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/p

roduct_media/

 

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

SS_OE_XMLDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry/

 

SUBDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o

rder_entry//2002/Sep

 

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

 

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

 

Enter value fordirectory_name: DATE_DIR

 

Using the dump directory:DATE_DIR

 

Specify the Name of the DumpFile to Load

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

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

 

Enter value for file_name:AWREXPEMP

 

Loading from the file name:AWREXPEMP.dmp

 

Staging Schema to Load AWRSnapshot Data

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

The next step is to createthe staging schema

where the AWR snapshot datawill be loaded.

After loading the data intothe staging schema,

the data will be transferredinto the AWR tables

in the SYS schema.

 

 

The default staging schemaname is AWR_STAGE.

To use this name, press to continue, otherwise enter

an alternative.

 

Enter value for schema_name:AWREXP

 

Using the staging schemaname: AWREXP

declare

*

ERROR at line 1:

ORA-20104: schema name'AWREXP' already exists

ORA-06512: at line 17

 

 

Disconnected from OracleDatabase 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP,Data Mining and Real Application Testing options

[oracle@felix ~]$


    
 
 

您可能感兴趣的文章:

 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • java命名空间javax.swing.text类abstractdocument的类成员方法: dump定义及介绍
  • php中自定义函数dump查看数组信息类似var_dump
  • Linux下c/c++开发之程序崩溃(Segment fault)时内核转储文件(core dump)生成设置方法
  • 关于core dump
  • 我的Ubuntu没有dump/restore命令,需要安装什么呢
  • shell创建一个带参数的文件名,这个参数怎么不显示出来backup$BDATE.dump
  • linux下如何为正在运行的程序创建core dump?
  • 进程异常退出时 Unix 在什么情况下会不产生 core dump 文件?
  • 【求教】符号表是干什么用的?怎么用?core dump出来以后怎么看?
  • 奇怪的core dump
  • 求救:高手请进: 使用 qsort()涵数时 core dump 阿?
  • 出现core dump,但是bt没有发现有价值的信息时
  • AIX中出现的Segmentation fault(code dump)如何解决?
  • core dump问题
  • 求解:父进程如何知道子进程core dump?
  • UNIX线程共用一个变量,出现core dump
  • linux下经常随机core dump有时几天死一次,有时一天死几次
  • segmentation fault(core dump)这句话怎么解释??
  • core dump? 如何定位
  • 怎么使用core dump
  • core dump 文件生成 在内核中的实现是怎么样的?


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,