當前位置:首頁 » 編程軟體 » 編譯oraclereport

編譯oraclereport

發布時間: 2022-10-01 17:11:05

A. 如何生成Oracle AWR報告

首先進入$ORACLE_HOME/rdbms/admin目錄,在sqlplus下運行@awrrpt腳本,按照提示一步一步就可以達成,導出的格式有兩種,txt格式和html格式。
在OTN上,有一個DBA新feature系列,第六周就是專門講的這個feature,大家可以去那裡了解一下(中文的)
Script started on Sun 27 Jan 2008 08:47:15 PM PST
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ cd $ORACLE_HOME/rdbms/admin
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Proction on Sun Jan 27 20:47:38 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Proction
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> @awrrpt
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
———– ———— ——– ————
2080780909 ORCLDB 1 orcldb1
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 『html』 for an HTML report, or 『text』 for plain text
Defaults to 『html』
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
———— ——– ———— ———— ————
* 2080780909 1 ORCLDB orcldb1 sun880-1
2080780909 4 ORCLDB orcldb4 sun880-4
2080780909 2 ORCLDB orcldb2 sun880-2
2080780909 3 ORCLDB orcldb3 sun880-3
Using 2080780909 for database Id
Using 1 for instance number
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 without
specifying a number lists all completed snapshots.
Enter value for num_days: 1
Listing the last day』s Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
———— ———— ——— —————— —–
orcldb1 ORCLDB 66 27 Jan 2008 00:55 1
67 27 Jan 2008 01:55 1
68 27 Jan 2008 02:55 1
69 27 Jan 2008 03:55 1
70 27 Jan 2008 04:55 1
71 27 Jan 2008 05:55 1
72 27 Jan 2008 06:55 1
73 27 Jan 2008 07:55 1
74 27 Jan 2008 08:55 1
75 27 Jan 2008 09:55 1
76 27 Jan 2008 10:55 1
77 27 Jan 2008 11:55 1
78 27 Jan 2008 12:55 1
83 27 Jan 2008 17:54 1
84 27 Jan 2008 18:55 1
85 27 Jan 2008 19:55 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 70
Begin Snapshot Id specified: 70
Enter value for end_snap: 71
End Snapshot Id specified: 71
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_70_71.txt. To use this name,
press to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name awrrpt_1_70_71.txt
WORKLOAD REPOSITORY report for
DB Name DB Id Instance Inst Num Release RAC Host
———— ———– ———— ——– ———– — ————
ORCLDB 2080780909 orcldb1 1 10.2.0.4.0 YES sun880-1
Snap Id Snap Time Sessions Curs/Sess
——— ——————- ——– ———
Begin Snap: 70 27-Jan-08 04:55:07 136 16.2
End Snap: 71 27-Jan-08 05:55:21 141 16.5
Elapsed: 60.23 (mins)
DB Time: 5,814.07 (mins)
Cache Sizes
~~~~~~~~~~~ Begin End
//此處有刪減
————————————————————-
End of Report
Report written to awrrpt_1_70_71.txt
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Proction
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ exit
script done on Sun 27 Jan 2008 08:48:16 PM PST

B. 如何生成Oracle AWR報告

1、運行,cmd。然後進入到 oracle的安裝目錄,這里以我的電腦為例: E:\app\Administrator\proct\11.2.0\dbhome_1\
2、再進入到下面的目錄 RDBMS\ADMIN。確保E:\app\Administrator\proct\11.2.0\dbhome_1\RDBMS\ADMIN 下面有 awrrpt.sql這個文件
3、輸入 sqlplus ,然後以管理員身份登錄。
4、輸入命名:@awrrpt
5、開始按提示操作,首先是選擇要生成的awr報告的類型,可以選擇text或html類型。這里我們以 html類型為例。輸入 html,回畫
6、選擇要生成的報告的日期是在多少天以前記錄,輸入1,則表示要生成今天0點開始到現在之內的某個時間段的報告,輸入2,則表示滿意生成昨天0點開始到現在的某個時間段的報告。以此類推。預設記錄最近7天,這里輸入法為示例。
7、輸入天數後,界面會輸出一個時間段的表格,每個時間點都對應一個snapId,間隔時間為oracle默認是1個小時,接下來,輸入要生成報告的時間開始點應的snap id,這里我輸入3318, 然後再輸入結束點對應的snap id,這里輸入 3320.
8、接著要求輸入生成報告的名字,系統會自動生成一個輸入的名字並會提示信息中顯示出來。如果使用輸入名稱。則不用輸入任何內容。直接回畫即可。到此。系統就會自動生成一張awr的報告。

