Presentation is loading. Please wait.

Presentation is loading. Please wait.

ISU-GIS Training and Research Center

Similar presentations


Presentation on theme: "ISU-GIS Training and Research Center"— Presentation transcript:

1 ISU-GIS Training and Research Center
Introduction to IBM DB2 IT4GIS Keith T. Weber, GISP GIS Director ISU-GIS Training and Research Center

2 What is it? IBM DB2 (Database 2) An object-relational database:
No software limitations (e.g., size of database, number of tables, number of entities per table). Very scalable (it can grow to fit your needs). Efficient for numerous concurrent clients

3 Concurrent Clients GIS for the Enterprise Potential concurrent clients

4 Server Installation The amount of random-access memory (RAM) required to run any edition of DB2 is 512 MB. 1 GB is recommended for improved performance Required disk space depends on type of installation and type of file system

5 Professional Tips Administration password DBADMIN ADMINISTRATOR

6 DB2 Editions

7 Personal Configuration
Personal Edition DB2 Personal Edition is a single-user version of the full DB2 product. Has most features available in Express Edition Remote clients cannot connect to this edition Can be remotely administered with DB2 administration tools Net Search Extender Spatial Extender OLAP: OLAP AND OLAP SERVER DEFINITIONS OLAP: ON-LINE ANALYTICAL PROCESSING Defined terms On-Line Analytical Processing (OLAP) is a category of software technology that enables analysts, managers and executives to gain insight into data through fast, consistent, interactive access to a wide variety of possible views of information that has been transformed from raw data to reflect the real dimensionality of the enterprise as understood by the user. OLAP functionality is characterized by dynamic multi-dimensional analysis of consolidated enterprise data supporting end user analytical and navigational activities including: calculations and modeling applied across dimensions, through hierarchies and/or across members trend analysis over sequential time periods slicing subsets for on-screen viewing drill-down to deeper levels of consolidation reach-through to underlying detail data rotation to new dimensional comparisons in the viewing area OLAP is implemented in a multi-user client/server mode and offers consistently rapid response to queries, regardless of database size and complexity. OLAP helps the user synthesize enterprise information through comparative, personalized viewing, as well as through analysis of historical and projected data in various "what-if" data model scenarios. This is achieved through use of an OLAP Server. OLAP SERVER An OLAP server is a high-capacity, multi-user data manipulation engine specifically designed to support and operate on multi-dimensional data structures. A multi-dimensional structure is arranged so that every data item is located and accessed based on the intersection of the dimension members which define that item. The design of the server and the structure of the data are optimized for rapid ad-hoc information retrieval in any orientation, as well as for fast, flexible calculation and transformation of raw data based on formulaic relationships. The OLAP Server may either physically stage the processed multi-dimensional information to deliver consistent and rapid response times to end users, or it may populate its data structures in real-time from relational or other databases, or offer a choice of both. Given the current state of technology and the end user requirement for consistent and rapid response times, staging the multi-dimensional data in the OLAP Server is often the preferred method.

8 Express Configuration
Express Edition Built in autonomic manageability features Supports high availability (HA) architectures Net Search and Spatial Extenders pureXML Homogeneous federation Scalable with Features Packs

9 Workgroup Configuration
Workgroup Server Edition Contains all of Express Edition Includes High Availability Feature Pack Online table reorganizations Tivoli System Automation (TSA) high availability services Support for DB2 advanced copy services High Availability Disaster Recovery (HADR)

10 Enterprise Configuration
Enterprise Server Edition DB2 Enterprise Edition is designed for large databases with many users. It contains all the functionality of the Workgroup Edition, plus: A license for an unlimited number of client connections Includes services for parallelism, MDCs, MQTs, table partitioning and more Scalable with additional Feature Packs

11 Professional Tips DB2 licensed per CPU in your server
Consider DBA overhead Oracle is DBA intensive SQL Server least overhead DB2 to date…

12 DBA GUI based database administration
Alternatively, command prompt can be used.

13 Creating Databases/tables
Use the Control Center A database can be a new instance of DB2 The name you specify must be 1 to 8 characters in length To avoid potential problems: do not use the special #, and $ in a database name if you intend to have a client remotely connect to a host database. Also, because these characters are not common to all keyboards, do not use them if you plan to use the database in another country. On Windows NT-based systems (8, 10, Server 2008, etc.), ensure that no instance name is the same as a service name. How do you check services? Open services file with NOTEPAD, found in OS folder, under sys32/drivers/etc How do you check this?

14 Checking Service Names
C:\Windows\System32\drivers\etc

15 Pre-fetched into the buffer pool?
DB2 Specifics Pre-fetch Buffer pools Table data pages Pre-fetched into the buffer pool? What is pre-fetch size? Advance reading of data pages to minimize repeated IO traffic Buffer pools: Amt of main memory on the server allocated to the cache table (the table storing pre-fetched data), index, and catalog table pages information. Table data pages: The size of each table page records are stored on each page. All fields (attributes) for each record are included save for the LONG character or LONG special types in which only a pointer or descriptor is stored on the page. Page sizes usually range from 4kb, 8kb, 16kb, to 32kb. The three specifics greatly effect the efficiency and speed of DB2. To determine table data pages you must know the data types and their storage requirements.

