Creating a Sample Installation that Creates an Oracle Schema by Running Customized SQL Script

InstallShield 2016

Project • This information applies to the following project types:

Basic MSI
InstallScript MSI

The following procedure demonstrates how to create an installation that creates an Oracle schema through customized SQL script.

To create an installation that creates an Oracle schema on the target machine by running customized SQL script:

1. Create a new Basic MSI or InstallScript MSI project.
2. In the View List under Behavior and Logic, click Property Manager.
3. Create three new properties that have the following names:

IS_SQLSERVER_DATABASE2

IS_SQLSERVER_USERNAME2

IS_SQLSERVER_PASSWORD2

4. In the View List under Server Configuration, click SQL Scripts.
5. Add and configure a new SQL connection:
a. Right-click the SQL Scripts explorer and click New SQL Connection. InstallShield adds a new connection with the name NewConnection1 as the default name.
b. In the SQL Scripts explorer, click the NewConnection1 item, and then click the General tab.
c. In the Default Target Server Name (optional) box, type the following:

//sch01jsmith.installshield.com:1521/orcl

d. Clear the Create Catalog If Absent check box.
e. In the Connect using area, select the Server authentication using the Login ID and password below option.
f. In the Login ID box, type scott.
g. In the Password box, type scott.
h. Click the Requirements tab.
i. Ensure that the Oracle check box is selected and the Microsoft SQL Server and MySQL check boxes are cleared.
6. Add and configure a new SQL script for NewConnection1:
a. In the SQL Scripts explorer, right-click NewConnection1 and click New Script.
b. Change the name of the script to NewScript1.
c. In the SQL Scripts explorer, click NewScript1, and then click the Script tab.
d. In the script editor pane, add the following script:

CREATE TABLESPACE TEST_TS LOGGING DATAFILE 'test01.dbf' SIZE 1M AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED

Go

CREATE USER TEST_USER IDENTIFIED BY MYPSWD DEFAULT TABLESPACE TEST_TS QUOTA UNLIMITED on TEST_TS

Go

GRANT CONNECT TO TEST_USER

Go

GRANT DBA TO TEST_USER

Go

ALTER USER TEST_USER DEFAULT ROLE ALL

Go

 

e. Click the Runtime tab.
f. In the Script Execution area, select the Run Script During Login check box and ensure that the Run Script During Install and Run Script During Uninstall check boxes are cleared.
7. Add and configure a second new SQL connection:
a. Right-click the SQL Scripts explorer and click New SQL Connection. InstallShield adds a new connection with the name NewConnection2 as the default name.
b. In the SQL Scripts explorer, click the NewConnection2 item, and then click the Advanced tab.
c. In the Target Catalog Property Name list, select IS_SQLSERVER_DATABASE2.
d. In the Server Authentication Login ID Property Name list, select IS_SQLSERVER_USERNAME2.
e. In the Server Authentication Password Property Name list, select IS_SQLSERVER_PASSWORD2.
f. Click the General tab.
g. In the Catalog Name box, type TEST_USER.
h. Clear the Create Catalog If Absent check box.
i. In the Default Target Server Name (optional) box, type the following:

//sch01jsmith.installshield.com:1521/orcl

j. In the Connect using area, select the Server authentication using the Login ID and password below option.
k. In the Login ID box, type TEST_USER.
l. In the Password box, type MYPSWD.
m. Click the Requirements tab.
n. Ensure that the Oracle check box is selected and the Microsoft SQL Server and MySQL check boxes are cleared.
8. Add and configure a new SQL script for NewConnection2:
a. In the SQL Scripts explorer, right-click NewConnection2 and click New Script.
b. Change the name of the script to NewScript2.
c. In the SQL Scripts explorer, click NewScript2, and then click the Script tab.
d. In the script editor pane, add the following script:

CREATE TABLE TestTable (TestColumn1 CHAR NOT NULL PRIMARY KEY)

 

e. Click the Runtime tab.
f. In the Script Execution area, select the Run Script During Install check box and ensure that the Run Script During Login and Run Script During Uninstall check boxes are cleared.

When you run the installation, it creates the TEST_USER user and a TestTable table on the TEST_USER schema.

Project • You can achieve the same outcome when following the above procedure but using a DIM project, and then adding the DIM to an installation project.