Oracle常用工具使用-ORAchk

ORAchk 之前被称为RACcheck,后来它的用途进行了扩展,改名为了ORAchk,它是在数据库系统进行健康检查的一个专用工具,这个工具主要用来检查软件的配置是否符合要求以及一些最佳实践是否被应用了 。通过这个工具,用户可以很方便地、自动化地对自己的系统进行健康检查和评估 。
ORAchk 能够检查的软件主要有:OS、Oracle Clusterware (CRS)、 Grid Infrastructure environment(GI)、Automatic Storage Management (ASM)以及Real Application Clusters (RAC)、单实例数据库、Golden Gate 。ORAchk更多信息可参考MOS文档1268927.2
Oracle ORAchk支持的平台
以下平台支持Oracle ORAchk:

  • Intel linux* (Oracle Linux/RedHat 4, 5, 6, 7 and SuSE 9, 10, 11, 12)
  • Linux on System Z (RedHat 6, 7 and SuSE 12)
  • Oracle Solaris SPARC (Solaris 9, 10, and 11)
  • Oracle Solaris x86-64 (Solaris 9, 10, and 11)
  • AIX
  • HPUX
  • Microsoft windows (2008 and 2012)
*不支持Linux Itanium
*在32位EBS环境中仅支持32位平台使用命令./orachk -ebs32bit
1.1. 安装1. ORAchk1.1.1. 单实例安装ORAchk[root@host1 /]# mkdir /orachk[root@host1 /]# cd /orachk/[root@host1 orachk]# unzip orachk.zip[root@host1 /]# chown -R oracle:oinstall /orachk[root@host1 orachk]# chmod 755 orachk1.1.2. RAC安装ORAchk[root@rac2 ~]# mkdir /orachk[root@rac2 ~]# cd /orachk/[root@rac2 orachk]# unzip orachk.zip[root@rac2 orachk]# chmod 755 orachk1.2. 卸载Oracle ORAchk1)停止所有活动的Oracle ORAchk daemon客户端
[root@rac2 orachk]# ./orachk -d stop_client2)停止任何正在运行的Oracle ORAchk daemon
[root@rac2 orachk]# ./orachk -d stop3)从自动重新启动配置中删除Oracle ORAchk daemon
[root@rac2 orachk]# ./orachk -initrmsetup4)删除Oracle ORAchk安装目录
[root@rac2 orachk]# rm -rf /orachk/1.3. 升级ORAchk每个数据库PSU都包含创建时可用的最新Oracle ORAchk版本 。应用数据库PSU时,包含的ORAchk将在$ORACLE_HOME/suptools中暂存 。
在下次运行时,如果PSU复制的版本比安装的版本新,则Oracle ORAchk会提示进行升级 。
1.3.1. 单实例升级ORAchkMOS文档1268927.2下载最新的ORAchk
1)升级前检查
[oracle@host1 orachk]$ pwd/u01/app/oracle/product/18.1.0/dbhome_1/suptools/orachk[oracle@host1 orachk]$./orachk -u -o pre2)查看当前版本
[oracle@host1 orachk]$ ./orachk -vORACHK VERSION: 12.2.0.1.4_201711273)升级
将环境变量RAT_UPGRADE_LOC设置下载的ORAchk压缩包存放的目录 。
[oracle@host1 orachk]$ export RAT_UPGRADE_LOC=/orachk/[oracle@host1 orachk]$ ./orachkRunning orachk----------------------------------------------------------PATH : /u01/app/oracle/product/18.1.0/dbhome_1/suptools/orachkVERSION : 12.2.0.1.4_20171127COLLECTIONS DATA LOCATION : /u01/app/oracle/orachk/----------------------------------------------------------This version of orachk was released on 27-Nov-2017 and its older than 120 daysLatest version of orachk 12.2.0.1.4_20180518 is available at /orachk//.Do you want to upgrade to the latest version of orachk? [y/n][y] yNOTE: Please ignore "No such file or directory" errors for the file/directory orachk.py,build,cwallet.sso, wallet.pm,lib. This is due to the change in directory structure between the versions 12.2.0.1.3 and 12.2.0.1.4Running latest version...Running orachk----------------------------------------------------------PATH : /u01/app/oracle/product/18.1.0/dbhome_1/suptools/orachkVERSION : 18.2.0_20180518COLLECTIONS DATA LOCATION : /u01/app/oracle/orachk/----------------------------------------------------------[oracle@host1 orachk]$ ./orachk -vORACHK VERSION: 18.2.0_20180518如果已设置RAT_UPGRADE_LOC但不想升级,则仍可以使用-noupgrade选项运行Oracle ORAchk:
[oracle@host1 orachk]$./orachk –noupgrade4)升级后检查
[oracle@host1 orachk]$./orachk -u -o post注意:
如果在RAT_UPGRADE_LOC中具有最新版本并且还不想升级,请使用-ngradegrade选项 。
在RAT_UPGRADE_LOC中使用-noupgrade而没有最新版本仍会提示您下载最新版本 。
1.3.2. RAC升级ORAchkMOS文档1268927.2下载最新的ORAchk
1)升级前检查
[grid@rac2 orachk]$ pwd/u01/app/18.1.0/grid/suptools/orachk[grid@rac2 orachk]$ ./orachk -u -o pre2)查看当前版本
[grid@rac2 orachk]$ ./orachk -vORACHK VERSION: 12.1.0.2.7_201605263)升级
将环境变量RAT_UPGRADE_LOC设置下载的ORAchk压缩包存放的目录 。
[grid@rac2 orachk]$ export RAT_UPGRADE_LOC=/orachk/[grid@rac2 orachk]$ ./orachkRunning orachk----------------------------------------------------------PATH : /u01/app/18.1.0/grid/suptools/orachkVERSION : 12.2.0.1.4_20171127COLLECTIONS DATA LOCATION : /u01/app/grid/orachk/----------------------------------------------------------This version of orachk was released on 27-Nov-2017 and its older than 120 daysLatest version of orachk 12.2.0.1.4_20180518 is available at /orachk//.Do you want to upgrade to the latest version of orachk? [y/n][y] yNOTE: Please ignore "No such file or directory" errors for the file/directory orachk.py,build,cwallet.sso, wallet.pm,lib. This is due to the change in directory structure between the versions 12.2.0.1.3 and 12.2.0.1.4Running latest version...Running orachk----------------------------------------------------------PATH : /u01/app/18.1.0/grid/suptools/orachkVERSION : 18.2.0_20180518COLLECTIONS DATA LOCATION : /u01/app/grid/orachk/----------------------------------------------------------[grid@rac2 orachk]$ ./orachk -vORACHK VERSION: 18.2.0_20180518


推荐阅读