1
- #
1
+ #
2
2
# Licensed under the Apache License, Version 2.0 (the "License");
3
3
# you may not use this file except in compliance with the License.
4
4
# You may obtain a copy of the License at
5
- #
5
+ #
6
6
# http://www.apache.org/licenses/LICENSE-2.0
7
- #
7
+ #
8
8
# Unless required by applicable law or agreed to in writing, software
9
9
# distributed under the License is distributed on an "AS IS" BASIS,
10
10
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
45
my $timestamp = ' LATEST_SNAPSHOT' ;
46
46
47
47
GetOptions(
48
- ' help|?' => \(my $help ),
49
- ' d|engine=s' => \(my $dx_host ),
48
+ ' help|?' => \(my $help ),
49
+ ' d|engine=s' => \(my $dx_host ),
50
50
' sourcename=s' => \(my $sourcename ),
51
- ' srcgroup=s' => \(my $srcgroup ),
52
- ' dbname=s' => \(my $dbname ),
53
- ' instname=s' => \(my $instname ),
54
- ' uniqname=s' => \(my $uniqname ),
55
- ' environment=s' => \(my $environment ),
56
- ' type=s' => \(my $type ),
51
+ ' srcgroup=s' => \(my $srcgroup ),
52
+ ' dbname=s' => \(my $dbname ),
53
+ ' instname=s' => \(my $instname ),
54
+ ' uniqname=s' => \(my $uniqname ),
55
+ ' environment=s' => \(my $environment ),
56
+ ' type=s' => \(my $type ),
57
57
' envinst=s' => \(my $envinst ),
58
58
' template=s' => \(my $template ),
59
59
' mapfile=s' => \(my $map_file ),
71
71
' dspusecompression' => \(my $dspusecompression ),
72
72
' dspuseencryption' => \(my $dspuseencryption ),
73
73
' dever=s' => \(my $dever ),
74
- ' debug:n' => \(my $debug ),
74
+ ' debug:n' => \(my $debug ),
75
75
' all' => (\my $all ),
76
76
' version' => \(my $print_version ),
77
77
' configfile|c=s' => \(my $config_file )
80
80
81
81
82
82
pod2usage(-verbose => 2, -input => \*DATA ) && exit if $help ;
83
- die " $version \n " if $print_version ;
83
+ die " $version \n " if $print_version ;
84
84
85
85
86
86
my $engine_obj = new Engine ($dever , $debug );
109
109
if ( ( ( $type eq ' oracle' ) || ( $type eq ' mssql' ) ) && (! defined ($targetDirectory )) ) {
110
110
print " Option targetDirectory is required. \n " ;
111
111
pod2usage(-verbose => 1, -input => \*DATA );
112
- exit (1);
112
+ exit (1);
113
113
}
114
114
115
115
116
116
# this array will have all engines to go through (if -d is specified it will be only one engine)
117
- my $engine_list = Toolkit_helpers::get_engine_list($all , $dx_host , $engine_obj );
117
+ my $engine_list = Toolkit_helpers::get_engine_list($all , $dx_host , $engine_obj );
118
118
119
119
my $ret = 0;
120
120
150
150
}
151
151
152
152
my $source = ($databases -> getDB($source_ref -> [0]));
153
-
153
+
154
154
155
155
# create a new DB object
156
156
if ( $type eq ' oracle' ) {
186
186
if ( $db -> setTemplate($template ) ) {
187
187
print " Template $template not found. V2P process won't be created\n " ;
188
188
exit (1);
189
- }
189
+ }
190
190
}
191
191
192
192
if ( defined ($map_file ) ) {
193
193
my $filemap_obj = new FileMap($engine_obj ,$debug );
194
194
$filemap_obj -> loadMapFile($map_file );
195
- $filemap_obj -> setSource($sourcename );
195
+ $filemap_obj -> setSource($source );
196
196
if ($filemap_obj -> validate()) {
197
197
die (" Problem with mapping file. V2P process won't be created." )
198
198
}
215
215
$db -> setDSP($dspconnections , $dspusecompression , $dspuseencryption );
216
216
$jobno = $db -> v2pSI($environment ,$envinst );
217
217
218
- }
218
+ }
219
219
elsif ($type eq ' mssql' ) {
220
220
221
221
if ( $db -> setFileSystemLayout($targetDirectory ,$archiveDirectory ,$dataDirectory ,$externalDirectory ,$scriptDirectory ,$tempDirectory ) ) {
222
222
print " Problem with export file system layout. Is targetDiretory and dataDirectory set ?\n " ;
223
223
exit (1);
224
224
}
225
-
225
+
226
226
if (defined ($norecovery )) {
227
227
$db -> setNoRecovery();
228
228
}
229
229
$jobno = $db -> v2p($environment ,$envinst );
230
- }
230
+ }
231
231
elsif ($type eq ' sybase' ) {
232
232
if (defined ($norecovery )) {
233
233
$db -> setNoRecovery();
234
234
}
235
235
$jobno = $db -> v2p($environment ,$envinst );
236
- }
236
+ }
237
237
238
238
$ret = $ret + Toolkit_helpers::waitForJob($engine_obj , $jobno , " V2P finished." ," Problem with V2P process" );
239
-
239
+
240
240
}
241
241
242
242
247
247
=head1 SYNOPSIS
248
248
249
249
dx_v2p [ -engine|d <delphix identifier> | -all ] [ -configfile file ]
250
- -sourcename src_name
251
- -dbname db_name
252
- -environment environment_name
253
- -type oracle|mssql|sybase
250
+ -sourcename src_name
251
+ -dbname db_name
252
+ -environment environment_name
253
+ -type oracle|mssql|sybase
254
254
-envinst OracleHome/MSSQLinstance/SybaseInstance
255
- [ -targetDirectory target_directory ]
255
+ [ -targetDirectory target_directory ]
256
256
[ -timestamp LATEST_SNAPSHOT|LATEST_POINT|time_stamp ]
257
- [ -template template_name ]
258
- [ -mapfile mapping_file ]
257
+ [ -template template_name ]
258
+ [ -mapfile mapping_file ]
259
259
[ -norecovery ]
260
260
[ -noopen ]
261
- [ -instname SID ]
262
- [ -uniqname db_unique_name ]
263
- [ -archiveDirectory arch_directory ]
261
+ [ -instname SID ]
262
+ [ -uniqname db_unique_name ]
263
+ [ -archiveDirectory arch_directory ]
264
264
[ -dataDirectory data_dir ]
265
- [ -externalDirectory external_dir ]
265
+ [ -externalDirectory external_dir ]
266
266
[ -tempDirectory temp_dir ]
267
267
[ -dspconnections=n ]
268
268
[ -dspusecompression ]
269
269
[ -dspuseencryption ]
270
270
[ -concurrentfiles=n ]
271
- [ -help]
271
+ [ -help]
272
272
[ -debug]
273
273
274
274
@@ -373,7 +373,7 @@ =head1 OPTIONS
373
373
374
374
=over 2
375
375
376
- =item B<-help >
376
+ =item B<-help >
377
377
Print this screen
378
378
379
379
=item B<-debug >
@@ -383,10 +383,10 @@ =head1 OPTIONS
383
383
384
384
=head1 EXAMPLES
385
385
386
- Oracle V2P process
386
+ Oracle V2P process
387
387
388
388
dx_v2p -d Landshark -sourcename testdx -dbname v2p -environment LINUXTARGET -type oracle -envinst "/u01/app/oracle/product/11.2.0/dbhome_1" -targetDirectory /data/u02/v2p
389
- Starting provisioning job - JOB-231
389
+ Starting provisioning job - JOB-231
390
390
0 - 2 - 3 - 5 - 6 - 7 - 8 - 9 - 10 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 46 - 47 - 49 - 50 - 51 - 52 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100
391
391
Job JOB-231 finised with state: COMPLETED
392
392
V2P job finished with COMPLETED status.
@@ -408,5 +408,3 @@ =head1 EXAMPLES
408
408
V2P finished..
409
409
410
410
=cut
411
-
412
-
0 commit comments