Documentation and installation guide of the information system PTDB.
How to setup up the database on your vm.
- Have db2 installed
- Have DbSchema installed
- (Optional) Have git installed
- Download the repository from GitHub (https://github.com/Skalt47/InfosysLab)
- Clone it via git
- Open the terminal and choose your location
- Clone the repository via
'git clone https://github.com/Skalt47/InfosysLab.git'
- Manual installation
- Go to the GitHub repository in your browser and click on
<> codethen download it as a zip-file - Extract the downloaded zip to your destination on your computer
- Go to the GitHub repository in your browser and click on
- Clone it via git
- Execute the
createdb.shinside the./Scriptsfolder (default name is test) *1- Creates a new database where DbSchema can connect to
- Creates staging tables which are necessary to load the data in
- Open the physical model
PTDB Physical Design §{version_number}inside DbSchema - In the upper toolbar click on the 'plug'-symbole (
<<your connection>>oroffline) and connect to the created database- Edit active connection
- If you already have a connection go on
Edit Active Connection:- Make sure to use the
jcc.DB2Driver - Below select
DB2for the JDBC URL (not manual - so that we can check the connection) - For
Server LocationchooseThis computer, default port - Under
Authenticationtype in your credentials for your machine - For
Databaseuse the name the database was created with (default name is test) - Now check the connection (
Check (Ping)) *2 - Press
Connectto continue
- Make sure to use the
- If you already have a connection go on
- Add new connection
- If you do not have a connection go on
Add Connection:- Edit the name of your connection if you want
- Make sure the
jcc.DB2Driveris selected - Below select
DB2for the JDBC URL (not manual - so that we can check the connection) - For
Server LocationchooseThis computer, default port - Under
Authenticationtype in your credentials for your machine - For
Databaseuse the name the database was created with (default name is test) - Now check the connection (
Check (Ping)) *2 - Press
Connectto continue
- If you do not have a connection go on
- Edit active connection
- Click on the arrow next to
Refresh Modeland choose the optionCreate or Upgrade Model in the Database - Check everthing to migrate, click
OkandExecute All - Execute the
insert_select_all.shinside the./Scriptsfolder (default name is test)- Functions as an 'Entry Point' and inserts the raw data into the staging tables then activtes the scripts to insert data into the model
Now you can connect to the database (default name is test) and for example check the views.
Unexpected problems can occur during the setup. Most, known to us, are listed here with solutions.
*1 Dropping of the old database failed
If this message ( SQL1035N The operation failed because the specified database cannot be connected to in the mode requested. SQLSTATE=57019 ) shows up after trying to drop the database there are ongoing connections to the database.
To solve this problem disconnect all clients from the database and try again.
If you do not know the clients who are connected try to restart the whole service and force a disconnect on all connected clients.
*2 Connection on default port failed
If the connection fails on the default port the service is either not running or listening on a different port.
Check if the service is stopped and may start it again.
If the service was running then db2 is not listening on port 5000 (default port).
You either change it manualy in the configuration file or try to connect to the used port.
Find out the service name and the corresponding TCP/IP port:
- Use the terminal and typ in
'db2 get dbm cfg' - Look for
(SVCENAME). You should find a name similar todb2c_${instance_name} - Now search for your service name in the
servicesfile and find out the port- On Linux:
/etc/services - On Windows:
C:\winnt\system32\drivers\etc\services
- On Linux:
Fix the port connection:
Change the port in the file to the default port 50000 also used by DbSchema.
Then restart the service.
OR
When you already have other clients or applications using this port then change the port in DbSchema.
Therefore edit your connection and select Remote computer or custom port instead of This computer, default port.
Still use localhost as the server host but change the port to the one in the file.
Then try to connect again.
Documentation of the process and the overall concept of the information system.
- DbSchema does not save SQL scripts inside the Logical Design
- Auto increments get lost while generating a Pyhsical Design
Order BySQL-Statements are not allowed while creating a view- DbSchema does not handle comments on views correctly
- Db2 does not allow comments on a view. They need to get treaded like a table to comment on.
DbSchema generates SQL-Commands with
Comment On Viewinstead ofComment On Tablewhich must be change during the execution.
- Db2 does not allow comments on a view. They need to get treaded like a table to comment on.
DbSchema generates SQL-Commands with
When updating the model the Physical and therefore the Logical Design need to be changed.
If major changes will be made to the Logical and Physical Design store the current Designs in the ./Old Database Designs folder and create new ones with an updated version number.
When generating the Physical Design out of the Logical Design make sure to set the auto increments again because those get lost while generating.
Setting auto increment in the Physical Design (OFFERINGID, REDUCTIONID):
- Hover and double click on the attribute which should have an auto increment
- One the bottom right click on the arrow to open up an
Options Dialog(the corresponding textbox should contain something likeQAUTO_INCREMENTE) - Check
GENERATE,ALWAYS,AS IDENTITYandSTARTS WITH - As
startValueandincrementValueuse 1 - Then save all
Here is the history of the different logical and physical models created with DbSchema listed.
v_1 (logical only) dropped
Consists of the first data model which was only inspired by some screenshots. Therefore it was quickly out-of-date when the actual data was delivered.
Had also user views grouping tables to fit a personalized need.
v_2 (logical only)
A better worked out data model based on the first version.
v_3 (first model based on actual data)
First screach of a data model with the delivered unnormalized data.
v_4 (first functional one)
Working data model with Lecturer, WorkloadReduction, Term, OfferedCourse and Subject.
Everything based on the unnormalized data provided. Each attribute accept of some auto increment ids is from the tables which hold the unnormalized data.
v_5 (with views)
Based on the fourth version there are also views implemented which show some functionality of this information system.
v_6 (corrected views) latest
The views and the entities were sligthly corrected, after some mistakes were found in the meeting with the professor. Got rid of offeringid and switched to a composite key of sbjno, lecno and term. Corrected the view workloadbalance, calculation (sum) was faulty and if a lecture of 2 studyprg is combined, now so is the cntlec (only calculated once and not twice).
Fill out the history path...
Write more if needed...