Check database status using python
save this file as dbstatus.py
import cx_Oracle
db=cx_Oracle.connect("hr","hr","192.168.43.68/ind")
cursor=db.cursor()
cursor.execute(""" select name,open_mode from v$database """)
for count in cursor:
print(count)
Output:
"C:\Program Files\Python37\python.exe" C:/Users/ANURAG/PycharmProjects/phython_master/conn.py
('IND', 'READ WRITE')
Process finished with exit code 0