Skip to content

Commit 921a49d

Browse files
author
Marcin Przepiorowski
committed
initial staging push - MSSQL
1 parent dc85877 commit 921a49d

File tree

4 files changed

+271
-147
lines changed

4 files changed

+271
-147
lines changed

bin/dx_ctl_dsource.pl

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
'presync=s@' =>\(my $presync),
8585
'postsync=s@' =>\(my $postsync),
8686
'hooks=s' => \(my $hooks),
87+
'stagingpush' => \(my $stagingpush),
8788
'dever=s' => \(my $dever),
8889
'debug:n' => \(my $debug),
8990
'all' => (\my $all),
@@ -140,7 +141,15 @@
140141
exit (1);
141142
}
142143

143-
if ( ( lc $type ne 'db2' ) && ( ! ( defined($type) && defined($sourcename) && defined($dsourcename) && defined($source_os_user) && defined($group) ) ) ) {
144+
145+
if (defined($stagingpush)) {
146+
if (! defined($group)) {
147+
print "For staging push -group is required. \n";
148+
pod2usage(-verbose => 1, -input=>\*DATA);
149+
exit (1);
150+
}
151+
}
152+
elsif ( ( lc $type ne 'db2' ) && ( ! ( defined($type) && defined($sourcename) && defined($dsourcename) && defined($source_os_user) && defined($group) ) ) ) {
144153
print "Options -sourcename, -dsourcename, -group, -source_os_user are required. \n";
145154
pod2usage(-verbose => 1, -input=>\*DATA);
146155
exit (1);
@@ -207,18 +216,20 @@
207216

208217
if (((lc $action eq 'attach') || (lc $action eq 'create')) && (( lc $type ne 'db2' ) && ( lc $type ne 'vfiles' ) && (! ( defined($dbuser) && defined($password) ) ) ) ) {
209218
# no db user exceptions
210-
if (( lc $type eq 'mssql' ) && ( lc $dbusertype eq 'environment' ) ) {
211-
$dbuser = $source_os_user;
212-
} elsif (lc $type eq 'oracle') {
213-
if ( ! (version->parse($engine_obj->getApi()) >= version->parse(1.11.7) ) ) {
214-
print "Options -dbuser and -password are required for Oracle for version lower than 6.0.7 \n";
215-
pod2usage(-verbose => 1, -input=>\*DATA);
216-
exit (1)
217-
}
218-
} else {
219-
print "Options -dbuser and -password are required for non vFiles dsources. \n";
220-
pod2usage(-verbose => 1, -input=>\*DATA);
221-
exit (1);
219+
if (!defined($stagingpush)) {
220+
if (( lc $type eq 'mssql' ) && ( lc $dbusertype eq 'environment' ) ) {
221+
$dbuser = $source_os_user;
222+
} elsif (lc $type eq 'oracle') {
223+
if ( ! (version->parse($engine_obj->getApi()) >= version->parse(1.11.7) ) ) {
224+
print "Options -dbuser and -password are required for Oracle for version lower than 6.0.7 \n";
225+
pod2usage(-verbose => 1, -input=>\*DATA);
226+
exit (1)
227+
}
228+
} else {
229+
print "Options -dbuser and -password are required for non vFiles dsources. \n";
230+
pod2usage(-verbose => 1, -input=>\*DATA);
231+
exit (1);
232+
}
222233
}
223234
}
224235

@@ -308,9 +319,9 @@
308319
my $source = ($databases->getDB($source_ref->[0]));
309320

310321
if ( $type eq 'oracle' ) {
311-
$jobno = $source->attach_dsource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$cdbcont);
322+
$jobno = $source->attach_dsource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$cdbcont, $stagingpush);
312323
} else {
313-
$jobno = $source->attach_dsource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$stageenv,$stageinst,$stage_os_user, $backup_dir, $validatedsync, $delphixmanaged, $compression, $dbusertype);
324+
$jobno = $source->attach_dsource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$stageenv,$stageinst,$stage_os_user, $backup_dir, $validatedsync, $delphixmanaged, $compression, $dbusertype, $stagingpush);
314325
}
315326

316327

@@ -357,7 +368,7 @@
357368
$ret = $ret + 1;
358369
last;
359370
}
360-
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$dsourcename,$group,$logsync, $cdbcont);
371+
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$dsourcename,$group,$logsync, $cdbcont, $stagingpush);
361372
}
362373
elsif ($type eq 'sybase') {
363374
my $db = new SybaseVDB_obj($engine_obj,$debug);
@@ -373,7 +384,7 @@
373384
$ret = $ret + 1;
374385
last;
375386
}
376-
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$dsourcename,$group,$logsync,$stageenv,$stageinst,$stage_os_user, $backup_dir, $dumppwd, $validatedsync, $delphixmanaged, $compression, $dbusertype, \%commvault);
387+
$jobno = $db->addSource($sourcename,$sourceinst,$sourceenv,$source_os_user,$dbuser,$password,$dsourcename,$group,$logsync,$stageenv,$stageinst,$stage_os_user, $backup_dir, $dumppwd, $validatedsync, $delphixmanaged, $compression, $dbusertype, \%commvault, $stagingpush);
377388
}
378389
elsif ($type eq 'vFiles') {
379390
my $db = new AppDataVDB_obj($engine_obj,$debug);
@@ -487,6 +498,7 @@ =head1 SYNOPSIS
487498
[-hooks path_to_hooks]
488499
[-presync [hookname,]template|filename[,OS_shell] ]
489500
[-postsync [hookname,]template|filename[,OS_shell] ]
501+
[-stagingpush]
490502
[-debug ]
491503
[-version ]
492504
[-help|? ]
@@ -615,6 +627,9 @@ =head2 dSource arguments
615627
=item B<-commstagingclient Commvault staging name>
616628
Commvault staging name
617629
630+
=item B<-stagingpush>
631+
Create dsource using staging push technology ( current support MS SQL )
632+
618633
=item B<-hadr hadrPrimarySVC:XXX,hadrPrimaryHostname:hostname,hadrStandbySVC:YYY>
619634
Add DB2 dSource with HADR support
620635
Parameter hadrTargetList is optional.

0 commit comments

Comments
 (0)