搜尋
首頁資料庫mysql教程DUMP的AWR报告如何导入到Oracle详解

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

AWRdump文件导出

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.

 

---这里输出的是本oracledbid

 

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

 

 

AWRdump文件的导入:

 

 

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数据库中不存在的,不然会异常退出:

 

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

导出AWRdump文件:

 

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 ~]$

linux

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
MySQL的位置:數據庫和編程MySQL的位置:數據庫和編程Apr 13, 2025 am 12:18 AM

MySQL在數據庫和編程中的地位非常重要,它是一個開源的關係型數據庫管理系統,廣泛應用於各種應用場景。 1)MySQL提供高效的數據存儲、組織和檢索功能,支持Web、移動和企業級系統。 2)它使用客戶端-服務器架構,支持多種存儲引擎和索引優化。 3)基本用法包括創建表和插入數據,高級用法涉及多表JOIN和復雜查詢。 4)常見問題如SQL語法錯誤和性能問題可以通過EXPLAIN命令和慢查詢日誌調試。 5)性能優化方法包括合理使用索引、優化查詢和使用緩存,最佳實踐包括使用事務和PreparedStatemen

MySQL:從小型企業到大型企業MySQL:從小型企業到大型企業Apr 13, 2025 am 12:17 AM

MySQL適合小型和大型企業。 1)小型企業可使用MySQL進行基本數據管理,如存儲客戶信息。 2)大型企業可利用MySQL處理海量數據和復雜業務邏輯,優化查詢性能和事務處理。

幻影是什麼讀取的,InnoDB如何阻止它們(下一個鍵鎖定)?幻影是什麼讀取的,InnoDB如何阻止它們(下一個鍵鎖定)?Apr 13, 2025 am 12:16 AM

InnoDB通過Next-KeyLocking機制有效防止幻讀。 1)Next-KeyLocking結合行鎖和間隙鎖,鎖定記錄及其間隙,防止新記錄插入。 2)在實際應用中,通過優化查詢和調整隔離級別,可以減少鎖競爭,提高並發性能。

mysql:不是編程語言,而是...mysql:不是編程語言,而是...Apr 13, 2025 am 12:03 AM

MySQL不是一門編程語言,但其查詢語言SQL具備編程語言的特性:1.SQL支持條件判斷、循環和變量操作;2.通過存儲過程、觸發器和函數,用戶可以在數據庫中執行複雜邏輯操作。

MySQL:世界上最受歡迎的數據庫的簡介MySQL:世界上最受歡迎的數據庫的簡介Apr 12, 2025 am 12:18 AM

MySQL是一種開源的關係型數據庫管理系統,主要用於快速、可靠地存儲和檢索數據。其工作原理包括客戶端請求、查詢解析、執行查詢和返回結果。使用示例包括創建表、插入和查詢數據,以及高級功能如JOIN操作。常見錯誤涉及SQL語法、數據類型和權限問題,優化建議包括使用索引、優化查詢和分錶分區。

MySQL的重要性:數據存儲和管理MySQL的重要性:數據存儲和管理Apr 12, 2025 am 12:18 AM

MySQL是一個開源的關係型數據庫管理系統,適用於數據存儲、管理、查詢和安全。 1.它支持多種操作系統,廣泛應用於Web應用等領域。 2.通過客戶端-服務器架構和不同存儲引擎,MySQL高效處理數據。 3.基本用法包括創建數據庫和表,插入、查詢和更新數據。 4.高級用法涉及復雜查詢和存儲過程。 5.常見錯誤可通過EXPLAIN語句調試。 6.性能優化包括合理使用索引和優化查詢語句。

為什麼要使用mysql?利益和優勢為什麼要使用mysql?利益和優勢Apr 12, 2025 am 12:17 AM

選擇MySQL的原因是其性能、可靠性、易用性和社區支持。 1.MySQL提供高效的數據存儲和檢索功能,支持多種數據類型和高級查詢操作。 2.採用客戶端-服務器架構和多種存儲引擎,支持事務和查詢優化。 3.易於使用,支持多種操作系統和編程語言。 4.擁有強大的社區支持,提供豐富的資源和解決方案。

描述InnoDB鎖定機制(共享鎖,獨家鎖,意向鎖,記錄鎖,間隙鎖,下一鍵鎖)。描述InnoDB鎖定機制(共享鎖,獨家鎖,意向鎖,記錄鎖,間隙鎖,下一鍵鎖)。Apr 12, 2025 am 12:16 AM

InnoDB的鎖機制包括共享鎖、排他鎖、意向鎖、記錄鎖、間隙鎖和下一個鍵鎖。 1.共享鎖允許事務讀取數據而不阻止其他事務讀取。 2.排他鎖阻止其他事務讀取和修改數據。 3.意向鎖優化鎖效率。 4.記錄鎖鎖定索引記錄。 5.間隙鎖鎖定索引記錄間隙。 6.下一個鍵鎖是記錄鎖和間隙鎖的組合,確保數據一致性。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Atom編輯器mac版下載

Atom編輯器mac版下載

最受歡迎的的開源編輯器

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )專業的PHP整合開發工具

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

mPDF

mPDF

mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),