Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Comparison between Oracle and Teradata Center of Excellence Data Warehousing Wipro Technologies.

Similar presentations


Presentation on theme: "1 Comparison between Oracle and Teradata Center of Excellence Data Warehousing Wipro Technologies."— Presentation transcript:

1 1 Comparison between Oracle and Teradata Center of Excellence Data Warehousing Wipro Technologies

2 2 Basic Database Architecture Differences: Oracle Oracle SMP DBMS Kernel LockingLoggingMulti-Task Control Global Buffer Pools Global Systems/Storage Area I/O DataPartition DataPartition DataPartitionDataPartition

3 3 Basic Database Architecture Differences: Teradata  Teradata MPP BYNET Connect PE V-Proc Lock Log M-T BPool I/O AMP PE V-Proc BYNET Connect PE V-Proc BYNETBYNET DataPartitionDataPartitionDataPartitionDataPartition Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP Lock Log M-T BPool I/O AMP DataPartitionDataPartitionDataPartitionDataPartition SMP Node Oracle SMP

4 4 Oracle Physical Storage Tablespaces are individual units of storage Tablespaces have associated data files Data files can be added to, extended or removed from a tablespace dynamically Only partitioned objects can span tablespaces Logical objects are stored in physical segments. Segments consist of extents Object space is allocated one extent at a time. May cause fragmentation.

5 5 Disk Space and the Teradata Database DBC Stores Products TABLE INDEX BYNET Connect PE V-Proc Loc k Log M-T BPo ol I/O AM P PE V-Proc BYNET Connect PE V-Proc BYNETBYNET DataPartitionDataPartitionDataPartitionDataPartition Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P Loc k Log M-T BPo ol I/O AM P DataPartitionDataPartitionDataPartitionDataPartition SMP Node

6 6 Sample Large Disk Space Allocation DDL Oracle9i Teradata drop tablespace ts_o1 including contents; create tablespace ts_o1 datafile ’/export/home/oracle/oracle817/dbs/datafiles/o_1’ size 8190m reuse extent management local autoallocate ;. Repeat this for every tablespace Execute Once CREATE USER tpcd3000g AS PERM= 5400E9, PASSWORD= tpcd3000g;

7 7 Comparing Database Creation

8 8 Create Table Statements CREATE TABLE Table1 ( Col1 NUMBER, Col2 NUMBER, Col3 NUMBER ) TABLESPACE Tablespace1 STORAGE (INITIAL 6144 NEXT 6144 MINEXTENTS 1 MAXEXTENTS 5 ); or... CREATE TABLE AS SELECT ; Oracle CREATE TABLE Table1,FALLBACK, NO BEFORE JOURNAL, NO AFTER JOURNAL (Col1 INTEGER, Col2 INTEGER, Col3 INTEGER) UNIQUE PRIMARY INDEX ( Col1 ); Teradata

9 9 Creating Tables: Similarities All tables have names Tables have columns with data types You can define: Constraints Referential integrity Global temporary tables Triggers

10 10 Creating Tables: Differences Teradata tables are created in the database or user Teradata provides several convenient options: Fallback Permanent journaling Table block size Primary index Built into the Table MULTISET DBC Product s TABLE

11 11 Partitioning Partitioning tables and indexes allow Oracle and Teradata to store lots of data With Oracle, the process of choosing partitioning methods and partitioning keys is the balancing of query access path, performance, and data load requirements You specifically manage the partitioning constraints and their relationship to disk storage With Teradata, the hash partitioning algorithm is very good at evenly distributing (loading) data partitions and is the basis for high performance data access and ease of user access Provide reasonable partitioning columns when defining the table and Teradata does the rest Partitioning Columns are Chosen for Even Data Distribution in Both Teradata and Oracle

12 12 Partitioning Comparisons - Oracle Oracle Partitioning Decisions - Decide on Methods as well as partitioning columns, set up the disk environment 99Q1 99Q4 99Q3 99Q2Hash1 Hash4 Hash3 Hash2 Texas California Florida New York Range PartitioningHash Partitioning Hash1 Hash3 Hash2 Hash3 Hash2 Hash1 99Q1 99Q2 99Q3 99Q4 Composite Range PartitioningList Partitioning

