Wednesday, September 23, 2015

Oracle Data Guard Real-Time Query - How to Disable

Real-Time Query (RTQ) is an extra cost option for Oracle Data Guard. And it's turned on by fucking default. It's easy to accidentally use it.

Anyway, disable that shit by using the following:

1. Change the following system parameter:

alter system set "_query_on_physical"=false scope=spfile;

shutdown immediate;
startup mount;

This works in 11.2.0.4.18.

2. Stop Managed Recovery BEFORE opening the fucking standby database.

Also, your COMPATIBLE parameter has to be at least 11.0.

http://docs.oracle.com/cd/E11882_01/server.112/e41134/manage_ps.htm#SBYDB00707

"The COMPATIBLE database initialization parameter must be set to 11.0 or higher to use the real-time query feature of the Oracle Active Data Guard option."

Haha! I LOLLED hard when I read that. See, on a standby database I had stopped the DG broker, restarted the database (so real-time apply was not used) and opened the db read-only. Now OEMGC keeps ticked the option "Real-Time Query" on the Data Guard Status page even though it's disabled! Nothing I do can remove that fucking green tick.

I mean, FFS, can't I just use the fucking database without wasting fucking time on licensing shit?

Well, thank God I kept the COMPATIBLE parameter to 10.2.0.3.

I checked dba_feature_usage_statistics, and it confirmed that in no fucking way did I use that shit.

Force refresh of dba_feature_usage_statistics




connect / as sysdba
alter session set "_SWRF_TEST_ACTION"=53;
alter session set NLS_DATE_FORMAT='DD/MM/YYYY HH24:MI:SS';
select MAX(LAST_SAMPLE_DATE) from dba_feature_usage_statistics;