|
108 | 108 | }
|
109 | 109 |
|
110 | 110 |
|
111 |
| -if ( ( ( $type eq 'oracle') || ( $type eq 'mssql') ) && (! defined($targetDirectory)) ) { |
112 |
| - print "Option targetDirectory is required. \n"; |
113 |
| - pod2usage(-verbose => 1, -input=>\*DATA); |
114 |
| - exit (1); |
115 |
| -} |
116 |
| - |
117 | 111 |
|
118 | 112 | # this array will have all engines to go through (if -d is specified it will be only one engine)
|
119 | 113 | my $engine_list = Toolkit_helpers::get_engine_list($all, $dx_host, $engine_obj);
|
|
166 | 160 |
|
167 | 161 |
|
168 | 162 | if ( $db->setSource($source) ) {
|
169 |
| - print "Problem with setting source. V2P won't be created.\n"; |
170 |
| - exit(1); |
| 163 | + print "Problem with setting source. V2P won't be started.\n"; |
| 164 | + $ret = $ret + 1; |
| 165 | + next; |
171 | 166 | }
|
172 | 167 |
|
173 | 168 | if ( $db->setTimestamp($timestamp) ) {
|
174 | 169 | print "Problem with setting timestamp $timestamp. V2P process won't be started.\n";
|
175 |
| - exit(1); |
| 170 | + $ret = $ret + 1; |
| 171 | + next; |
176 | 172 | }
|
177 | 173 |
|
178 | 174 | $db->setName($dbname, $dbname);
|
179 | 175 |
|
180 | 176 | if ( $db->setEnvironment($environment, $envUser) ) {
|
181 |
| - print "Environment $environment or user $envUser not found. VDB won't be created\n"; |
| 177 | + print "Environment $environment or user $envUser not found. V2P process won't be started\n"; |
182 | 178 | $ret = $ret + 1;
|
183 | 179 | next;
|
184 | 180 | }
|
|
188 | 184 |
|
189 | 185 | if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory, $useabsolute) ) {
|
190 | 186 | print "Problem with export file system layout. Is targetDiretory and dataDirectory set ?\n";
|
191 |
| - exit(1); |
| 187 | + $ret = $ret + 1; |
| 188 | + next; |
192 | 189 | }
|
193 | 190 |
|
194 | 191 | if ( defined($template) ) {
|
195 | 192 | if ( $db->setTemplateV2P($template) ) {
|
196 |
| - print "Template $template not found. V2P process won't be created\n"; |
197 |
| - exit(1); |
| 193 | + print "Template $template not found. V2P process won't be started\n"; |
| 194 | + $ret = $ret + 1; |
| 195 | + next; |
198 | 196 | }
|
199 | 197 | }
|
200 | 198 |
|
201 | 199 | if ( defined($map_file) ) {
|
202 |
| - my $filemap_obj = new FileMap($engine_obj,$debug); |
| 200 | + my $filemap_obj = new FileMap($engine_obj,$type,$debug); |
203 | 201 | $filemap_obj->loadMapFile($map_file);
|
204 | 202 | $filemap_obj->setSource($source);
|
205 | 203 | if ($filemap_obj->validate()) {
|
206 |
| - die ("Problem with mapping file. V2P process won't be created.") |
| 204 | + print ("Problem with mapping file. V2P process won't be started.\n"); |
| 205 | + $ret = $ret + 1; |
| 206 | + next; |
207 | 207 | }
|
208 | 208 |
|
209 | 209 | $db->setMapFileV2P($filemap_obj->GetMapping_rule());
|
|
217 | 217 | if (defined($concurrentfiles)) {
|
218 | 218 | if ($db->setFileParallelism($concurrentfiles)) {
|
219 | 219 | print "Problem with setting number of concurrent files\n";
|
220 |
| - exit(1); |
| 220 | + $ret = $ret + 1; |
| 221 | + next; |
221 | 222 | }
|
222 | 223 | };
|
223 | 224 |
|
|
227 | 228 | }
|
228 | 229 | elsif ($type eq 'mssql') {
|
229 | 230 |
|
230 |
| - if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory) ) { |
| 231 | + if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory) ) {; |
231 | 232 | print "Problem with export file system layout. Is targetDiretory and dataDirectory set ?\n";
|
232 |
| - exit(1); |
| 233 | + $ret = $ret + 1; |
| 234 | + next; |
233 | 235 | }
|
234 | 236 |
|
| 237 | + if ( defined($map_file) ) { |
| 238 | + my $filemap_obj = new FileMap($engine_obj,$type,$debug); |
| 239 | + $filemap_obj->loadMapFile($map_file); |
| 240 | + $filemap_obj->setSource($source); |
| 241 | + if ($filemap_obj->validate($db->{"NEWDB"}->{"filesystemLayout"})) { |
| 242 | + print("Problem with mapping file. V2P process won't be started.\n"); |
| 243 | + $ret = $ret + 1; |
| 244 | + next; |
| 245 | + } |
| 246 | + |
| 247 | + $db->setMapFileV2P($filemap_obj->GetMapping_rule()); |
| 248 | + |
| 249 | + } |
| 250 | + |
| 251 | + |
235 | 252 | if (defined($norecovery)) {
|
236 | 253 | $db->setNoRecovery();
|
237 | 254 | }
|
@@ -341,7 +358,20 @@ =head2 V2P arguments
|
341 | 358 | Target VDB template name (for Oracle)
|
342 | 359 |
|
343 | 360 | =item B<-mapfile>
|
344 |
| -Target VDB mapping file (for Oracle) |
| 361 | +Target VDB mapping file. Use colon as separator for both MS SQL and Oracle |
| 362 | +Dxtoolkit will use a proper separator for API call. |
| 363 | +
|
| 364 | +
|
| 365 | +Oracle mapfile example: |
| 366 | +
|
| 367 | +# this is comment |
| 368 | +/u01:/u02 |
| 369 | +
|
| 370 | +MS SQL mapfile example: |
| 371 | +
|
| 372 | +# this is comment |
| 373 | +Biscuit_Data_1.ndf : c:\\tmp\\los1\\slon_Data_1.ndf |
| 374 | +Biscuit_Bogus_1_data.ndf : c:\\tmp\\los2\\slon_Bogus_1_data.ndf |
345 | 375 |
|
346 | 376 | =item B<-instname>
|
347 | 377 | Target VDB instance name (for Oracle)
|
|
0 commit comments