Case Studies On DB2
Case Studies On DB2
Case 1 : Create tables and load Data 1. Create a database and few tablespaces 2. Create below tables TableA AC1 integer AC2 char(5) AC3 varchar(10) AC4 date AC5 ti esta p AC! integer
3. ,nsert 10 records each 4. -$port data and i port it bac. 5. Create a file of 2/3 0 records for TableA and load replace the data
Case 2 : Referential integrity 1. Create 1, between TA()-A and TA()-( 2. ,ll+strate the *2 delete cascade3restrict 3set 2")) options. 3. )oad replace the child table and chec. the table stat+s 4. 41*5 1,
Case 3 : Triggers and Stored procedure 1. Create a trigger which will insert a row in TA()-C (2ew table) when a row is deleted fro TA()-A 2. Create a &5 which will insert a record to TableA and then read all the rows fro TableA and displa' the res+lt set &elect 6 fro TableA where AC! 78so e val+e9
3. 4o a e$plain of the pac.age and r+n advise 4. Create an inde$ on TableA 3 AC! 5. 1+nstats on TableA !. 1ebind the pac.age and chec. e$plain again Case 4 : Range Partitioned table and Vie s 1. Create a TableC li.e tableA b+t a 1ange partitioned table based on AC1 val+es and load data 2. Create a view to select AC1:AC2 and (C1:(C2 fro 3. Create a <4C table Table4 the tables +sing a ;oin
Case ! : Reorg 1. 1+n online inde$ reorg for TableA 2. 1+n offline reorg and tableA and 3. 1+n online reorg for tableA and Case " : #ffline Bac$up and restore 1. Ta.e a offline bac.+p 2. 1estore the database Case % : #nline Bac$up and restore 1. Ta.e an online bac.+p 2. 1estore the database and roll forward to end of logs 3. Ta.e an online bac.+p 4. 1estore the database and roll forward to point in ti e Case & : Tablespace le'el Bac$up and Restore 1. ,nitiate a online tablespace bac.+p 2. 1estore the tablespace and rollforward till 5oint in ti e. Case ( : Database Redirected restore 1. 2. Ta.e a offline bac.+p 1estore the database to a new database in a new path onitor onitor
Case 11 : Event monitor Create!monitor and read the output for event monitor by restricting the ma" files generated to be limited to #$% Create a table and load data into it Create event monitor for that table Check if the event monitor is enabled and is functioning fine &erform D'( operations on that table after enabling event monitor )et the results of the logs generated by the event monitor% Turn off the event monitor once the *ob is done% epeat the same steps by creating event monitor for statements and transactions% Case 12 : Enabling and disabling rotating diagnostic logging. Case 13 : Perform schema copy using AD !"#C$P%#&C'E A procedure and db2move utility for schema of your choice Create a table with a user created schema and load data into it Copy the present source schema to a different target schema using both the above utilities% +t needs to be done on both same D, as well as different D, Case 1( : Create a non unicode D) and then convert to unicode D) * code set UTF-8+
Case 1! :
,dentity colu+ns
1. Create a table with identit' col+ n 2. ,nsert few records. 3. 1eset the identit' col+ n Case 1" : Script 1. =rite a script which will create a file and insert 100 records 2. =rite a script which will load the file created b' step 1 to a table 3. =rite a script which will do reorg3r+nstats on a table and ta.e a bac.+p