0

I'm trying to get the wallet status for the current instance of an Oracle 11g 2 node RAC DB (but ideally all RDBMS versions). The following command returns values for both nodes instead of one:

SQL> select a.status from gv$encryption_wallet a, gv$instance b where a.INST_ID=(select INST_ID from gv$instance where instance_number=userenv('instance')) and a.WRL_TYPE='HSM';

STATUS
------------------------------
OPEN
OPEN

If I break it down it doesn't show the info for node 2 .. only node 1. And I'm running the cmd from node 2.

SQL> select INST_ID from gv$instance where instance_number=userenv('instance');

   INST_ID
----------
         2

SQL> select a.status from gv$encryption_wallet a, gv$instance b where a.INST_ID=2 and a.WRL_TYPE='HSM';

no rows selected

It's problem something really obvious but I just can't see it at the moment. Any help appreciated. Thank you.

1 Answer 1

2

If you just want the values of the current instance where you are connected to, just query the v$ views instead of the gv$ view, that lists the values of the complete instance group where you are connected to.

1
  • Yes that works too ... I don't understand why the result above returns no records but as you pointed out it's not necessary. Many thanks.
    – Franco
    Commented Aug 6, 2021 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.