问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

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

发布网友 发布时间:2023-08-07 09:59

我来回答

1个回答

热心网友 时间:2023-08-08 08:09


AWR的mp文件导出 1.在导出数据之前,一般需要创建以下路径: DATA_PUMP_DIR EXP IMP DATA_FILE_DIR 23:54:29 sys@felix SQ



AWR的mp文件导出
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 mp 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 mp 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.Pressingwithout

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/proct/11.2.0/db_1/demo/schema/s

ales_history/

DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpmp/

DATE_DIR/u01/dir

EXP/u01/exp

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

og/

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

roct_media/

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

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

rder_entry/

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

rder_entry//2002/Sep

XMLDIR/u01/app/oracle/proct/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 mp directory:DATE_DIR

Specify the Name of theExtract Dump File

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

The prefix for the defaultmp 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 mp file prefix:AWREXPIMP

|

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

|The AWR extract mp 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的mp文件的导入:
1.导入之前需要创建DIREXTORY,将要导入的文件存放到此路径的操作系统目录下:

Create directory data_dir as'/u01/dir';

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

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

~~~~~~~~~~

AWR LOAD

~~~~~~~~~~

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

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

~script will prompt users for the followinginformation:~

~(1) name of directory object~

~(2) name of mp file~

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

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

Specify the Directory Name

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

Directory NameDirectory Path

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

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

ales_history/

DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpmp/

DATE_DIR/u01/dir

EXP/u01/exp

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

og/

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

roct_media/

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

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

rder_entry/

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

rder_entry//2002/Sep

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

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

Enter value fordirectory_name: DATE_DIR

Using the mp directory:DATE_DIR

Specify the Name of the DumpFile to Load

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

Please specify the prefix ofthe mp 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

Pressingwillresult 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

*

Pressingwillresult 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的mp文件:

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

User created.

23:52:41 sys@felixSQL>
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
请问我的网络一天了找个部门到现在没有解决请问我上哪投诉? 计算机具备哪几种功能? 计算机有哪些功能是什么 歌词中有丑姑娘的歌曲 驾照不年审会怎样 没开过车驾照年审会通过吗 本来白色的背心放入洗衣机清洗后就变成有黑色斑点 其他一起洗的衣物... ...衣服颜色保持鲜艳(主要是白色衣服洗几次感觉就有点颜色不亮丽了... 为什么登陆lol会叫你解绑 小姨子告诉我说,炒菜时记住这4个小技巧,就是比别人做的好吃 能治好强直性脊柱炎吗或控制病情发展【强直性脊柱炎】 陈芷琰的手机号是多少 陈止琰为什么这么瘦 急!国行 三星 s7 edge SM-G9350, 可以在美国使用4G网络吗?运营商为:Verizon 国行三星s7edge(g9350)能用韩国卡么 卡姿兰气垫cc霜怎么用法用量多少钱? 6月30日什么考试 在学校附近过夜会被查到不在学校吗 笔直陡峭换成另一个词语 行容山很笔直的成语 什么是股票交易过户费? 汉代蘷龙玉璧去那里拍卖? 石家庄五十三中怎么样 我家住三楼,我想把电动汽车充电桩安装在阳台上,不知道充电插头线够不够长,如不够长,能否从中间接线加 12368短信通知消失了什么原因? 武夷水仙茶的特点 歌莉娅和热风的店里放的都是什么音乐?叫什么名字? 民事诉讼抗诉的时效期是多长时间 富贵真的是天注定吗?为何伟人的诞生,总伴随着某种天象的发生? 一粒苹果 未来半年整体运势签诗 一粒苹果 未来半年整体运势签诗: 富贵总是天注定,五谷丰登胜上年 在闲鱼上看到上海公转私的车特别便宜,说是有15年强制报废,请问能买吗,有没有什么套路? 广东技术师范学院全国排名 解释下列词语: (1)滂沱: (2)狂飙: (3)层峦叠翠: (4)惊涛骇浪: 听听那冷雨中有大量的叠音词请仔细体味其表达作用 jsp中使用easyui combobox时,为什么选择项前后会有好长的空格 easyUI combobox json时候 数据过不来[{"id":00,"text":"北京"},{"id":01,"text":"上海"}] 下了火车可以在候车室待着吗 长沙火车站下车后可以直接去候车室吗 给老板开车罚款谁承担 求助:学习现西第四册第十课遇到的问题。。 急求《现代西班牙语》第三册课文翻译 采访英语老师该问什么问题 日照24小时开放的地方 我想问问日照有哪些好玩的地方 给我一些2战电影 有关于北非 沙漠的 在线= 求速回答 好云香护采芹人是谁写的? 室外有人打喷嚏能飞到房间吗 当咳嗽或打喷嚏时,会把口腔内的液滴喷出2米以外,如果在感冒时对着别人咳嗽批喷嚏,会对他人带来什么危 距离我两米的人打喷嚏会不会打到我这里? 打喷嚏会被传染么? 清河中学的淮中班和淮中的普通班相比哪个更好