16 DB2 Data Types (Numeric)
FOR BIT DATA (boolean) BYTE (0-255) SMALLINT (-32,768 to 32,767 ) INTEGER (-2,147,483,648 to 2,147,483,647) FLOAT <n> (2 types) DOUBLE PRECISION <np,ns> For Bit Data (Boolean)- storage space = 2-bytes SmallInt (Byte)- storage space = 1 byte Integer (Int)- storage space = 2-bytes BigInt (long)- storage space = 4-bytes Float- Floating point data. Single precision: A data type that stores single-precision floating-point variables as 32-bit (4-byte) floating-point numbers, ranging in value from E38 to E-45 for negative values, and E-45 to E38 for positive values. Storage space is 4 bytes. Double precision:A data type that holds double-precision floating-point numbers as 64-bit numbers in the range E308 to E-324 for negative values; E-324 to E308 for positive values. Storage space is 8-byte. Decimal data type. Parameters are: integer number for precision (0-31), integer number for scale (0-np) Scale is by power of 10. A data type that contains decimal numbers scaled by a power of 10. For zero-scaled numbers, that is, numbers with no decimal places, the range is +/-79,228,162,514,264,337,593,543,950,335. For numbers with 28 decimal places the range is +/ The smallest non-zero number that can be represented as a Decimal is Storage space: numeric storage size of 16 bytes

17 DB2 Parameters in ArcGIS
FLOAT < np,ns > nprecision(total field length) = 1-6 nscale (decimal places) = 1-6 np,ns = 5,3  is OK, is not Five (5) total characters

18 Parameters (cont’d) DOUBLE PRECISION <np,ns> np = 7 or more
ns = 0 or more

19 DB2 Data Types (Character)
CHARACTER<n> VARCHAR<n> Character VarChar- varying length, and varying space requirements ,672 Long VarChar- up to 32,700. User does not specify the max length.

20 Parameters (cont’d) CHARACTER<n> (AKA, String or Text)
Example a field named “URL” with n = 46

21 DB2 Data Types (Special)
DATE TIME TIMESTAMP

22 DB2 Data Types (Special)
Stored in special System managed tables BLOB<n[K|M|G]> CLOB<n[K|M|G]> DBCLOB<n[K|M|G]> GRAPHIC<n> VARGRAPHIC<n> BLOB- Binary large object, maximum length or size is n, expressed as Kilobytes, Megabytes, or Gigabytes). Absolute max is 2GB for each data value. CLOB- Character large object (same parameters) DBCLOB- Double byte character large object. (same parameters, however max is now 1GB of double characters) GRAPHIC- Fixed length graphic string, n = 1-127 VARGRAPHIC- Variable length graphic string LONG VARGRAPHIC- Varying length graphic string- 1-16,350 DATE- store a date that can be used for date arithmetic TIME- Store a time that can be used for time arithmetic TIMESTAMP- timestamp…DB2 generated. DATALINK- for data stored outside the database. N is the number of characters describing the link All data type with LONG (character and special) use 32KB page areas each. This includes the LOB’s as well. They are not stored within the data pages however. Just a descriptor or a pointer is stored in the page.

23 Table Data Pages All fields with standard data types for each record are contained within a single data page. There is a maximum of 255 records stored on each page. The ART of efficient data modeling is to minimize wasted space on a page while maximizing the proportion of each page written.

24 An Instance Example 200 records per 4kb page will fit.
number of fields KB per record page size KB for 255 records records at page size KB USED KB WASTED 100 GB TABLE SPACE 10 0.02 4 5.1 200 0 GB WASTED 8 255 2.9 29 GB WASTED 200 records per 4kb page will fit. 255 per 8 kb page. However, all the available space will not be used that has been allocated. The number of pages does not matter too much (within reason), however the efficiency of each page is important to overall DB performance and overall size  backup  IO etc. Each table must be evaluated similarly. 4kb will NOT be best for all instances!

25 DB2 for GIS DB2 Spatial Extender lets you integrate geographic data with your existing business data. It includes: Data types such as points, lines, and polygons Functions such as area, endpoint, and intersect An indexing scheme for spatial data This product is available for all editions of DB2 Details regarding data storage architecture, pre-fetch, and specifically table page space will be addressed when we talk about SDE later in this semester. However, I will tell you that the spatial extender is an example of object-relational databases (ORDBMS) which we will learn more about in the weeks to come.

26 Questions?

27 Key Concepts Understand that while data is stored in tables, the tables span TABLE PAGES Understand what PRE-FETCH and CACHE are…and how they differ. Understand DB2 specific data types

28 Your Assignment Read IBM DB2 Ref (PDF) Complete the exercise
Design table pages with the “DB2 Database Administration” exercise


Download ppt "ISU-GIS Training and Research Center"

Similar presentations


Ads by Google