C. 如何從Oracle的FORM中調用REPORT

在菜單中調用REPORT程序(不傳參數,傳參數可用下面的程序段)Run_Proct(REPORTS, 』報表程序名.REP』, SYNCHRONOUS, RUNTIME, FILESYSTEM, 』』, NULL);在FORM中調用REPORT程序(可傳參數)DECLARE pl_id ParamList;BEGIN pl_id := Get_Parameter_List(』參數列表名』); IF NOT Id_Null(pl_id) THEN Destroy_Parameter_List( pl_id ); END IF; pl_id := Create_Parameter_List(』參數列表名』); Add_Parameter(pl_id,』REPORT參數名1』,DATA_PARAMETER,』:FORM項名1』); Add_Parameter(pl_id,』REPORT參數名2』,TEXT_PARAMETER,』:FORM項名2』); …… Run_Proct(REPORTS, 』報表程序名.REP』, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);END;在報表中使用參數作為幫定變數時在其前面加一個冒號(:),如:有一個參數p_deptno,傳來的值為10,則select * form emp where deptno=:p_deptno將返回表emp中deptno為10的記錄。在報表中使用參數作為詞彙參數時在起前面加一個「與」符號(&),如:有一個參數p_where,傳來的值為where deptno=10,則select * from emp &p_where也將返回表emp中deptno為10的記錄。在調用REPORT時,去掉report server:Add_parameter(pl_id,』ORACLE_SHUTDOWN』,TEXT_PARAMETER,』YES』);調用REPORT時,使報表結果直接輸出到列印機上:Add_parameter(pl_id,』PSRAMETER_FORM』,TEXT_PARAMETER,』NO』);調用REPORT時,不彈出參數窗口:add_parameter(pl_id,』PARAMFORM』,TEXT_PARAMETER,』NO』); 調用REPORT時,以滿屏方式顯示:add_parameter(pl_id, 』maximize』, TEXT_PARAMETER,』yes』);

D. ORACLE 過程編譯錯誤,高手來解答!

憑感覺,你的語法沒錯。今天連不起公司伺服器。周一連上給你試試,等著。。

我們創建的時候,用的是create or replace package。我將你包的內容改變了(因為我沒有創建你的那個數據表emp),運行成功了的。內容如下:

create or replace package xxemp_pkg is

procere update_sal(name varchar2,newsal number);

function annual_income(name varchar2) return number;

end;
/
create or replace package body xxemp_pkg is
procere update_sal(name varchar2,newsal number)
is
begin
/*update emp set sal=newsal
where lower(ename)=lower(name);*/null;
end;
function annual_income(name varchar2) return number
is
annual_salary number(7,2);
begin
/*select sal*12+nvl(comm,0) into annual_salary
from emp where lower(ename)=lower(name);*/null;
return annual_salary;
end;
end;
/
你再到你的系統試一試。

E. oracle中自定義的函數怎麼編譯

可在第三方軟體中,如pl/sql中編譯。

1、打開pl/sql軟體並登錄到指定資料庫

2、點擊左上方像紙片的按鈕,然後點擊「sql窗口」

F. 如何生成Oracle AWR報告

