If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Schema vs. multiple Databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-07, 12:01
db29999 db29999 is offline
Registered User
 
Join Date: Jan 2007
Posts: 2
Schema vs. multiple Databases

I am a newbie to DB2 UDB V9 for Linux, and your help is highly appreciated!

What's the best practice of:
(1) Schema vs. multiple Databases -- Should I create a database for each application or create a different schema in ONE database? If later case, then how "big" would the database be able to "tolerate"?
(2) tablespace design -- In my mainframe implementation, we create a separate tablespace for each table. Do you think that will work best for DB2 on Linux, too?
Reply With Quote
  #2 (permalink)  
Old 02-19-07, 12:24
rajesh_1972 rajesh_1972 is offline
Registered User
 
Join Date: Oct 2006
Posts: 15
Hi
You can create multiple schemas for a particular database. You don't have to create database for each and every application for db2. To create a schema db2 create schema <schema name>.

Regards
Rajesh Krishnan
Reply With Quote
  #3 (permalink)  
Old 02-19-07, 12:45
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by db29999
(1) Schema vs. multiple Databases -- Should I create a database for each application or create a different schema in ONE database? If later case, then how "big" would the database be able to "tolerate"?
The answer is "it depends". In general, I think, you should create a separate database for each application, unless you have very compelling reasons not to.

Quote:
Originally Posted by db29999
(2) tablespace design -- In my mainframe implementation, we create a separate tablespace for each table. Do you think that will work best for DB2 on Linux, too?
The answer is, again, "it depends". Depends on the size of the table, typical access patterns, maintenance requirements (e.g. backup, restore, or load), etc.
Reply With Quote
  #4 (permalink)  
Old 02-19-07, 13:43
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Databases have a very different meaning on DB2 z/OS versus DB2 LUW. Unless the applications share the same data, they should be on a seperate database on DB2 LUW.

Best practice on z/OS is to create a separate tablespace for each table. This is not the case for LUW.

The main consideration on LUW is the page size (each different page size must have its own tablespace) and bufferpool assignment, since you assign tablespaces to bufferpools. So if you want to have a separate bufferpool for tables and indexes, or a separate bufferpool for very large tables, then they need to be in a separate tablespace.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 02-19-07, 16:39
jayecarter jayecarter is offline
Registered User
 
Join Date: Aug 2002
Location: St. Louis
Posts: 16
Multiple databases or schemas: If the maintenance and management and security needs are similar and compatible then I would suggest a single database with multiple schemas. If they are not compatible then I would suggest not coupling them.

Tablespaces: IBM use to suggest a tablespace per table. Don't know if that's still the case. The abillity to backup and restore by tablespace can in situations be very useful. You also can get better granularity on bufferpools and apply memory directly to critical tables. On the other hand it feels like overkill and a whole lot more administrative work and if you have RI between tables then the tablespace backup/restore is impacted.
Reply With Quote
  #6 (permalink)  
Old 02-20-07, 09:00
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
There is one other thing that should be considered. If you have multiple databases, these will require more memory than just a single DB with multiple schemas. Each DB needs its own bufferpools, DB memory, etc. Even though putting the different applications in different DB is desirable, it might not be practical. Alot depends on the amount od hardware you will be using.

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On