Installing the database objects
We are going to create the database objects for the next examples, by using a script provided called 4842_01_01.sh
In the next examples we will be configuring a concurrent program that calls a host program. The script we are going to run will create a sequence, synonym, and package for our host program call. We will also create a package that will handle all of the database transactions such as insert, update, and delete. Finally, we will create a sequence that will be used to generate a unique number for new filenames. The following provides details of how to run the script.
How to do it...
To create the database objects required for this chapter perform the following tasks:
1. Create a local directory
c:\packt\scripts\ch1
where the scripts are downloaded and extracted to.2. Open Putty and connect to the application tier user.
3. Create a new directory on the application tier under
$XXHR_TOP/install
as follows:cd $XXHR_TOP/install mkdir ch1
4. Navigate to the new directory
ch1
as follows:cd ch1
5. Open WinSCP and transfer the files from
c:\packt\scripts\ch1
on your local machine to the$XXHR_TOP/install/ch1
directory on the application server, as shown in the following screenshot:6. In Putty, change the permissions of the script with the following command:
chmod 775 4842_01_01.sh
7. Run the following script to create all of the objects by issuing the following command:
./4842_01_01.sh apps/apps
8. The script checks that all of the files are present in your
$XXHR_TOP/install/ch1
directory and will prompt you to continue if they are all there, so type Y and press return.9. After the script has completed, check the
XXHR_4842_01_01.log
file for errors. (It will be created in the same directory$XXHR_TOP/install/ch1.)
10. Run the following query to check that all of the objects have been created successfully:
SELECT OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS FROM ALL_OBJECTS WHERE OBJECT_NAME LIKE 'XXHR_EMAIL%' OR OBJECT_NAME LIKE 'XXHR%BATCH%' ORDER BY 1, 2
11. This is shown in the following screenshot:
How it works...
We have created a number of objects that we are going to use in the coming recipes. We have created a synonym to the apps user as all of our objects need to be accessed by this user. The sequence we have created will generate a unique number each time a new file is created. Finally, the package we have created contains all of the procedures and functions relating to database activity for calling our host program.