13 13 Partitioning Comparisons-Teradata Teradata Partitioning is a Fact of the System with Hash Data Distribution based on Primary Index (Partitioning) Columns and system managed disk AMP2AMP3AMP4 Table 1 Table 2 AMP1 Table 1 Table 2 Table 3

14 14 Examples of DDL to Create Partitioned Tables Oracle9iTeradata create table orders( o_orderdate date, o_orderkey number NOT NULL, o_custkey number NOT NULL, o_orderpriority char(15), o_shippriority number, o_clerk char(15), o_orderstatus char(1), o_totalprice number, o_comment varchar(79) ) pctfree 1 pctused 99 initrans 10 storage (freelists 99 freelist groups 2) parallel nologging partition by range (o_orderdate) subpartition by hash(o_custkey) subpartitions 16 ( partition ord1 values less than (to_date(’1992-01- 01’,’YYYY-MM-DD’)) tablespace ts_o1. partition ord84 values less than (MAXVALUE) tablespace ts_o84 ) ; Repeat 82 Times with DBA Defined Ranges CREATE MULTISET TABLE ORDERTBL, DATABLOCKSIZE= 29.5 KILOBYTES ( O_ ORDERKEY DECIMAL (15,0) not null,O_ CUSTKEY INTEGER not null,O_ ORDERSTATUS CHAR( 1) CASESPECIFIC not null,O_ TOTALPRICE DECIMAL( 15,2) not null,O_ ORDERDATE DATE FORMAT ’yyyy- mm- dd’ not null,O_ ORDERPRIORITY CHAR( 15) CASESPECIFIC not null,O_ CLERK CHAR( 15) CASESPECIFIC not null,O_ SHIPPRIORITY INTEGER not null,O_ COMMENT VARCHAR( 79) CASESPECIFIC not null ) UNIQUE PRIMARY INDEX( O_ ORDERKEY );

15 15 Oracle Parallelism Oracle parallelism is not directly related to table partitioning because of its shared disk architecture Dynamically splits data over parallel processing units for Selects/Inserts means 1 or more parallel processing units per partition Considers partitioning when distributing data to parallel processing units One parallel processing unit applied to each partition for Updates/Deletes Each user/query can get varying amounts of parallelism or run serially depending upon the resources available at query run time May need to manually control parallelism to improve system throughput and to ensure fair distribution of parallel resources Parallel processes may funnel down to serial processing for final sort/merge, aggregate activity

16 16 Teradata Parallelism Teradata parallelism is directly related to its shared nothing architecture Automatically applied by the database Architecture ensures that each major unit of parallelism (the VAMP) has similar amounts of data and memory Pipelining and query step parallelism is performed within the VAMP Utility Parallelism and Query/Data Manipulation Language parallelism (Select, Insert, Update, Delete) are all the same All system parallelism is available to ALL operations Teradata parallelism is automatic, pervasive, and database managed All users/queries take advantage of all the system parallel resources You do not manage and control parallelism

17 17 Data Types CHAR VARCHAR2 NCHAR NCHAR2 NUMBER LONG LONGRAW RAW DATE BLOB CLOB NCLOB BFILE ROWID UROWID CHAR VARCHAR CHAR VARYING LONG VARCHAR NUMERIC DECIMAL DOUBLE PRECISION FLOAT INTEGER SMALLINT BYTEINT BYTE VARBYTE GRAPHIC VARGRAPHIC LONG VARGRAPHIC DATE REAL Oracle Teradata

18 18 Data Type Translations

19 19 In Oracle the maximum precision "m" for number is 38. In Teradata it is 19 NUMBER (without precision) has no direct counterpart in Teradata. Determine migration by contents ROWID has no counterpart in Teradata Datatypes

20 20 Constraints Like Teradata’s Constraints - Defined on columns and tables Oracle is different from Teradata on the follow: Default mandatory is NULL Case sensitivity is fixed at ON Constraints can be disabled and enabled

21 21 Oracle Specific Columns and Table ROWNUM will number retrieved rows ROWID indicates physical address of row SELECT must have FROM list DUAL is a pseudo-table with 1 row

