
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
と実行中の物理データベースのバージョンを提供します。
sqlplus
Oracleバージョンを入手するには、次のようにします。
sqlplus /NOLOG < /dev/null | grep Release | cut -d' ' -f3