![Bash 스크립트에서 Oracle 버전 비교](https://linux55.com/image/67746/Bash%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%97%90%EC%84%9C%20Oracle%20%EB%B2%84%EC%A0%84%20%EB%B9%84%EA%B5%90.png)
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