awr导出导入分析.docx

上传人:b****8 文档编号:10945129 上传时间:2023-02-23 格式:DOCX 页数:15 大小:17.33KB
下载 相关 举报
awr导出导入分析.docx_第1页
第1页 / 共15页
awr导出导入分析.docx_第2页
第2页 / 共15页
awr导出导入分析.docx_第3页
第3页 / 共15页
awr导出导入分析.docx_第4页
第4页 / 共15页
awr导出导入分析.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

awr导出导入分析.docx

《awr导出导入分析.docx》由会员分享,可在线阅读,更多相关《awr导出导入分析.docx(15页珍藏版)》请在冰豆网上搜索。

awr导出导入分析.docx

awr导出导入分析

awr导出/导入/分析

很多时候我们直接在客户机器上分析awr不太方便,需要通过收集客户awr信息到另一台机器上进行分析数据库性能等.这种情况下,就需要对客户的awr数据进行导出,然后导入到其他机器上,再进行深入分析.

导出awr数据

SQL>@?

/rdbms/admin/awrextr.sql

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

AWREXTRACT

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

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

~ThisscriptwillextracttheAWRdataforarangeofsnapshots~

~intoadumpfile.Thescriptwillpromptusersforthe~

~followinginformation:

~

~

(1)databaseid~

~

(2)snapshotrangetoextract~

~(3)nameofdirectoryobject~

~(4)nameofdumpfile~

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

 

DatabasesinthisWorkloadRepositoryschema

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

DBIdDBNameHost

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

*1393262699XIFENFEIXIFENFEI-PC

3753332923FDJDBora1

3753332923FDJDBora2

Thedefaultdatabaseidisthelocalone:

'1393262699'.Tousethis

databaseid,presstocontinue,otherwiseenteranalternative.

输入dbid的值:

3753332923<--需要输入

Using3753332923forDatabaseID

 

Specifythenumberofdaysofsnapshotstochoosefrom

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

Enteringthenumberofdays(n)willresultinthemostrecent

(n)daysofsnapshotsbeinglisted.Pressingwithout

specifyinganumberlistsallcompletedsnapshots.

 

输入num_days的值:

1<--需要输入

Listingthelastday'sCompletedSnapshots

DBNameSnapIdSnapStarted

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

FDJDB906234月201200:

00

907234月201201:

00

908234月201202:

00

909234月201203:

00

910234月201204:

00

911234月201205:

00

912234月201206:

00

913234月201207:

00

914234月201208:

00

915234月201209:

00

916234月201210:

00

917234月201211:

00

918234月201212:

00

919234月201213:

00

 

SpecifytheBeginandEndSnapshotIds

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

输入begin_snap的值:

906<--需要输入

BeginSnapshotIdspecified:

906

输入end_snap的值:

907<--需要输入

EndSnapshotIdspecified:

907

 

SpecifytheDirectoryName

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

DirectoryNameDirectoryPath

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

DATA_FILE_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\sales_history\

DATA_PUMP_DIRE:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

LOG_FILE_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\log\

MEDIA_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\product_media\

ORACLE_OCM_CONFIG_DIRE:

\oracle\product\11.2.0\dbhome_1\ccr\state

SS_OE_XMLDIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\order_entry\

SUBDIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\order_entry\/2002/Sep

XMLDIRE:

\oracle\product\11.2.0\dbhome_1\rdbms\xml

ChooseaDirectoryNamefromtheabovelist(case-sensitive).

输入directory_name的值:

DATA_PUMP_DIR<--需要输入(注意大小写)

Usingthedumpdirectory:

DATA_PUMP_DIR

SpecifytheNameoftheExtractDumpFile

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

Theprefixforthedefaultdumpfilenameisawrdat_906_907.

Tousethisname,presstocontinue,otherwiseenter

analternative.

输入file_name的值:

xifenfei_awr<--需要输入

Usingthedumpfileprefix:

xifenfei_awr

|

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

|TheAWRextractdumpfilewillbelocated

|inthefollowingdirectory/file:

|E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

|xifenfei_awr.dmp

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

|

|***AWRExtractStarted...

|

|Thisoperationwilltakeafewmoments.The

|progressoftheAWRextractoperationcanbe

|monitoredinthefollowingdirectory/file:

|E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

|xifenfei_awr.log

|可以通过查看E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\xifenfei_awr.log

|监控导出awr数据进度

EndofAWRExtract

导入awr数据

SQL>@E:

\oracle\product\11.2.0\dbhome_1\RDBMS\ADMIN\awrload.sql

~~~~~~~~~~

AWRLOAD

~~~~~~~~~~

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

~ThisscriptwillloadtheAWRdatafromadumpfile.The~

~scriptwillpromptusersforthefollowinginformation:

~

~

(1)nameofdirectoryobject~

~

(2)nameofdumpfile~

~(3)stagingschemanametoloadAWRdatainto~

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

SpecifytheDirectoryName

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

DirectoryNameDirectoryPath

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

DATA_FILE_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\sales_history\

DATA_PUMP_DIRE:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

LOG_FILE_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\log\

MEDIA_DIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\product_media\

ORACLE_OCM_CONFIG_DIRE:

\oracle\product\11.2.0\dbhome_1\ccr\state

SS_OE_XMLDIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\order_entry\

SUBDIRE:

\oracle\product\11.2.0\dbhome_1\demo\schema\order_entry\/2002/Sep

XMLDIRE:

\oracle\product\11.2.0\dbhome_1\rdbms\xml

