Skip to content

Instantly share code, notes, and snippets.

@na0AaooQ
Created January 24, 2015 11:12
Show Gist options
  • Save na0AaooQ/5ca02aa1a747366dcc6d to your computer and use it in GitHub Desktop.
Save na0AaooQ/5ca02aa1a747366dcc6d to your computer and use it in GitHub Desktop.
Oracle 11g Oracle適用パッチ一覧の表示コマンド(OPatch) ref: http://qiita.com/na0AaooQ/items/1a55de65ce445af085b5
/oracle_example_production/opt/oracle/Opatch_11.1.0.6.9/OPatch/opatch
[oracle@example-oracle-11g-active ~]$ vi show_oracle_patch.sh
[oracle@example-oracle-11g-active ~]$ chmod 754 show_oracle_patch.sh
[oracle@example-oracle-11g-active ~]$ ./show_oracle_patch.sh
Invoking OPatch 11.1.0.6.9
Oracle Interim Patch Installerバージョン11.1.0.6.9
Copyright (c) 2009, Oracle Corporation. All rights reserved。
Oracleホーム : /oracle_example_production/opt/oracle/app/oracle/product/11.1.0/db_1
中央インベントリ : /oracle_example_production/opt/oracle/app/oraInventory
元 : /etc/oraInst.loc
OPatchのバージョン : 11.1.0.6.9
OUIのバージョン : 11.1.0.X.X
OUIの場所 : /oracle_example_production/opt/oracle/app/oracle/product/11.1.0/db_1/oui
ログ・ファイルの場所 : /oracle_example_production/opt/oracle/app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/opatch2015-01-XX_XX-XX-XXXX.log
Patch history file: /oracle_example_production/opt/oracle/app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle_example_production/opt/oracle/app/oracle/product/11.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-01-XX_XX-XX-XXXX.txt
--------------------------------------------------------------------------------
インストールされた最上位製品(2):
Oracle Database 11g 11.1.0.X.X
Oracle Database 11g Patch Set 1 11.1.0.X.X
  (途中省略)
仮パッチ(2) :
Patch 920XXXX : applied on XXX XXX XX XX:XX:XX JST 2010
Unique Patch ID: 120XXXXX
Created on 7 Jan 2010, XX:XX:XX hrs PST8PDT
Bugs fixed:
737XXXX, 834XXXX, 685XXXX, 720XXXX, 749XXXX, 897XXXX, 733XXXX, 825XXXX
  (途中省略)
OPatch succeeded.
/oracle_example_production/opt/oracle/Opatch_11.1.0.6.9/OPatch/opatch lsinventory -detail | grep applied | awk '{print }' | sort
727XXXX
920XXXX
/oracle_example_production/opt/oracle/Opatch_11.1.0.6.9/OPatch/opatch lsinventory -detail | grep applied | awk '{print }' | sort | wc -l
2
[oracle@example-oracle-11g-active ~]$
#!/bin/sh
OPATCH_COMMAND="/oracle_example_production/opt/oracle/Opatch_11.1.0.6.9/OPatch/opatch"
if [ -f ${OPATCH_COMMAND} ] ; then
${OPATCH_COMMAND} lsinventory -detail
echo ""
echo "${OPATCH_COMMAND} lsinventory -detail | grep applied | awk '{print $2}' | sort"
${OPATCH_COMMAND} lsinventory -detail | grep applied | awk '{print $2}' | sort
echo ""
echo "${OPATCH_COMMAND} lsinventory -detail | grep applied | awk '{print $2}' | sort | wc -l"
${OPATCH_COMMAND} -detail | grep applied | awk '{print $2}' | sort | wc -l
else
echo "${OPATCH_COMMAND} not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment