Some schemas are dependent on other schemas; they need to be installed in alphabetical order.
Installing the schemas
Use Perl for
in place editing:
__SUB__CWD__
must be replaced with the current directory.
PowerShell
PS> perl.exe -Mopen="IO,:raw" -i -p -e "s#__SUB__CWD__#$($pwd -replace '\\', '/' )#g" (get-childItem *.sql,*/*.sql,*/*.dat)
Windows: Grant access rights on some files
$oracle_service_name = 'NT SERVICE\OracleServiceORA19'
$accessRule = new-object System.Security.AccessControl.FileSystemAccessRule `
'NT SERVICE\OracleServiceORA19' , `
([System.Security.AccessControl.FileSystemRights]::FullControl) , `
([System.Security.AccessControl.AccessControlType]::Allow)
foreach ($file in get-childItem -recurse -file -include *xsd,*xsl,*.xml order_entry) {
$acl = get-acl $file.fullName
$acl.AddAccessRule($accessRule)
set-acl $file.fullName $acl
}
Show executed script
For each line in the *.sql
scripts that start with @
, add another line that writes the name of the executed SQL script so that errors during the installation can be easier located.
perl.exe -Mopen="IO,:raw" -i'.bak' -p -e "s#^(\s*)@(.*)$#prompt exec script `$2;\n`$1\@`$2#" (get-childItem *.sql,*/*.sql)
Remove .bak files:
PS> get-childItem -re *.bak | % { rm $_}
Install
Because OE needs MDSYS, make sure that Oracle Spatial is installed.
Run the
mksample.sql
script in
SQL*Plus. This script creates all 5 sample schemas. If any of those schemas already exists, they will be dropped first.
If set in the
login.sql
file, consider making sure that
plsql_warnings
is disabled in order to focus on error messages and not be distracted by warnings.
Note: the final slash in the path of the log directory seems to be required:
rem mkdir log
sqlplus system/iAmSystem
SQL> @mksample iAmSystem iAmSysdba hrPw oePw pmPw ixPw shPw biPw DATA TEMP log/ ora19
sqlplus system/iAmSystem@Ora19 `@mksample iAmSystem iAmSysdba hrPw oePw pmPw ixPw shPw biPw DATA TEMP log/ ora19 | foreach-object {
$line = $_
$line = $line -replace '^(error|warning).*|^SP2-', "$([char]27)[38;5;9m$line$([char]27)[0m"
$line = $line -replace '^(\s*exec script).*|^SP2-', "$([char]27)[32;5;9m$line$([char]27)[0m"
$line
}
TODO
Unlocking HR
The HR account is supposed to be locked after the installation and must be unlocked befor logging on as HR. However, I found this information to be wrong. Anyway, the account can be unlocked with
SQ> alter user hr identified by your_password account unlock;