22 22 Creating Indexes Similarities between Teradata and Oracle: Indexes take up space on disk Indexes can be unique and non-unique Indexes and secondary indexes provide alternate ways to access data Differences: Teradata indexes are not in B-tree structure Hash Subtables Teradata automatically partitions indexes across the AMPs Teradata uses a Primary Index for each table

23 23 Index Usage Comparisons Oracle solutions traditionally have relied heavily on indexes OLTP workloads required fast access paths to few rows Decision support solutions continue Oracle’s use of indexes where tactical queries with OLTP-like response time requirements are given more emphasis than throughput performance Teradata solutions have traditionally not used lots of indexes Teradata’s efficient parallel architecture emphasizes throughput performance requirements - a result of it’s DSS background

24 24 Index Usage Comparisons Contd. Teradata typically uses fewer indexes than the equivalent Oracle system Saves on disk storage Reduces table maintenance windows where affected by existing indexes Fewer database objects to manage and monitor Most of the indexes found in Oracle may not be used on Teradata Indexes can provide clues to ad hoc query support requirements No Bit-Map indexes for Teradata Add indexes to Teradata only as workloads (or anticipated workloads) require them Monitor their usage or lack of usage Statistics are key - you WANT to collect statistics in Teradata!

25 25 Principles Behind the Use of Indexes Maximize the use of Single or Few AMP Operations: Drive towards using single or few AMP operations for queries Minimizing the number of AMPs in an operation, all other AMPs are freed to perform other tasks. Scalability is increased because the freed AMPs can execute more single or few AMP operations creating greater throughput by increasing the number of tactical queries executed in parallel Create Efficient All AMP Operations: Reduce the resource consumption on each AMP for all AMP operations. Since all AMP operations are virtually impossible to remove from a data warehousing environment, reducing the impact on each AMP is important Gain scalability for two reasons: Individual queries execute faster freeing the AMPs to execute other queries Decrease in resource consumption allows more queries to use the shared resources, such as spool space, or CPU

26 26 Miscellaneous DDL Triggers Triggers function just the same (pre- and post-, insert / update / delete) as in Teradata Oracle Options not in Teradata Database Links Reference (use) objects in another instance Synonyms Named references to objects Sequences Number generators Often used to generate surrogate keys Hierarchies LK E

27 27 ANALYZE/Collect Statistics ANALYZE/DBMS_STATS package are intended for collecting database object statistics for Oracle’s Cost Based Optimizer (CBO) Goal is to collect statistics give queries good access paths Once Plans are good and stable, stop analyzing tables to preserve plans Teradata’s Collect Statistics command collects database object statistics Optimizer reacts to changing demographics (growing tables, changing column value cardinality, etc.) Keeping statistics up to date ensures good plans Don’t freeze statistics - old statistics encourage old access plans that may not be effective as the database changes

28 28 Data Control Language Data Control Language (DCL) is used in both Oracle and Teradata to assign user access Oracle users may be granted: Object Privileges Easily relate to Teradata System Privileges Can be simulated within Teradata

29 29 User Access Rights Teradata enables you to assign access rights: To individual users To logical groups of users On individual objects On groups of objects Views Macros Tables

30 30 Object Privileges Grant Execute Procedure/ Grant Execute Grant Execute Grant Update Grant Insert Grant Select Grant Index or Grant Drop Table Grant Index Grant Delete Grant DropGrant Alter Granting Teradata Privileges Granting Oracle Privileges

31 31 System Privileges Grant Drop View or Grant View on Database Grant Drop Any View Grant Create View or Grant View on Database Grant Create Any View Grant Create View or Grant View on Database Grant Create View Grant Select on DatabaseGrant Select Any Table Grant Update on Database/Grant Update (column list, all but column list) Grant Update Any Table Grant Insert on DatabaseGrant Insert Any Table Grant Drop Table or Grant TableGrant Drop Any Table Grant Delete on DatabaseGrant Delete On Any Table Grant Create Table or Grant TableGrant Alter Any Table Grant Create Table or Grant TableGrant Create Table Granting Teradata PrivilegesGranting Oracle Privileges

32 32 Questions ?


Download ppt "1 Comparison between Oracle and Teradata Center of Excellence Data Warehousing Wipro Technologies."

Similar presentations


Ads by Google