Skip to content

Commit 4b855d8

Browse files
author
Marcin Przepiorowski
committed
Merge branch 'pdb_instance_fix' into develop
2 parents d2dee6d + 14f08b8 commit 4b855d8

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

bin/dx_get_db_env.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ =head1 COLUMNS
564564
565565
=item B<Group> - Group name
566566
567-
=item B<Type> - Database type
567+
=item B<Type> - Database type: dSource | VDB | CDB (Oracle Container) | vCDB ( Oracle Virtual Container )
568568
569569
=item B<SourceDB> - Parent name for VDB
570570

bin/dx_get_instance.pl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@
122122
next;
123123
}
124124

125+
my $dbname = $dbobj->getName();
126+
my $dbtype = $dbobj->getType();
127+
128+
if (defined($dbobj->getCDBContainerRef())) {
129+
# database has a CDB container so it's a PDB and there is no instance info
130+
# dbobj will be switch to container to show data
131+
132+
#my $contsourceconfig = $databases->{_sourceconfigs}->getSourceConfig($dbobj->getCDBContainerRef());
133+
#print Dumper $contsourceconfig;
134+
my $contsource = $databases->{_source}->getSourceByConfig($dbobj->getCDBContainerRef());
135+
$dbobj = $databases->getDB($contsource->{container});
136+
}
125137

126138
for my $inst ( @{$dbobj->getInstances()} ) {
127139
if (defined($instance) && ($inst->{instanceNumber} ne $instance)) {
@@ -136,9 +148,9 @@
136148
$dbobj->getEnvironmentName(),
137149
$dbobj->getInstanceHost($inst->{instanceNumber}),
138150
$groups->getName($dbobj->getGroup()),
139-
$dbobj->getName(),
151+
$dbname,
140152
$inst->{instanceName},
141-
$dbobj->getType(),
153+
$dbtype,
142154
$dbobj->getInstanceStatus($inst->{instanceNumber})
143155
);
144156
}

lib/OracleVDB_obj.pm

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,35 @@ sub getConfig
267267

268268
}
269269

270+
# Procedure getType
271+
# parameters: none
272+
# Return database type (dSource / VDB)
273+
274+
sub getType
275+
{
276+
my $self = shift;
277+
logger($self->{_debug}, "Entering VDB_obj::getType",1);
278+
my $type = $self->{source}->{type};
279+
280+
if (defined($type)) {
281+
if ($type =~ /Linked(.*)Source/ ) {
282+
if ($self->{container}->{contentType} eq 'ROOT_CDB') {
283+
return "CDB"
284+
} else {
285+
return "dSource";
286+
}
287+
} else {
288+
if ($self->{container}->{contentType} eq 'ROOT_CDB') {
289+
return "vCDB";
290+
} else {
291+
return "VDB";
292+
}
293+
}
294+
} else {
295+
return "detached";
296+
}
297+
}
298+
270299

271300
# Procedure getInstances
272301
# parameters: none

0 commit comments

Comments
 (0)