ChooseaDirectoryNamefromthelistabove(case-sensitive).

输入directory_name的值:

DATA_PUMP_DIR<--需要输入(注意大小写)

Usingthedumpdirectory:

DATA_PUMP_DIR

SpecifytheNameoftheDumpFiletoLoad

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

Pleasespecifytheprefixofthedumpfile(.dmp)toload:

输入file_name的值:

awrdat_751_919<--需要输入(文件后缀名一定要是.dmp)

Loadingfromthefilename:

awrdat_751_919.dmp

StagingSchematoLoadAWRSnapshotData

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

Thenextstepistocreatethestagingschema

wheretheAWRsnapshotdatawillbeloaded.

Afterloadingthedataintothestagingschema,

thedatawillbetransferredintotheAWRtables

intheSYSschema.

 

ThedefaultstagingschemanameisAWR_STAGE.

Tousethisname,presstocontinue,otherwiseenter

analternative.

输入schema_name的值:

XFF_AWR<--需要输入(临时创建用户)

Usingthestagingschemaname:

XFF_AWR

ChoosetheDefaulttablespacefortheXFF_AWRuser

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

ChoosetheXFF_AWRusers'sdefaulttablespace.Thisisthe

tablespaceinwhichtheAWRdatawillbestaged.

TABLESPACE_NAMECONTENTSDEFAULTTABLESPACE

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

EXAMPLEPERMANENT

SYSAUXPERMANENT*

USERSPERMANENT

Pressingwillresultintherecommendeddefault

tablespace(identifiedby*)beingused.

输入default_tablespace的值:

EXAMPLE<--需要输入

UsingtablespaceEXAMPLEasthedefaulttablespacefortheXFF_AWR

 

ChoosetheTemporarytablespacefortheXFF_AWRuser

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

ChoosetheXFF_AWRuser'stemporarytablespace.

TABLESPACE_NAMECONTENTSDEFAULTTEMPTABLESPACE

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

TEMPTEMPORARY*

Pressingwillresultinthedatabase'sdefaulttemporary

tablespace(identifiedby*)beingused.

输入temporary_tablespace的值:

TEMP<--需要输入

UsingtablespaceTEMPasthetemporarytablespaceforXFF_AWR

 

...CreatingXFF_AWRuser(临时用户创建)

|

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

|LoadingtheAWRdatafromthefollowing

|directory/file:

|E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

|awrdat_751_919.dmp

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

|

|***AWRLoadStarted...

|

|Thisoperationwilltakeafewmoments.The

|progressoftheAWRloadoperationcanbe

|monitoredinthefollowingdirectory/file:

|E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\

|awrdat_751_919.log

|

|可以通过查看E:

\oracle\product\11.2.0\dbhome_1\rdbms\log\awrdat_751_919.log

|监控导出awr数据进度

...DroppingXFF_AWRuser(临时用户被删除)

EndofAWRLoad

查看awr报告

SQL>@?

/RDBMS/admin/awrrpti.sql

SpecifytheReportType

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

WouldyoulikeanHTMLreport,oraplaintextreport?

Enter'html'foranHTMLreport,or'text'forplaintext

Defaultsto'html'

输入report_type的值:

html<--需要输入

TypeSpecified:

html

 

InstancesinthisWorkloadRepositoryschema

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

DBIdInstNumDBNameInstanceHost

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

37533329232FDJDBfdjdb2ora2

37533329231FDJDBfdjdb1ora1

*13932626991XIFENFEIxffXIFENFEI-PC

输入dbid的值:

3753332923<--需要输入

Using3753332923fordatabaseId

输入inst_num的值:

1<--需要输入

Using1forinstancenumber

 

Specifythenumberofdaysofsnapshotstochoosefrom

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

Enteringthenumberofdays(n)willresultinthemostrecent

(n)daysofsnapshotsbeinglisted.Pressingwithout

specifyinganumberlistsallcompletedsnapshots.

 

输入num_days的值:

1<--需要输入

Listingthelastday'sCompletedSnapshots

Snap

InstanceDBNameSnapIdSnapStartedLevel

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

fdjdb1FDJDB906234月201200:

001

907234月201201:

001

908234月201202:

001

909234月201203:

001

910234月201204:

001

911234月201205:

001

912234月201206:

001

913234月201207:

001

914234月201208:

001

915234月201209:

001

916234月201210:

001

917234月201211:

001

918234月201212:

001

919234月201213:

001

 

SpecifytheBeginandEndSnapshotIds

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

输入begin_snap的值:

917<--需要输入

BeginSnapshotIdspecified:

917

输入end_snap的值:

918<--需要输入

EndSnapshotIdspecified:

918

 

SpecifytheReportName

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

Thedefaultreportfilenameisawrrpt_1_917_918.html.Tousethisname,

presstocontinue,otherwiseenteranalternative.

输入report_name的值:

xifenfei_awr.html<--需要输入

 

使用execDBMS_SWRF_INTERNAL.UNREGISTER_DATABASE(dbid);清理掉不需要的数据库的awr报告

 

awr导出脚本

begin

/*callPL/SQLroutinetoextractthedata*/

dbms_swrf_internal.awr_extract(dmpfile=>:

dmpfile,

dmpdir=>:

dmpdir,

bid=>:

bid,

eid=>:

eid,

dbid=>:

dbid);

dbms_swrf_internal.clear_awr_dbid;

end;

/

awr导入脚本

begin

/*c

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育 > 中考

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1