|
28 | 28 | use Pod::Usage; |
29 | 29 | use FindBin; |
30 | 30 | use Data::Dumper; |
| 31 | +use version; |
31 | 32 |
|
32 | 33 | my $abspath = $FindBin::Bin; |
33 | 34 |
|
|
39 | 40 | use Toolkit_helpers; |
40 | 41 | use FileMap; |
41 | 42 |
|
42 | | -my $version = $Toolkit_helpers::version; |
| 43 | +my $dxversion = $Toolkit_helpers::version; |
43 | 44 |
|
44 | 45 | my $logsync = "no"; |
45 | 46 | my $compression = "no"; |
|
84 | 85 |
|
85 | 86 |
|
86 | 87 | pod2usage(-verbose => 2, -input=>\*DATA) && exit if $help; |
87 | | -die "$version\n" if $print_version; |
| 88 | +die "$dxversion\n" if $print_version; |
88 | 89 |
|
89 | 90 |
|
90 | 91 | my $engine_obj = new Engine ($dever, $debug); |
|
138 | 139 |
|
139 | 140 |
|
140 | 141 |
|
141 | | - if (( lc $type ne 'db2' ) && ( lc $type ne 'vfiles' ) && (! ( defined($dbuser) && defined($password) ) ) ) { |
142 | | - if (( lc $type eq 'mssql' ) && ( lc $dbusertype eq 'environment' ) ) { |
143 | | - $dbuser = $source_os_user; |
144 | | - } else { |
145 | | - print "Options -dbuser and -password are required for non vFiles dsources. \n"; |
146 | | - pod2usage(-verbose => 1, -input=>\*DATA); |
147 | | - exit (1); |
148 | | - } |
149 | | - } |
150 | | - |
151 | | - |
152 | 142 | if (( lc $type eq 'sybase' ) && ( ! ( defined($stage_os_user) && defined($stageinst) && defined($stageenv) && defined($backup_dir) && defined($sourceinst) && defined($sourceenv) ) ) ) { |
153 | 143 | print "Options -stage_os_user, -stageinst, -stageenv, -sourceinst, -sourceenv and -backup_dir are required. \n"; |
154 | 144 | pod2usage(-verbose => 1, -input=>\*DATA); |
|
189 | 179 | next; |
190 | 180 | }; |
191 | 181 |
|
| 182 | + |
| 183 | + if (((lc $action eq 'attach') || (lc $action eq 'create')) && (( lc $type ne 'db2' ) && ( lc $type ne 'vfiles' ) && (! ( defined($dbuser) && defined($password) ) ) ) ) { |
| 184 | + # no db user exceptions |
| 185 | + if (( lc $type eq 'mssql' ) && ( lc $dbusertype eq 'environment' ) ) { |
| 186 | + $dbuser = $source_os_user; |
| 187 | + } elsif (lc $type eq 'oracle') { |
| 188 | + if ( ! (version->parse($engine_obj->getApi()) >= version->parse(1.11.7) ) ) { |
| 189 | + print "Options -dbuser and -password are required for Oracle for version lower than 6.0.7 \n"; |
| 190 | + pod2usage(-verbose => 1, -input=>\*DATA); |
| 191 | + exit (1) |
| 192 | + } |
| 193 | + } else { |
| 194 | + print "Options -dbuser and -password are required for non vFiles dsources. \n"; |
| 195 | + pod2usage(-verbose => 1, -input=>\*DATA); |
| 196 | + exit (1); |
| 197 | + } |
| 198 | + } |
| 199 | + |
| 200 | + |
192 | 201 | my $db; |
193 | 202 | my $jobno; |
194 | 203 |
|
|
0 commit comments