Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Checking how many instances are running the db I am connected to.

FredApiDec 8 2010 — edited Dec 20 2010
Is the following query going to tell me how many instances are running the db I am connected to (in any cluster configuration)?

SELECT COUNT(*) FROM gv$parameter WHERE name='db_name' AND value =(
SELECT value FROM gv$parameter WHERE name='db_name' AND Inst_ID=SYS_CONTEXT('USERENV', 'INSTANCE'))

Why this question?
I do actualy a [SELECT COUNT(*) FROM gv$instance] but I fear it will not return the correct information if the Oracle OneNode is used (instance1 on db1 and instance2 on db2).
I have no Oracle OneNode installed to test this.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2011
Added on Dec 8 2010
7 comments
15,409 views