Skip to Main Content
  • Questions
  • physical standby pdb run select get ORA-16000 (Correct)

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: March 04, 2022 - 9:58 am UTC

Last updated: March 09, 2022 - 2:43 am UTC

Version: 19.3c

Viewed 1000+ times

You Asked

Hi, I have a SQL which include two different dblinks. The SQL can query normally on primary database. However, I get error "ORA-16000: database or pluggable database open for read-only access" when query on the physical standby database. Does 19c standby database can not have two or more dblinks in a sql?


【PRIMARY DATABASE OK!】

SQL> SELECT t1.isactive, t2.isactive
2 FROM settleadmin.t_investor@DL_ZJCTP2V t1, settleadmin.t_investor@dl_ggdb t2
3 where rownum < 10;

ISACTIVE ISACTIVE
---------- ----------
1 1
1 1
0 1
1 1
0 1
0 1
1 1
1 1
1 1


【DATAGUARD DATABASE FAILED!】

SQL> select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production


SQL> select open_mode,db_unique_name,database_role,force_logging from v$database;

OPEN_MODE DB_UNIQUE_NAME DATABASE_ROLE FORCE_LOGGING
-------------------- ------------------------------ ---------------- ---------------------------------------
READ ONLY WITH APPLY SCMDBDG PHYSICAL STANDBY YES


SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DC READ ONLY NO
4 PDB1 READ ONLY NO


SQL> show parameter links;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
allow_global_dblinks boolean FALSE
open_links integer 50
open_links_per_instance integer 50


SQL> SELECT t1.isactive, t2.isactive
2 FROM settleadmin.t_investor@DL_ZJCTP2V t1, settleadmin.t_investor@dl_ggdb t2
3 where rownum < 10;

ERROR at line 2:
ORA-16000: database or pluggable database open for read-only access

and Connor said...


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database