Check DB2 Status on Linux
In a Linux system, you can use the following command to check if db2 is running:
- Run the command “db2 list database directory” to view the database directory. If the database information is displayed, it means that db2 has been started.
- Run the command “db2 get dbm cfg” to view the configuration information of the database manager. If there is a line in the output that says “Database Manager Status” and its value is “Active,” then it means that db2 has been started.
- Running the command “db2 list active databases” to view the current list of active databases. If the database information is displayed, it means that db2 has been started.
- Run the command ‘ps -ef | grep db2sysc’ to check if the db2 system service process is running. If you are able to find the relevant process, it means that db2 has been started.
You can quickly check if DB2 is up and running using the above methods and also gather some basic information about DB2.