The Oracle view **V$INSTANCE**
provides information about the running Oracle database instance — such as instance name, host, version, status, startup time, etc.
✅ MySQL Equivalent of V$INSTANCE
There is no single view in MySQL that maps 1:1 to V$INSTANCE
, but you can gather the equivalent details using the following queries:
Oracle V$INSTANCE Column | MySQL Equivalent / Query | Description |
---|---|---|
INSTANCE_NAME | SELECT @@hostname; | Hostname of the server |
HOST_NAME | SELECT @@hostname; | Same as above |
VERSION | SELECT @@version; | MySQL server version |
STARTUP_TIME | SHOW GLOBAL STATUS LIKE 'Uptime'; | Seconds since server startup |
STATUS | SHOW GLOBAL STATUS LIKE 'Uptime'; + other status variables | Combine with other status to interpret status |
PARALLEL | N/A (MySQL does not expose this directly) | MySQL is multithreaded, but lacks this property |
THREAD# | SHOW PROCESSLIST; or performance_schema.threads | Shows active threads (similar to Oracle background) |
ARCHIVER | Not applicable | MySQL doesn’t have archiver process like Oracle |
DATABASE_STATUS | SELECT SCHEMA_NAME FROM information_schema.schemata; | Shows available databases |
INSTANCE_ROLE | N/A (no primary/standby distinction in MySQL by default) | Use for MySQL Replication or Group Replication |
🧪 Sample Query Bundle for MySQL “Instance Info”
-- MySQL Instance Info Equivalent to V$INSTANCE
SELECT 'Host Name' AS item, @@hostname AS value
UNION ALL
SELECT 'MySQL Version', @@version
UNION ALL
SELECT 'Base Directory', @@basedir
UNION ALL
SELECT 'Data Directory', @@datadir
UNION ALL
SELECT 'Port', @@port
UNION ALL
SELECT 'Socket', @@socket;
-- Uptime (seconds since server started)
SHOW GLOBAL STATUS LIKE 'Uptime';
-- Threads (similar to Oracle background/foreground process view)
SELECT * FROM performance_schema.threads
LIMIT 10;
🧾 Summary Table
Oracle (V$INSTANCE ) | MySQL |
---|---|
Instance name | @@hostname |
Version | @@version |
Startup time | SHOW GLOBAL STATUS LIKE 'Uptime' |
Host name | @@hostname |
Status | Derived from uptime / process status |
Background processes | SHOW PROCESSLIST or performance_schema.threads |