Oracle性能分析入門學習中,遇到Oracle資料庫的性能問題,一般首要的步驟就是導出AWR的分析報告,AWR是10g中新引入的一個工具,在這之前一般是利用statspack。要導出AWR報告,只要利用Oracle的一個腳本即可以完成,下面是我利用script錄制的一段導出AWR report的過程。
首先進入$ORACLE_HOME/rdbms/admin目錄,在sqlplus下運行@awrrpt腳本,按照提示一步一步就可以達成,導出的格式有兩種,txt格式和html格式。
在OTN上,有一個DBA新feature系列,第六周就是專門講的這個feature,大家可以去那裡了解一下(中文的)
Script started on Sun 27 Jan 2008 08:47:15 PM PST
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ cd $ORACLE_HOME/rdbms/admin
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Proction on Sun Jan 27 20:47:38 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Proction
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> @awrrpt
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
———– ———— ——– ————
2080780909 ORCLDB 1 orcldb1
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 『html』 for an HTML report, or 『text』 for plain text
Defaults to 『html』
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
———— ——– ———— ———— ————
* 2080780909 1 ORCLDB orcldb1 sun880-1
2080780909 4 ORCLDB orcldb4 sun880-4
2080780909 2 ORCLDB orcldb2 sun880-2
2080780909 3 ORCLDB orcldb3 sun880-3
Using 2080780909 for database Id
Using 1 for instance number
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 without
specifying a number lists all completed snapshots.
Enter value for num_days: 1
Listing the last day』s Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
———— ———— ——— —————— —–
orcldb1 ORCLDB 66 27 Jan 2008 00:55 1
67 27 Jan 2008 01:55 1
68 27 Jan 2008 02:55 1
69 27 Jan 2008 03:55 1
70 27 Jan 2008 04:55 1
71 27 Jan 2008 05:55 1
72 27 Jan 2008 06:55 1
73 27 Jan 2008 07:55 1
74 27 Jan 2008 08:55 1
75 27 Jan 2008 09:55 1
76 27 Jan 2008 10:55 1
77 27 Jan 2008 11:55 1
78 27 Jan 2008 12:55 1
83 27 Jan 2008 17:54 1
84 27 Jan 2008 18:55 1
85 27 Jan 2008 19:55 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 70
Begin Snapshot Id specified: 70
Enter value for end_snap: 71
End Snapshot Id specified: 71
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_70_71.txt. To use this name,
press to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name awrrpt_1_70_71.txt
WORKLOAD REPOSITORY report for
DB Name DB Id Instance Inst Num Release RAC Host
———— ———– ———— ——– ———– — ————
ORCLDB 2080780909 orcldb1 1 10.2.0.4.0 YES sun880-1
Snap Id Snap Time Sessions Curs/Sess
——— ——————- ——– ———
Begin Snap: 70 27-Jan-08 04:55:07 136 16.2
End Snap: 71 27-Jan-08 05:55:21 141 16.5
Elapsed: 60.23 (mins)
DB Time: 5,814.07 (mins)
Cache Sizes
~~~~~~~~~~~ Begin End
//此處有刪減
————————————————————-
End of Report
Report written to awrrpt_1_70_71.txt
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Proction
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ exit
script done on Sun 27 Jan 2008 08:48:16 PM PST

G. 大家幫看看ORACLE REPORT里的SQL語句問題

to_char(MO_LINES.MOL_MM_WIDTH,'0.9') MO_LINES.MOL_MM_WIDTH1,
to_char(MO_LINES.MOL_MM_LENGTH,'0.9') MO_LINES.MOL_MM_LENGTH1,

語法錯了,別名不能這么寫,MO_LINES 是table name,如果MO_LINES.MOL_MM_LENGTH1這樣寫會被解析成MO_LINES 的column,自然就報錯,看看你的錯誤message就知道.

H. 在oracle report bulider開發中,pl/sql語句中出現了view該怎麼辦

給一個全能編譯 無效資料庫對象的腳本。

只要一運行什麼都有了。。。

select decode(OBJECT_TYPE,
'PACKAGE BODY',
'alter package ' || OWNER || '.' || OBJECT_NAME ||
' compile body;',
'alter ' || OBJECT_TYPE || ' ' || OWNER || '.' || OBJECT_NAME ||
' compile;')
from dba_objects A
where STATUS = 'INVALID'
and OBJECT_TYPE in ('PACKAGE BODY', 'PACKAGE', 'FUNCTION', 'PROCEDURE',
'TRIGGER', 'VIEW')
order by OBJECT_TYPE, OBJECT_NAME;

I. oracle report6i怎樣製作這樣的報表

製表的時候有專門的格式化命令
TTITLE(頂標題) BTITLE(底標題) BREAK(設置斷開點)
你說的效果可以通過BREAK實現 格式如下:

BREAKE ON 列名 SKIP N
列名你可以輸入第一列的列名,N表示隔幾行空一格
把BREAK 語句寫在你的SELECT語句之前。

NO. Name sal
12 張三 45666
14 李四 3646

45 王五 31333
65 趙六 3133

