Skip to content

Commit a0ae29a

Browse files
author
Marcin Przepiorowski
committed
fix for quicker compilation
1 parent f303f1b commit a0ae29a

File tree

2 files changed

+66
-5
lines changed

2 files changed

+66
-5
lines changed

bin/dx_get_hierarchy.pl

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
my $timeflows_parent;
120120
my $groups_parent;
121121
my $engine_parent;
122+
my $replication_parent;
122123

123124
if (defined($parent_engine)) {
124125

@@ -132,6 +133,7 @@
132133

133134
$snapshots_parent = new Snapshot_obj($engine_parent, undef, undef, $debug);
134135
$timeflows_parent = new Timeflow_obj($engine_parent, $debug);
136+
$replication_parent = new Replication_obj ($engine_parent, $debug);
135137
}
136138

137139

@@ -155,7 +157,7 @@
155157

156158

157159
if (defined($parent_engine)) {
158-
$object_map = $databases->{_namespace}->generate_replicate_mapping($engine_parent, $timeflows_parent);
160+
$object_map = $databases->{_namespace}->generate_replicate_mapping($engine_parent, $timeflows_parent, $replication_parent);
159161
}
160162

161163

@@ -307,6 +309,7 @@ =head1 SYNOPSIS
307309
308310
dx_get_hierarchy [-engine|d <delphix identifier> | -all ]
309311
[-group group_name | -name db_name | -host host_name | -type dsource|vdb | -instancename instname]
312+
[-parent_engine <delphix identifier>]
310313
[-printhierarchy]
311314
[-format csv|json ]
312315
[-help|? ] [ -debug ]
@@ -373,6 +376,9 @@ =head1 OPTIONS
373376
374377
=over 3
375378
379+
=item B<-parent_engine delphix identifier>
380+
When replication between engines is configured, specify a parent engine to the engine from -d parameter.
381+
376382
=item B<-printhierarchy>
377383
Display a hierarchy of databases (from VDB to dSource)
378384
@@ -391,9 +397,65 @@ =head1 OPTIONS
391397
392398
=back
393399
400+
=head1 Output columns
401+
402+
dS snapshot - time of dSource snapshot used to create/refresh a VDB. If there is a chain of VDB's it's a snapshot used to create first one
403+
Physical DB - name of physical database used to create dSource
404+
First child DB - name of first VDB in chain.
405+
394406
=head1 EXAMPLES
395407
408+
Print database hierarchy on single engine
409+
410+
dx_get_hierarchy -d Landshark51
411+
412+
Appliance Database Group Type dSource dS snapshot Physical DB First child DB
413+
---------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ------------------------------ ------------------------------
414+
Landshark5 autotest Analytics VDB Oracle dsource 2017-02-08 09:00:35 EST orcl autotest
415+
Landshark5 AdventureWorksLT2008R2 Sources dSource N/A AdventureWorksLT2008R2 N/A
416+
Landshark5 Oracle dsource Sources dSource N/A orcl N/A
417+
Landshark5 racdba Sources dSource N/A racdba N/A
418+
Landshark5 Sybase dsource Sources dSource N/A pubs3 N/A
419+
420+
421+
Print database hierarchy on replication target engine
422+
423+
dx_get_hierarchy -d Delphix33
424+
425+
Appliance Database Group Type dSource dS snapshot Physical DB First child DB
426+
---------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ------------------------------ ------------------------------
427+
Delphix33 racdb@delphix32-2 Sources@delphix dSource N/A racdb N/A
428+
Delphix33 mask1@delphix32-4 Test@delphix32- VDB dSource on other DE N/A N/A N/A
429+
Delphix33 maskedms@delphix32-4 Test@delphix32- VDB dSource on other DE N/A N/A N/A
430+
Delphix33 cloneMSmas Untitled VDB dSource on other DE N/A N/A N/A
431+
Delphix33 mask1clone Untitled VDB dSource on other DE N/A N/A N/A
432+
Delphix33 maskclone Untitled VDB parent deleted N/A N/A N/A
433+
Delphix33 Vracdb_70C Untitled VDB racdb@delphix32-2 2016-09-28 14:57:16 GMT racdb Vracdb_70C
434+
435+
Print database hierarchy on replication target engine with connection to replication source
436+
437+
dx_get_hierarchy -d Delphix33 -parent_engine Delphix32
438+
439+
Appliance Database Group Type dSource dS snapshot Physical DB First child DB
440+
---------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ------------------------------ ------------------------------
441+
Delphix33 racdb@delphix32-2 Sources@delphix dSource N/A racdb N/A
442+
Delphix33 mask1@delphix32-4 Test@delphix32- VDB test1 2017-01-30 13:02:53 GMT test1 man
443+
Delphix33 maskedms@delphix32-4 Test@delphix32- VDB tpcc 2017-02-03 12:05:15 GMT tpcc maskedms
444+
Delphix33 cloneMSmas Untitled VDB tpcc 2017-02-03 12:05:15 GMT tpcc maskedms
445+
Delphix33 mask1clone Untitled VDB test1 2017-01-30 09:15:28 GMT test1 man
446+
Delphix33 maskclone Untitled VDB parent deleted N/A N/A N/A
447+
Delphix33 Vracdb_70C Untitled VDB racdb@delphix32-2 2016-09-28 14:57:16 GMT racdb Vracdb_70C
448+
449+
Print database hierarchy chain starting with VDB up to dSource
450+
451+
dx_get_hierarchy -d Delphix33 -parent_engine Delphix32 -printhierarchy
452+
Delphix33 : racdb@delphix32-2
453+
Delphix33 : mask1@delphix32-4 --> mask1 --> man --> test1
454+
Delphix33 : maskedms@delphix32-4 --> maskedms --> tpcc
455+
Delphix33 : cloneMSmas --> maskedms@delphix32-4 --> maskedms --> tpcc
456+
Delphix33 : mask1clone --> mask1@delphix32-4
457+
Delphix33 : maskclone
458+
Delphix33 : Vracdb_70C --> racdb@delphix32-2
396459
397-
398460
399461
=cut

lib/Namespace_obj.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use strict;
2929
use Data::Dumper;
3030
use JSON;
3131
use Toolkit_helpers qw (logger);
32-
require Replication_obj;
3332

3433
# constructor
3534
# parameters
@@ -212,12 +211,12 @@ sub generate_replicate_mapping {
212211
my $self = shift;
213212
my $engine_parent = shift;
214213
my $timeflow_parent = shift;
214+
my $replication_parent = shift;
215215
logger($self->{_debug}, "Entering Namespace_obj::translateObject",1);
216216

217217

218218
my @namespace_list = $self->getNamespaceList();
219-
my $replication_parent = new Replication_obj ($engine_parent, $self->{_debug});
220-
219+
221220
my %object_hash;
222221

223222
for my $nsitem (@namespace_list) {

0 commit comments

Comments
 (0)