Archive for the ‘Oracle11g’ tag
How to Generate AWR Differences Report
生成系统正常期间内和故障期间内的AWR性能数据比较报告,可能可以帮助我们更加简单的定位问题所在。
可以通过awrddrpt.sql脚本生成。
SQL> @?/rdbms/admin/awrddrpt.sql
脚本会要求输入需要比较的第一份和第二份AWR报告的起始结束Snap ID,生成的AWR报告基本上如下图所示。
在普通的AWR报告各个部分都增加了1st, 2nd以及%Diff,这表示第一份时,第二份时各自的情况以及两次的相差百分比。
如果我们因为某些原因(比如权限问题)无法读取awrddrpt.sql,那么也可以通过DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_TEXT函数来完成。
DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_TEXT( dbid1 IN NUMBER, inst_num1 IN NUMBER, bid1 IN NUMBER, eid1 IN NUMBER, dbid2 IN NUMBER, inst_num2 IN NUMBER, bid2 IN NUMBER, eid2 IN NUMBER) RETURN awrdrpt_text_type_table PIPELINED;
dbid通过以下SQL获取。
SQL> SELECT DBID FROM v$database; DBID ---------- 777920305
inst_num通过以下SQL获得。
SQL> SELECT instance_number FROM v$instance; INSTANCE_NUMBER --------------- 1
bid和eid分别是Begin Snap ID和End Snap ID,通过以下SQL获得。
SQL> SELECT snap_id, end_interval_time 2 FROM dba_hist_snapshot 3 WHERE end_interval_time > trunc(sysdate-1) 4 ORDER BY snap_id; SNAP_ID END_INTERVAL_TIME ---------- -------------------------------------------------------------------------------- 377 25-FEB-10 01.10.10.657 PM 378 25-FEB-10 02.00.21.884 PM 379 25-FEB-10 04.49.00.861 PM
将上述获得值全部作为参数值传入AWR_DIFF_REPORT_TEXT函数,执行即可。由于输出结果较长,使用spool打印到文件中方便查看。
SQL>spool awrdiff_1_377_1_378.txt SQL> SELECT * FROM 2 TABLE(DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_TEXT(777920305,1,377,378, 3 777920305,1,378,379)); SQL>spool off
About RAW Devices Not Supported in Oracle 11g release 2
很早之前就有传闻Oracle12g(也许不是g)版本将不再支持裸设备。而这份声明在最新发布的Oracle11gR2中就已经有所体现。以下完全通过阅读文档而得,并非实践经验,各位自行取舍。
Block and Raw Devices Not Supported with OUI
With this release, OUI no longer supports installation of Oracle Clusterware files on
block or raw devices. Install Oracle Clusterware files either on Automatic Storage
Management diskgroups, or in a supported shared file system.
不再支持将文件存储在裸设备上,但是仅仅局限于使用OUI图形界面创建数据库,那么命令行方式应该还是可以的。
For new installations, OCR and voting disk files can be placed either on ASM, or on a
cluster file system or NFS system. Installing Oracle Clusterware files on raw or block
devices is no longer supported, unless an existing system is being upgraded.
Oracle Clusterwae需要的OCR和Voting disk可以存储在ASM或者集群文件系统或者NFS中,对于全新安装,裸设备不再被支持,但是如果是升级而来的话(比如从10g升级到11g),仍然支持。
Voting Disk Backup Procedure Change
In prior releases, backing up the voting disks using a dd command was a required
postinstallation task. With Oracle Clusterware release 11.2 and later, backing up and
restoring a voting disk using the dd command is not supported.
Backing up voting disks manually is no longer required, as voting disks are backed up
automatically in the OCR as part of any configuration change and voting disk data is
automatically restored to any added voting disks.
之前Voting disk因为是存储在裸设备中的,因此备份需要使用dd命令来手动执行,在11gR2中,通过dd备份Voting disk不再被支持,同时,也无需通过任何方法手动备份Voting disk了,备份将自动进行。
Oracle Database 11gR2 Released on Linux
依然是优先发布了再Linux平台上的Oracle Database 11gR2。在OTN上的下载页面可以看到包含了比以前更多的内容,而有些仅仅是称呼发生了变化。
1. Database安装盘变为了2张,之前的版本一直只有1张,11gR1的安装盘容量为1.8G,而11gR2已经超过2G。解压两个zip文件到同一个database目录下,再运行runInstaller进行数据库安装。
2. Client安装盘比以前容量更大了,但是可以认为基本上变化不大。
3. Grid Infrastructure安装盘应该就是之前的Oracle Clusterware安装盘,但是容量明显增加,从之前的300M到现在900M,我自己还没有下载完毕,所以具体增加了哪些内容还不知道,有已经安装了的给些注解吧。在之前需要用dbca创建的ASM实例功能,已经挪动到Grid Infrastructure安装中,也同时包括了Oracle Clusterware以及ASMFS等群集相关软件的安装。
4. Examples安装盘就是以前的Companion,内容也应该就是之前的Oracle Express的那些内容。
5. Gateways安装盘基本上没有变化。
6. De-install Utility安装盘是全新的内容,从字面上看应该卸载安装的一些工具,莫非将Universal Installer做了专门的产品?具体内容等下载完毕再见分晓。
Update@2009-09-28
对于De-install Utility,在Oracle11gR2的Installation Guide中有如下一段介绍。
Deinstallation Tool
Oracle Universal Installer no longer removes Oracle software. Use the new Deinstallation Tool (deinstall) available on the installation media before installation as well as in the Oracle home directory after installation.Run this tool from ORACLE_HOME first. It is located in:
$ORACLE_HOME/deinstall.An error occurs if there are any missing files and the tool prompts you to download the standalone version available in the deinstall directory on the installation media.
实际上在安装完Oracle Software之后,$ORACLE_HOME/deinstall就已经存在了,基本上是一个字符界面的完全删除安装的工具,按照提示运行完deinstall将会删除包括ASM、database instance、software、oraInventory以及oraInst.loc在内的所有内容,基本上是一次非常干净的反安装。
![Chanel [K]](http://www.dbform.com/wp-content/chanelk.png)

