BashスクリプトでのOracleバージョンの比較

BashスクリプトでのOracleバージョンの比較

Oracle 11gクライアントが必要なアプリケーションをインストールするためのbashスクリプトを生成しようとしています。

Bashスクリプトからバージョン情報を読み取るには?

sqlplusはPuttyで実行されたときに答えを提供します。ただし、bashスクリプトでsqlplusを使用すると、データベースに接続しようとします。

ベストアンサー1

私はsqlplus user/password@sidこれを64ビットRed Hatサーバーで実行しました。これは標準出力にあります。

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 24 17:27:57 2015

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

これは、自分が属するOracleバージョンsqlplusと実行中の物理データベースのバージョンを提供します。

sqlplusOracleバージョンを入手するには、次のようにします。

sqlplus /NOLOG < /dev/null | grep Release | cut -d' ' -f3

おすすめ記事