56 劉思 323

不想要這樣的效果的話,就刪除斷點。
CLEAR BREAK

J. 如何生成Oracle AWR報告

oracle手工生成AWR報告方法記錄
AWR(Automatic Workload Repository)報告是DBA進行日常資料庫性能評定、問題SQL發現的重要手段。熟練掌握AWR報告,是做好開發、運維DBA工作的重要基本功。
1、 運行腳本

首先,准備一個目錄作為AWR生成報告的路徑。

[oracle@bspdev /]$ ls -l | grep test
drwxr-xr-x. 2 oracle oinstall 4096 Jun 21 13:01 test

[oracle@bspdev /]$ cd test

啟動sqlplus等開發工具,調用生成腳本。程序腳本一般保存在$ORACLE_HOME下的rdbms/admin中,名稱為awrrpt.sql。

[oracle@bspdev test]$ sqlplus /nolog

SQL*Plus: Release11.2.0.1.0 Proction on Tue Jun 21 13:04:44 2011

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn / as sysdba
Connected.

--調用腳本,生成文件
SQL> @?/rdbms/admin/awrrpt.sql

之後進入報告參數輸入模塊。

2、輸入報告參數

之後,要持續輸入一系列的報告參數。

ü 輸入生成報告類型,目前AWR提供txt和html兩種格式。需要確認生成格式,默認是html格式。

Current Instance
~~~~~~~~~~~~~~~~

DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
4143510747 ORA11G 1 ora11g

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'

ü 報告涉及天數范圍

啟動報告後,會顯示生成實例的名稱等基本信息。

默認情況下,AWR會將鏡像信息保留一個月。手工生成的時候,需要確認生成AWR報告的時間范圍。一般情況下,特別是生產環境下,我們通常設置1-7天也就夠用了。

Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 4143510747 1 ORA11G ora11g bspdev.local
domain

Using 4143510747 for database Id
Using 1 for instance number

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 without
specifying a number lists all completed snapshots.

Enter value for num_days:3

ü 輸入開始和結束的snapshot編號

輸入天數信息後,AWR生成代碼會將天數范圍內的snapshot鏡像點列出,供輸入選擇。

Listing the last 3 days of Completed Snapshots

Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
ora11g ORA11G 1789 20 Jun 2011 13:01 1
1790 20 Jun 2011 14:00 1
1791 20 Jun 2011 15:00 1
1792 20 Jun 2011 16:00 1
(篇幅原因,有省略……)
1811 21 Jun 2011 11:00 1
1812 21 Jun 2011 12:00 1
1813 21 Jun 2011 13:00 1

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

之後,我們需要根據列出的時間范圍,輸入開始和結束的snap編號。

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap:1796
Begin Snapshot Id specified: 1796

Enter value for end_snap:1813

ü 確定報告名稱

最後就是確定生成報告的名稱。一般採用默認的名稱就可以了。

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_1796_1813.html. To use this name,
press to continue, otherwise enter an alternative.

Enter value for report_name:

之後輸出內容很多,此處不加以累述。最後提示報告生成成功。

Report written to awrrpt_1_1796_1813.html

於是,指定目錄上可以看到相應的報告文件。

[oracle@bspdev test]$ ls -l
total 508
-rw-r--r--. 1 oracle oinstall 515262 Jun 21 13:10 awrrpt_1_1796_1813.html

熱點內容
美嘉演算法口訣 發布:2025-05-16 06:03:15 瀏覽:951
c程序編譯連接 發布:2025-05-16 06:02:36 瀏覽:963
腳本魔獸 發布:2025-05-16 06:01:52 瀏覽:329
文件夾python 發布:2025-05-16 06:01:43 瀏覽:626
電腦我的世界伺服器游戲幣 發布:2025-05-16 05:27:25 瀏覽:487
索尼手機為什麼不能用安卓10 發布:2025-05-16 05:18:46 瀏覽:784
蔚來es6選擇哪些配置實用 發布:2025-05-16 05:18:05 瀏覽:130
小米如何掃碼wifi密碼 發布:2025-05-16 05:13:38 瀏覽:807
樓層密碼是什麼意思 發布:2025-05-16 05:13:37 瀏覽:13
創建文件夾失敗 發布:2025-05-16 05:12:59 瀏覽:396