工作中遇到ORACLE数据库服务器故障,服务不能启动,需要重新部署ORACLE,但是不清楚数据库的版本,不能通过命令行查询,可以通过告警日志文件查看信息,找到数据库的版本号。
告警日志文件路径可根据自身情况查询。
一般在app/oracle/diag/rdbms/orcl/orcl/trace下
app/oracle/diag/rdbms/<db_name>/<oracle_sid>/trace
alert_<oracle_sid>.log
参考资料:
How to know the version without connecting to the database
There may be situations where we cannot connect to the database, for example after a server failure that does not allow the database to be started. In such scenarios, if we do have access to the database server we can read the alert log file. This file contains information about important events and issues, including startup or shutdown requests. After each startup request you will see some lines like this.
Starting ORACLE instance (normal) (OS id: 15192)
2021-10-08T20:32:04.838992-03:00
All SGA segments were allocated at startup
Using an SGA granule size of 16MB
...
...
NOTE: initializing MDS service with 1 containers
**Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production**
**Version 21.3.0.0.0.**
Windows NT Version V10.0 OS Build 19043
ORACLE\_HOME = C:\Oracle\product\21c\dbhomeXE
参考连接:How to Find Your Oracle Database Version Number | Beekeeper Studio