Tag: primary

How to tell/find if the instance is Primary/Standby?

By querying v$database one can tell if the host is primary or standby For primary testdb> select database_role from v$database; DATABASE_ROLE ---------------- PRIMARY For Standby - Note you may need to connect to as sys as sysdba if the instance is in mount state testd> select database_role from v$database; DATABASE_ROLE ---------------- PHYSICAL STANDBY OR On … Continue reading How to tell/find if the instance is Primary/Standby?

Lists foreign key(s) on a table

Using the following anonymous store procedure one can list the foreign key on a table and it's column. It also recursively traverses tables to see if there are other tables dependent on it's primary key. set serveroutput on format wrapped DECLARE l_vc2_table_owner VARCHAR2(30) := upper('&1'); l_vc2_table_name VARCHAR2(30) := upper('&2'); PROCEDURE get_ind_columns(l_vc2_owner IN VARCHAR2, l_vc2_index_name IN … Continue reading Lists foreign key(s) on a table