db2經典實驗內容,希望大家趕快動手!(第3部)
db2經典實驗內容,希望大家趕快動手!(第3部)[@more@]DB2 Migration Workshop
LAB 2 – Working with buffer pools and tablespaces
Expected duration: 45 mins
This lab will help you solidify concepts of buffer pools and tablespaces. It is to be completed following the presentation “DB2 Bufferpools and tablespaces”.
The following commands are demonstrated:
ALTER TABLESPACE ALTER BUFFERPOOL
CREATE TABLESPACE CREATE BUFFERPOOL
LIST TABLESPACES DROP BUFFERPOOL
LIST TABLESPACE CONTAINERS
DROP TABLESPACE CREATE TABLE … IN
Prerequisites:
· DB2 Version 8 Server has been installed
· Completion of Lab1 (requires sample database created)
Highly Recommended: Before each step in this lab, locate the demonstrated command in the CLP quick reference and mark it with an asterix (*). This will help you get familiar with the DB2 CLP cheat sheet.
1. Connect to the sample database and view the tablespaces that currently exist
db2 list tablespaces show detail
From the output of the above command, fill in the following chart
TS ID TS Name TS Type TS Page Size
2. Now you’ll create your own table space which uses an 8K page size for data, and a separate 4K page size tablespace for indexes. Before an 8K tablespace can be created, however, an 8K buffer pool must first exist. Create an 8K buffer pool MYBP8K which uses 1000 pages (8MB).
db2 create bufferpool MYBP8K size 1000 pagesize 8K
Next, create a tablespace called MYTS8K which uses the 8K bufferpool.
db2 create tablespace MYTS8K pagesize 8K
managed by database using (
FILE ‘c:myts8k.0’ 1000,
FILE ‘c:myts8k.1’ 1000)
extentsize 8
prefetchsize 16
bufferpool MYBP8K
What type of table space was just created? (DMS or SMS) __________________
How many containers are in this table space? __________________
What is the purpose of using backslash ? __________________
How many kilobytes of data will be written to myts8k.0 before data is written to myts8k.1 (note: calculation required)? Why?
____________________________________________________________________
____________________________________________________________________
In order to store indexes separately from data, DMS tablespaces are required. From step 1, you should have identified that all tablespaces in SAMPLE are SMS. Therefore, we need to create a 4K DMS tablespace to store index data.
db2 create tablespace MYTS4K_IDX pagesize 4K
managed by database using (FILE ‘c:myts4k_idx.0’ 1000)
extentsize 8
prefetchsize 8
bufferpool IBMDEFAULTBP
Which buffer pool is being used by MYTS4K_IDX? __________________
How many kilobytes of data per extent in this tablespace? __________________
3. Take a look at the bufferpools that currently exist (and their sizes)
db2 “select * from syscat.bufferpools”
4. See all the tablespaces just created by repeating step 1. Complete the table by adding the additional information for the tablespaces just created. Show the containers for table space MYTS8K and MYTS4K_IDX
db2 list tablespace containers for
(substitute with the table space ID of MYTS8K and MYTS4K_IDX)
5. How many data pages are free and used in MYTS8K and MYTS4K_IDX?
db2 list tablespaces show detail
Fill in the following information for MYTS8K
Used pages: __________________
Free pages: __________________
High watermark: __________________
Fill in the following information for MYTS4K_IDX
Used pages: __________________
Free pages: __________________
High watermark: __________________
6. Create a table with the following DDL:
db2 create table T1
(id bigint not null primary key,
data char(100),
insert_ts timestamp)
IN MYTS8K
INDEX IN MYTS4K_IDX
If you look at the output of list tablespaces show detail, you’ll see that additional pages have been used in both MYTS8K and MYTS4K_IDX. We expect that pages will be allocated in the data tablespace (overhead data pages for a table). But why are additional pages allocated MYTS4K_IDX?
____________________________________________________________________
____________________________________________________________________
7. The bufferpool sized at 1000 pages is too small for any real use. In version 8, bufferpools, in most cases, can be dynamically changed (you will be given a warning if it is not dynamic) using ALTER BUFFERPOOL
Tip: You can use OS monitoring tools to see the memory use increase.
db2 alter bufferpool ibmdefaultbp size 5000
db2 alter bufferpool mybp8k size 5000
What are the new sizes of each bufferpool, in megabytes?
IBMDEFAULTBP _________________
MYBP8K _________________
8. Tablespace characteristics can also be altered using ALTER TABLESPACE. In this step, increase the aggressiveness of index prefetching
db2 alter tablespace MYTS4K_IDX prefetchsize 16
9. Launch the DB2 Control Center to visually identify the objects you just created
· Table
· Index
· Tablespaces
· Tablespace Containers
· Bufferpools
10. Clean up objects created by this lab exercise:
db2 drop table T1
db2 drop tablespace MYTS8K
db2 drop tablespace MYTS4K_IDX
db2 drop bufferpool MYBP8K
LAB 2 – Working with buffer pools and tablespaces
Expected duration: 45 mins
This lab will help you solidify concepts of buffer pools and tablespaces. It is to be completed following the presentation “DB2 Bufferpools and tablespaces”.
The following commands are demonstrated:
ALTER TABLESPACE ALTER BUFFERPOOL
CREATE TABLESPACE CREATE BUFFERPOOL
LIST TABLESPACES DROP BUFFERPOOL
LIST TABLESPACE CONTAINERS
DROP TABLESPACE CREATE TABLE … IN
Prerequisites:
· DB2 Version 8 Server has been installed
· Completion of Lab1 (requires sample database created)
Highly Recommended: Before each step in this lab, locate the demonstrated command in the CLP quick reference and mark it with an asterix (*). This will help you get familiar with the DB2 CLP cheat sheet.
1. Connect to the sample database and view the tablespaces that currently exist
db2 list tablespaces show detail
From the output of the above command, fill in the following chart
TS ID TS Name TS Type TS Page Size
2. Now you’ll create your own table space which uses an 8K page size for data, and a separate 4K page size tablespace for indexes. Before an 8K tablespace can be created, however, an 8K buffer pool must first exist. Create an 8K buffer pool MYBP8K which uses 1000 pages (8MB).
db2 create bufferpool MYBP8K size 1000 pagesize 8K
Next, create a tablespace called MYTS8K which uses the 8K bufferpool.
db2 create tablespace MYTS8K pagesize 8K
managed by database using (
FILE ‘c:myts8k.0’ 1000,
FILE ‘c:myts8k.1’ 1000)
extentsize 8
prefetchsize 16
bufferpool MYBP8K
What type of table space was just created? (DMS or SMS) __________________
How many containers are in this table space? __________________
What is the purpose of using backslash ? __________________
How many kilobytes of data will be written to myts8k.0 before data is written to myts8k.1 (note: calculation required)? Why?
____________________________________________________________________
____________________________________________________________________
In order to store indexes separately from data, DMS tablespaces are required. From step 1, you should have identified that all tablespaces in SAMPLE are SMS. Therefore, we need to create a 4K DMS tablespace to store index data.
db2 create tablespace MYTS4K_IDX pagesize 4K
managed by database using (FILE ‘c:myts4k_idx.0’ 1000)
extentsize 8
prefetchsize 8
bufferpool IBMDEFAULTBP
Which buffer pool is being used by MYTS4K_IDX? __________________
How many kilobytes of data per extent in this tablespace? __________________
3. Take a look at the bufferpools that currently exist (and their sizes)
db2 “select * from syscat.bufferpools”
4. See all the tablespaces just created by repeating step 1. Complete the table by adding the additional information for the tablespaces just created. Show the containers for table space MYTS8K and MYTS4K_IDX
db2 list tablespace containers for
(substitute
5. How many data pages are free and used in MYTS8K and MYTS4K_IDX?
db2 list tablespaces show detail
Fill in the following information for MYTS8K
Used pages: __________________
Free pages: __________________
High watermark: __________________
Fill in the following information for MYTS4K_IDX
Used pages: __________________
Free pages: __________________
High watermark: __________________
6. Create a table with the following DDL:
db2 create table T1
(id bigint not null primary key,
data char(100),
insert_ts timestamp)
IN MYTS8K
INDEX IN MYTS4K_IDX
If you look at the output of list tablespaces show detail, you’ll see that additional pages have been used in both MYTS8K and MYTS4K_IDX. We expect that pages will be allocated in the data tablespace (overhead data pages for a table). But why are additional pages allocated MYTS4K_IDX?
____________________________________________________________________
____________________________________________________________________
7. The bufferpool sized at 1000 pages is too small for any real use. In version 8, bufferpools, in most cases, can be dynamically changed (you will be given a warning if it is not dynamic) using ALTER BUFFERPOOL
Tip: You can use OS monitoring tools to see the memory use increase.
db2 alter bufferpool ibmdefaultbp size 5000
db2 alter bufferpool mybp8k size 5000
What are the new sizes of each bufferpool, in megabytes?
IBMDEFAULTBP _________________
MYBP8K _________________
8. Tablespace characteristics can also be altered using ALTER TABLESPACE. In this step, increase the aggressiveness of index prefetching
db2 alter tablespace MYTS4K_IDX prefetchsize 16
9. Launch the DB2 Control Center to visually identify the objects you just created
· Table
· Index
· Tablespaces
· Tablespace Containers
· Bufferpools
10. Clean up objects created by this lab exercise:
db2 drop table T1
db2 drop tablespace MYTS8K
db2 drop tablespace MYTS4K_IDX
db2 drop bufferpool MYBP8K
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199667/viewspace-1022786/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- db2經典實驗內容,希望大家趕快動手!(第2部)DB2
- prompt經典框架例子生成內容框架
- 《HTML與CSS入門經典(第8版)》——1.2建立Web內容HTMLCSSWeb
- 網站內容首頁設計經驗網站
- 讀Visual C++開發經驗技巧寶典第…C++
- oracle 一般手動巡檢內容Oracle
- 電池、電容內阻手動計算
- [Java面試]經典手撕Java面試
- 《HTML與CSS入門經典(第8版)》——2.4在沒有Web伺服器情況下分發內容HTMLCSSWeb伺服器
- 10條經典的貿易經驗
- Web專案經理手冊之專案經理的工作內容Web
- 七大快取經典問題快取
- 自媒體運營經驗:教你如何打造好的內容?
- Android開發經驗分享-GridView、ListView內容錯亂AndroidView
- QuarkCMS一款簡單、靈活的內容管理系統,歡迎大家體驗!
- 第 20 章 專案實戰--資訊內容[5,6]
- 視覺化經典模型的對比實驗總結視覺化模型
- 作業系統實驗3 經典同步互斥問題作業系統
- 寫了一個json小工具,希望大家體驗(Mac平臺)JSONMac
- 全面解析快取應用經典問題快取
- C語言入門經典(第5版)C語言
- Go語言入門經典第18章Go
- 實現動態自動匹配輸入的內容
- 49個Spring經典面試題總結,附帶答案,趕緊收藏Spring面試題
- 拖動滾動條實現內容自動載入效果
- struts實現的網站定製,內容管理系統,歡迎大家來試用!!!!!!網站
- 請大家給些建議和意見,關於動態內容,靜態釋出。
- 從零手寫實現 nginx-06-資料夾內容的自動索引展示Nginx索引
- 第 20 章 專案實戰--首頁內容介紹[上][3]
- 第 20 章 專案實戰--首頁內容介紹[下][4]
- 你知道JS的“三座大山”嗎?帶你初識前端JavaScript經典內容JS前端JavaScript
- 影視快搜靠內容說話,拿下智慧電視/盒子內容分發權
- SOA驅動內容操作
- PFMEA怎麼寫?這套經驗希望可以幫到你
- 《HTML5移動應用開發入門經典》——2.9 測驗HTML
- 4個Python經典專案實戰,練手必備哦Python
- 70個Python經典實用練手專案(附原始碼)Python原始碼
- 未經設計的內容怎能實現好的營銷?