The following lines contain the word 'select', 'insert', 'update' or 'delete':
execute immediate 'select a.node_id ' ||
' from fnd_nodes a ' ||
' where upper(a.node_name) = upper(:v1) '
into l_node_id
using l_node_name;
select a.Tns_Alias_Address_List_Guid,a.sequence_number,
a.failover,a.load_balance
from fnd_tns_alias_address_lists a
where a.Tns_Alias_Description_Guid = p_tns_description_guid
and a.sequence_number >= 0
order by a.sequence_number;
select a.Listener_Port_Guid
from fnd_tns_alias_addresses a
where a.Tns_Alias_Address_List_Guid = p_tns_address_list_guid
order by a.Listener_Port_Guid;
select a.*
into l_root_desc
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = l_descRec.tns_alias_guid
and a.sequence_number = 0;
select a.Db_Guid
into l_db_guid
from fnd_database_services a
where a.Db_Service_Guid = l_root_desc.Db_Service_Guid;
select count(*)
into l_valid_service
from fnd_database_services a
where a.Db_Guid = l_db_guid
and a.Service_Name = p_Service_Name;
select count(*)
into l_valid_instance
from fnd_database_instances a, fnd_database_services b,
fnd_db_service_members c
where a.db_guid = l_db_guid
and a.Instance_Name = p_Instance_name
and a.db_guid = b.db_guid
and b.Service_Name = p_Service_Name
and b.Db_Service_Guid = c.Db_Service_Guid
and c.Instance_Guid = a.Instance_Guid
and c.db_guid = b.db_guid;
delete from fnd_tns_alias_addresses a
where a.Tns_Alias_Address_List_Guid
in ( select b.Tns_Alias_Address_List_Guid
from fnd_tns_alias_address_lists b
where b.Tns_Alias_Description_Guid
= l_descRec.Tns_Alias_Description_Guid );
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Description_Guid
= l_descRec.Tns_Alias_Description_Guid ;
select a.*
into l_sourceDesc
from fnd_tns_alias_descriptions a, fnd_databases b,
fnd_tns_aliases c
where b.db_guid = l_db_guid
and b.Default_Tns_Alias_Guid = c.tns_alias_guid
and c.tns_alias_guid = a.tns_alias_guid
and a.sequence_number = 0;
select a.*
into l_sourceDesc
from fnd_tns_alias_descriptions a, fnd_database_instances b,
fnd_tns_aliases c
where b.db_guid = l_db_guid
and b.Instance_Name = p_instance_name
and b.Default_Tns_Alias_Guid = c.tns_alias_guid
and c.tns_alias_guid = a.tns_alias_guid
and a.sequence_number = 0;
delete from fnd_tns_alias_addresses a
where a.Tns_Alias_Address_List_Guid
in ( select b.Tns_Alias_Address_List_Guid
from fnd_tns_alias_address_lists b
where b.Tns_Alias_Description_Guid
= l_descRec.Tns_Alias_Description_Guid );
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Description_Guid
= l_descRec.Tns_Alias_Description_Guid ;
is select a.Tns_Alias_Address_List_Guid,a.sequence_number
from fnd_tns_alias_address_lists a
where a.Tns_Alias_Description_Guid = p_desc_guid
and a.sequence_number >= 0
order by a.sequence_number;
is select a.Tns_Alias_Description_Guid,a.Sequence_Number,
abs(a.Sequence_Number) abs_sequence_number
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = p_tns_alias_guid_parm
and a.Sequence_Number <> 0
order by abs(a.Sequence_Number);
is select a.Tns_Alias_Description_Guid,a.Sequence_Number
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = p_tns_alias_guid_parm
and a.Sequence_Number <> 0
and abs(a.Sequence_Number) > p_actual_count;
select a.tns_alias_guid
into l_tns_alias_guid
from fnd_tns_aliases a, fnd_tns_alias_sets b
where b.tns_alias_set_name = p_alias_set_name
and b.tns_alias_set_guid = a.alias_set_guid
and a.alias_name = p_alias_name;
select a.*
into l_descRec
from fnd_tns_alias_descriptions a
where a.Tns_Alias_Guid = l_tns_alias_guid
and a.Sequence_Number = 0;
select count(*)
into l_actual_alt_count
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = l_tns_alias_guid
and a.sequence_number <> 0 ;
select a.*
into l_descRec
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = l_tns_alias_guid
and abs(a.sequence_number) = i;
delete from fnd_tns_alias_descriptions a
where a.Tns_Alias_Description_Guid =
f_unused.Tns_Alias_Description_Guid;
delete from fnd_tns_alias_addresses a
where a.Tns_Alias_Address_List_Guid
in ( select b.Tns_Alias_Address_List_Guid
from fnd_tns_alias_address_lists b
where b.Tns_Alias_Description_Guid
= f_unused.Tns_Alias_Description_Guid );
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Description_Guid
= f_unused.Tns_Alias_Description_Guid ;
select a.*
into l_descRec
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = l_tns_alias_guid
and abs(a.sequence_number) = i;
select a.*
into l_descRec
from fnd_tns_alias_descriptions a
where a.tns_alias_guid = l_tns_alias_guid
and abs(a.sequence_number) = i;
is select a.remote_listener_alias
from fnd_database_instances a
where a.db_guid = p_db_guid
and a.remote_listener_alias is not null;
is select a.listener_port_guid,a.port
from fnd_tns_listener_ports a
where a.listener_guid = p_listener_guid;
is select f.Tns_Alias_Description_Guid,
e.alias_name,d.tns_alias_set_name
from fnd_system_server_map a, fnd_app_servers b,
fnd_tns_alias_set_usage c,fnd_tns_alias_sets d,
fnd_tns_aliases e, fnd_tns_alias_descriptions f
where a.System_GUID = p_System_Guid
and a.Server_GUID = b.Server_GUID
and b.server_type = fnd_app_system.C_DB_SERVER_TYPE
and a.Server_GUID = c.Server_GUID
and c.tns_alias_set_guid = d.tns_alias_set_guid
and d.tns_alias_set_type = fnd_app_system.C_ALIAS_SET_NAME_PUB
and d.tns_alias_set_guid = e.alias_set_guid
and e.tns_alias_guid = f.tns_alias_guid
and f.sequence_number <> 0;
is select a.service_name,b.instance_name
from fnd_database_services a,fnd_database_instances b
where a.db_guid = p_db_guid
and b.db_guid = p_db_guid
and ( b.Instance_Guid <> p_instance_guid
or ( b.Instance_Guid = p_instance_guid and
a.service_name <> p_service_name )
)
order by 1,2;
select a.System_Guid
into l_System_Guid
from fnd_apps_system a
where a.name = SystemName;
execute immediate 'select a.node_id ' ||
' from fnd_nodes a ' ||
' where upper(a.node_name) = upper(:v1) '
into l_node_id
using l_node_name;
select a.Oracle_Home_Id
into l_Oracle_Home_Id
from fnd_oracle_homes a
where a.node_id = l_node_id
and a.path = OracleHomePath;
select a.Server_Guid
into l_Server_Guid
from fnd_app_servers a
where a.name = ServerName;
select a.db_guid , a.Default_TNS_Alias_Guid
into l_db_guid, l_db_Default_TNS_Alias_Guid
from fnd_databases a
where a.db_name = DatabaseName
and a.db_domain = Domain;
select a.*
into l_instRec
from fnd_database_instances a
where a.db_guid = l_db_guid
and a.Instance_Name = InstanceName;
select a.db_service_guid
into l_db_service_guid
from fnd_database_services a
where a.db_guid = l_db_guid
and a.Service_name = ServiceName;
select a.tns_alias_set_guid
into l_tns_alias_set_guid_pub
from fnd_tns_alias_sets a
where a.tns_alias_set_name = l_public_alias_set_name;
select a.tns_alias_set_guid
into l_tns_alias_set_guid_int
from fnd_tns_alias_sets a
where a.tns_alias_set_name = l_internal_alias_set_name;
select a.Listener_GUID
into l_Listener_GUID
from fnd_tns_listeners a
where a.Server_GUID = l_Server_Guid
and a.Listener_Name = ServerName;
select a.listener_port_guid
into l_listener_port_guid
from fnd_tns_listener_ports a
where a.listener_guid= l_Listener_GUID
and a.port = ListenerPort;
select count(*)
into l_db_alias_exists
from fnd_system_server_map a, fnd_app_servers b,
fnd_tns_alias_set_usage c,fnd_tns_alias_sets d,
fnd_tns_aliases e
where a.System_GUID = l_System_Guid
and a.Server_GUID = b.Server_GUID
and b.server_type = fnd_app_system.C_DB_SERVER_TYPE
and b.server_guid <> l_Server_Guid
and a.Server_GUID = c.Server_GUID
and c.tns_alias_set_guid = d.tns_alias_set_guid
and d.tns_alias_set_type = fnd_app_system.C_ALIAS_SET_NAME_PUB
and d.tns_alias_set_guid = e.alias_set_guid
and e.alias_name = DatabaseName;
select a.TNS_ALIAS_GUID
into l_tns_db_alias
from fnd_tns_aliases a
where a.Alias_Name = DatabaseName
and a.alias_set_guid = l_tns_alias_set_guid_pub;
select count(*)
into l_db_alias_exists
from fnd_tns_aliases a
where a.Alias_Name = InstanceSid
and a.alias_set_guid = l_tns_alias_set_guid_pub;
select a.*
into l_resolveDescRec
from fnd_tns_alias_descriptions a
where a.Tns_Alias_Description_Guid = f_resolve.Tns_Alias_Description_Guid;
select b.db_guid,b.default_tns_alias_guid instance_tns_alias_guid,
a.default_tns_alias_guid db_tns_alias_guid,b.instance_guid
from fnd_databases a,fnd_database_instances b,
fnd_system_server_map c, fnd_app_servers d
where c.system_guid = p_System_Guid
and d.server_guid = c.server_guid
and d.server_type = fnd_app_system.C_DB_SERVER_TYPE
and b.server_guid = d.server_guid
and b.db_guid = a.db_guid;
select a.db_service_guid
from fnd_database_services a
where a.db_guid = p_db_guid ;
select a.tns_alias_guid,a.alias_type
from fnd_tns_aliases a
where a.alias_name = p_alias_name
and a.alias_set_guid = p_alias_set_guid
and ( a.alias_type = nvl(p_alias_type,a.alias_type)
or a.alias_type = fnd_app_system.C_DB_INST_TNS_ALIAS_TYPE );
select c.listener_port_guid
from fnd_tns_alias_descriptions a, fnd_tns_alias_address_lists b,
fnd_tns_alias_addresses c
where a.tns_alias_guid = p_tns_alias_guid
and a.sequence_number= 0
and b.Tns_Alias_Description_Guid = a.Tns_Alias_Description_Guid
and c.Tns_Alias_Address_List_Guid = b.Tns_Alias_Address_List_Guid;
select e.Tns_Alias_Guid,e.Alias_Type
from fnd_system_server_map a,fnd_tns_alias_set_usage b,
fnd_tns_alias_sets c, fnd_app_servers d,
fnd_tns_aliases e
where a.system_guid = p_System_Guid
and a.server_guid = b.server_guid
and b.tns_alias_set_guid = c.tns_alias_set_guid
and c.tns_alias_set_type = fnd_app_system.C_ALIAS_SET_NAME_PUB
and a.server_guid = d.server_guid
and d.server_type = fnd_app_system.C_DB_SERVER_TYPE
and e.alias_set_guid = b.tns_alias_set_guid
and e.alias_name = p_alias_name
and ( e.alias_type = nvl(p_alias_type,e.alias_type)
or e.alias_type = fnd_app_system.C_DB_INST_TNS_ALIAS_TYPE );
select a.Tns_Alias_Description_Guid
from fnd_tns_alias_descriptions a
where a.Tns_Alias_Guid = p_tns_alias_guid
and a.sequence_number >= 0
order by a.sequence_number;
select a.*
into l_tns_aliases_rec
from fnd_tns_aliases a
where a.tns_alias_guid = f_valid.Tns_Alias_Guid;
select a.*
into l_tns_descriptions_rec
from fnd_tns_alias_descriptions a
where a.Tns_Alias_Description_Guid = f_desc.Tns_Alias_Description_Guid;
select a.*
into l_tns_aliases_rec
from fnd_tns_aliases a
where a.alias_name = alias
and a.alias_set_guid = alias_set_guid;
select a.*
into l_tns_descriptions_rec
from fnd_tns_alias_descriptions a
where a.Tns_Alias_Description_Guid = f_desc.Tns_Alias_Description_Guid;
select c.alias_name instance_alias,d.alias_name load_balance_alias,
a.db_name
from fnd_databases a, fnd_database_instances b, fnd_tns_aliases c,
fnd_tns_aliases d
where b.default_tns_alias_guid = c.tns_alias_guid
and b.db_guid = a.db_guid
and a.Default_TNS_Alias_GUID = d.tns_alias_guid
and b.server_guid in ( select x.server_guid
from fnd_system_server_map x, fnd_app_servers y
where x.system_guid = p_System_Guid
and y.server_guid = x.server_guid
and y.server_type =
fnd_app_system.C_DB_SERVER_TYPE
) ;
is select a.listener_port_guid,a.port
from fnd_tns_listener_ports a
where a.listener_guid = p_listener_guid;
select a.System_Guid
into l_System_Guid
from fnd_apps_system a
where a.name = SystemName;
execute immediate 'select a.node_id ' ||
' from fnd_nodes a ' ||
' where upper(a.node_name) = upper(:v1) '
into l_node_id
using l_node_name;
select a.Oracle_Home_Id
into l_Pri_Oracle_Home_Id
from fnd_oracle_homes a
where a.node_id = l_node_id
and a.path = PriOracleHomePath;
select a.Oracle_Home_Id
into l_Aux_Oracle_Home_Id
from fnd_oracle_homes a
where a.node_id = l_node_id
and a.path = AuxOracleHomePath;
select a.appl_top_guid
into l_Appl_Top_Guid
from fnd_appl_tops a
where a.node_id = l_node_id
and a.path = ApplTopPath;
select a.Server_Guid
into l_Server_Guid
from fnd_app_servers a
where a.name = ServerName;
select a.tns_alias_set_guid
into l_tns_alias_set_guid_pub
from fnd_tns_alias_sets a
where a.tns_alias_set_name = l_public_alias_set_name;
select a.Listener_GUID
into l_Listener_GUID
from fnd_tns_listeners a
where a.Server_GUID = l_Server_Guid
and a.Listener_Name = fnd_app_system.C_APPS_LISTENER_ID ||
'_' || ServerName;
select a.listener_port_guid
into l_listener_port_guid
from fnd_tns_listener_ports a
where a.listener_guid= l_Listener_GUID
and a.port = to_number(RPCPort);
select a.TNS_ALIAS_GUID
into l_fndfs_tns_alias
from fnd_tns_aliases a
where a.Alias_Name = l_fndfs_alias
and a.Alias_set_guid = l_tns_alias_set_guid_pub;
select a.TNS_ALIAS_GUID
into l_fndsm_tns_alias
from fnd_tns_aliases a
where a.Alias_Name = l_fndsm_alias
and a.Alias_set_guid = l_tns_alias_set_guid_pub;
cursor c1 is select d.listener_name,c.port,
a.sequence_number,a.failover,a.load_balance
from fnd_tns_alias_address_lists a, fnd_tns_alias_addresses b,
fnd_tns_listener_ports c, fnd_tns_listeners d
where a.Tns_Alias_Description_Guid = p_Tns_Alias_Description_Guid
and a.Tns_Alias_Address_List_Guid =
b.Tns_Alias_Address_List_Guid
and b.listener_port_guid = c.listener_port_guid
and c.Listener_GUID = d.Listener_GUID
order by a.sequence_number,b.listener_port_guid;
cursor c1 is select a.service_name
from fnd_database_services a
where a.DB_Service_GUID = p_DB_Service_GUID;
cursor c1 is select a.service_name,b.Instance_Name,b.Instance_Number,
c.instance_type
from fnd_database_services a, fnd_database_instances b,
fnd_db_service_members c
where a.DB_Service_GUID = p_DB_Service_GUID
and b.Instance_Guid = p_instance_guid
and a.Db_Service_Guid = c.Db_Service_Guid
and c.Instance_Guid = p_instance_guid ;
cursor c1 is select a.alias_name,a.Alias_Type,
a.Failover,a.Load_Balance,
b.tns_alias_set_name,
b.tns_alias_set_type
from fnd_tns_aliases a,fnd_tns_alias_sets b
where a.tns_alias_guid = p_tns_alias_guid
and a.alias_set_guid = b.tns_alias_set_guid;
cursor c2 is select c.tns_alias_description_guid,
c.DB_Service_GUID,c.DB_Instance_Guid,
c.Service_Name,c.Instance_Name,
c.Failover,c.Load_Balance,
c.sequence_number
from fnd_tns_alias_descriptions c
where c.tns_alias_guid = p_tns_alias_guid
order by c.sequence_number;
select a.TNS_ALIAS_GUID
from fnd_tns_aliases a, fnd_tns_alias_set_usage b
where a.Alias_Name like 'FNDFS%'
and a.Alias_Type = fnd_app_system.C_FNDFS_TNS_ALIAS_TYPE
and b.server_guid = p_Server_Guid
and a.alias_set_guid = b.tns_alias_set_guid;
select a.TNS_ALIAS_GUID
from fnd_tns_aliases a, fnd_tns_alias_set_usage b
where a.Alias_Name like 'FNDSM%'
and a.Alias_Type = fnd_app_system.C_FNDSM_TNS_ALIAS_TYPE
and b.server_guid = p_Server_Guid
and a.alias_set_guid = b.tns_alias_set_guid;
cursor c1 is select db_guid,Instance_Guid,Instance_Name,Instance_Number,
Sid_GUID,Default_TNS_Alias_GUID,sid,
Local_Listener_Alias,Remote_Listener_Alias,
Configuration,Description,Interconnect_name
from fnd_database_instances
where Server_Guid = p_Server_Guid;
is select db_name,db_domain,default_tns_alias_guid,is_rac_db,version
from fnd_databases
where db_guid = p_db_guid;
is select assignment
from fnd_database_assignments
where db_guid = p_db_guid;
is select sid
from fnd_sids
where sid_guid = p_sid_guid;
is select DB_Service_GUID,db_guid,Service_Name,Description
from fnd_database_services
where db_guid = p_db_guid;
select a.TNS_ALIAS_GUID
from fnd_tns_aliases a, fnd_tns_alias_set_usage b
where a.Alias_Name = p_db_name
and a.Alias_Type = fnd_app_system.C_DB_INST_TNS_ALIAS_TYPE
and b.Server_Guid = p_server_guid
and b.Tns_Alias_Set_Guid = a.Alias_Set_Guid;
select count(*)
into l_service_member
from fnd_db_service_members a
where a.db_service_guid = f_service.db_service_guid
and a.Instance_Guid = f_instance.Instance_Guid ;
cursor c1 is select name,Version,Owner,CSI_Number,System_GUID
from fnd_apps_system
where name = SystemName;
is select a.Server_GUID,a.name,a.Node_Id,a.Internal,a.Appl_Top_Guid,
a.Server_type,a.Pri_Oracle_Home,a.Aux_Oracle_Home
from fnd_app_servers a, fnd_system_server_map b
where b.System_Guid = p_System_Guid
and a.Server_GUID = b.Server_GUID
order by a.node_id,a.Internal,a.Server_type,a.name;
is select name,Path,Shared
from fnd_appl_tops
where appl_top_guid = p_appl_top_guid;
is select name,Path,Version,Description
from fnd_oracle_homes
where oracle_home_id = p_oracle_home_id;
execute immediate 'select a.* ' ||
' from fnd_nodes a ' ||
' where a.node_id = :v1 '
into l_nodeRec
using f_server.node_id;
select a.System_Guid
from fnd_apps_system a
where a.name = p_SystemName
for update of a.System_Guid;
select a.Server_GUID,b.PRI_ORACLE_HOME,c.listener_guid
from fnd_system_server_map a, fnd_app_servers b,
fnd_tns_listeners c
where a.System_GUID = p_System_GUID
and a.Server_GUID = b.Server_GUID
and b.name = p_ServerName
and b.server_type = fnd_app_system.C_DB_SERVER_TYPE
and b.Server_GUID = c.Server_GUID(+);
select a.instance_guid,a.sid_guid,
a.default_tns_alias_guid instance_tns_alias_guid,
a.local_listener_alias,
a.remote_listener_alias,
b.db_guid,
b.default_tns_alias_guid db_tns_alias_guid
from fnd_database_instances a,fnd_databases b
where a.Server_GUID = p_Server_GUID
and a.Instance_Name = p_InstanceName
and a.db_guid = b.db_guid
and b.DB_Name = p_DatabaseName
and b.DB_Domain = p_Domain;
delete from fnd_oracle_homes a
where a.oracle_home_id = f_server.pri_oracle_home
and not exists ( select b.name
from fnd_app_servers b
where ( b.pri_oracle_home
= f_server.pri_oracle_home
or b.aux_oracle_home
= f_server.pri_oracle_home
)
and b.server_guid <> f_server.server_guid
);
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Address_List_Guid
in ( select b.Tns_Alias_Address_List_Guid
from fnd_tns_alias_addresses b,fnd_tns_listener_ports c
where b.listener_port_guid = c.listener_port_guid
and c.Listener_GUID = f_server.Listener_GUID )
and 1 = ( select count(*)
from fnd_tns_alias_addresses c
where c.Tns_Alias_Address_List_Guid
= a.Tns_Alias_Address_List_Guid );
delete from fnd_tns_alias_descriptions a
where not exists ( select 1
from fnd_tns_alias_address_lists b
where b.Tns_Alias_Description_Guid
= a.Tns_Alias_Description_Guid )
and a.sequence_number >= 0;
delete from fnd_tns_aliases a
where not exists ( select 1
from fnd_tns_alias_descriptions b
where b.Tns_Alias_Guid = a.Tns_Alias_Guid );
delete from fnd_tns_alias_addresses b
where b.Listener_port_GUID
in ( select c.listener_port_guid
from fnd_tns_listener_ports c
where c.Listener_GUID = f_server.Listener_GUID );
delete from fnd_tns_listener_ports a
where a.Listener_GUID = f_server.Listener_GUID;
delete from fnd_tns_listeners a
where a.Listener_GUID = f_server.Listener_GUID;
delete from fnd_database_instances a
where a.instance_guid = f_instance.instance_guid;
delete from fnd_db_service_members a
where a.db_guid = f_instance.db_guid
and a.instance_guid = f_instance.instance_guid;
delete from fnd_sids a
where a.sid_guid = f_instance.sid_guid;
delete from fnd_database_services a
where a.db_guid = f_instance.db_guid
and not exists ( select b.instance_guid
from fnd_db_service_members b
where b.db_service_guid = a.db_service_guid );
delete from fnd_databases a
where a.db_guid = f_instance.db_guid
and not exists ( select b.instance_guid
from fnd_database_instances b
where b.db_guid = a.db_guid );
delete from fnd_database_assignments a
where a.db_guid = f_instance.db_guid
and a.assignment = fnd_app_system.C_APP_DB_ASSIGNMENT
and not exists ( select 1
from fnd_databases b
where b.db_guid = a.db_guid ) ;
select a.System_Guid
from fnd_apps_system a
where a.name = p_SystemName
for update of a.System_Guid;
select a.Server_GUID,b.PRI_ORACLE_HOME,c.listener_guid,
b.APPL_TOP_GUID,b.AUX_ORACLE_HOME
from fnd_system_server_map a, fnd_app_servers b,
fnd_tns_listeners c
where a.System_GUID = p_System_GUID
and a.Server_GUID = b.Server_GUID
and b.name = p_ServerName
and b.server_type = fnd_app_system.C_APP_SERVER_TYPE
and b.Server_GUID = c.Server_GUID(+);
delete from fnd_oracle_homes a
where a.oracle_home_id = f_server.pri_oracle_home
and not exists ( select b.name
from fnd_app_servers b
where ( b.pri_oracle_home
= f_server.pri_oracle_home
or b.aux_oracle_home
= f_server.pri_oracle_home
)
and b.server_guid <> f_server.server_guid
);
delete from fnd_oracle_homes a
where a.oracle_home_id = f_server.aux_oracle_home
and not exists ( select b.name
from fnd_app_servers b
where ( b.pri_oracle_home
= f_server.aux_oracle_home
or b.aux_oracle_home
= f_server.aux_oracle_home
)
and b.server_guid <> f_server.server_guid
);
delete from fnd_appl_tops a
where a.appl_top_guid = f_server.appl_top_guid
and not exists ( select b.name
from fnd_app_servers b
where b.appl_top_guid = f_server.appl_top_guid
and b.server_guid <> f_server.server_guid
);
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Address_List_Guid
in ( select b.Tns_Alias_Address_List_Guid
from fnd_tns_alias_addresses b,fnd_tns_listener_ports c
where b.listener_port_guid = c.listener_port_guid
and c.Listener_GUID = f_server.Listener_GUID )
and 1 = ( select count(*)
from fnd_tns_alias_addresses c
where c.Tns_Alias_Address_List_Guid
= a.Tns_Alias_Address_List_Guid );
delete from fnd_tns_alias_descriptions a
where not exists ( select 1
from fnd_tns_alias_address_lists b
where b.Tns_Alias_Description_Guid
= a.Tns_Alias_Description_Guid )
and a.sequence_number >= 0;
delete from fnd_tns_aliases a
where not exists ( select 1
from fnd_tns_alias_descriptions b
where b.Tns_Alias_Guid = a.Tns_Alias_Guid );
delete from fnd_tns_alias_addresses b
where b.Listener_port_GUID
in ( select c.listener_port_guid
from fnd_tns_listener_ports c
where c.Listener_GUID = f_server.Listener_GUID );
delete from fnd_tns_listener_ports a
where a.Listener_GUID = f_server.Listener_GUID;
delete from fnd_tns_listeners a
where a.Listener_GUID = f_server.Listener_GUID;
select a.System_Guid
from fnd_apps_system a
where a.name = p_SystemName
for update of a.System_Guid;
select a.Server_GUID,b.Server_type
from fnd_system_server_map a, fnd_app_servers b
where a.System_GUID = p_System_GUID
and a.Server_GUID = b.Server_GUID
and b.name = p_ServerName;
select a.instance_name,b.DB_Name,b.DB_Domain
from fnd_database_instances a,fnd_databases b
where a.Server_GUID = p_Server_GUID
and a.db_guid = b.db_guid;
select a.tns_alias_guid,b.Tns_Alias_Description_Guid,
c.Tns_Alias_Address_List_Guid
from fnd_tns_aliases a,fnd_tns_alias_descriptions b,
fnd_tns_alias_address_lists c,fnd_tns_alias_set_usage d
where d.server_guid = p_server_guid
and d.tns_alias_set_guid = a.alias_set_guid
and a.tns_alias_guid = b.tns_alias_guid
and b.Tns_Alias_Description_Guid = c.Tns_Alias_Description_Guid(+);
delete from fnd_tns_alias_descriptions a
where a.Tns_Alias_Description_Guid =
f_alias.Tns_Alias_Description_Guid;
delete from fnd_tns_alias_address_lists a
where a.Tns_Alias_Address_List_Guid =
f_alias.Tns_Alias_Address_List_Guid;
delete from fnd_tns_alias_addresses a
where a.Tns_Alias_Address_List_Guid =
f_alias.Tns_Alias_Address_List_Guid;
delete from fnd_tns_aliases a
where a.tns_alias_guid = f_alias.tns_alias_guid;
delete from fnd_tns_alias_sets a
where a.tns_alias_set_guid
in ( select b.tns_alias_set_guid
from fnd_tns_alias_set_usage b
where b.server_guid = f_server.server_guid );
delete from fnd_tns_alias_set_usage a
where a.server_guid = f_server.server_guid;
delete from fnd_system_server_map a
where a.System_GUID = f_system.System_Guid
and a.Server_GUID = f_server.Server_GUID;
delete from fnd_app_servers a
where a.Server_GUID = f_server.Server_GUID;
select a.System_Guid
from fnd_apps_system a
where a.name = p_SystemName
for update of a.System_Guid;
select a.Server_GUID,b.name
from fnd_system_server_map a, fnd_app_servers b
where a.System_GUID = p_System_GUID
and a.Server_GUID = b.Server_GUID;
delete from fnd_apps_system a
where a.System_GUID = f_system.System_Guid ;