Site icon Radu Pârvu

Comparing Oracle Databases: Initialization Parameters

Sometimes I encounter a setup with no change and configuration management process. In short, they might end up every six months or so with significant discrepancies between their pre-production or acceptance environments and the production one. What makes things worse, is that even production is sometimes the environment that is not kept clean. Therefore, they have a need to design a simple flow that would allow any technical project member with access to check periodically for the parameters that are different between those three environments (one Prod and two Pre’Prod).

Workflow Restrictions

In this post, we will compare the database initialization parameters between three environments.

Easy Steps to Follow

create table prod_par as
select inst_id, num, name, value from gv$parameter where 1=0; 
create table acc_par as
select inst_id, num, name, value from gv$parameter where 1=0; 
select
    inst_id,
    num,
    name,
    value
from
    gv$parameter p
where
    p.name not in ( 'log_archive_config', 
                    'log_archive_format', 
                    'cluster_interconnects', 
                    'service_names',
                    'core_dump_dest',
                    'audit_file_dest',
                    'dispatchers',
                    'db_name',
                    'db_unique_name',
                    'db_domain',
                    'instance_name' );
select                p.name,
p.inst_id,
p.value PROD_VALUE,
g.value ACCEPTANCE$_VALUE,
a.value ACCEPTANCE_VALUE
from prod_par p,
acc_par a,
gv$parameter g
where (p.num = g.num
and a.num = g.num)
and (p.inst_id = g.inst_id
and a.inst_id = g.inst_id)
and (p.value != g.value
or a.value != g.value
or p.value != a.value)
and p.name not in (
'log_archive_config',
'log_archive_format',
'cluster_interconnects',
'service_names',
'core_dump_dest',
'audit_file_dest',
'dispatchers',
'db_name',
'db_unique_name',
'db_domain',
'instance_name',
'db_file_name_convert',
'dg_broker_config_file1',
'dg_broker_config_file2',
'listener_networks',
'local_listener',
'log_archive_dest_2',
'log_file_name_convert',
'undo_tablespace',
'remote_listener')
order by p.name,
p.inst_id;

Tested on:

Oracle Database Enterprise Edition 19c

Exit mobile version