473,388 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

tablespaces and schemas

This post is as much about getting some questions answered as leaving
the following definitions in the archives for the next person.

After a quick perview of the web, I came up with the following:

tablespaces are a hardware issue, and totally transparent to SQL
execution. It is for optimization for IO, recovery, and separating user
and application usage amongst disks even in the same databases.

schemas are a logical issue, and NOT transparent to the SQL. If schemas
are involved, the SQL needs to know which schema tables are in to access
them.

My questions are:
1/ Am I right/
2/ is the use of the '.' character standard across all databases as
a schema delimiter, i.e. SELECT * FROM {schemaname.tablename.columnname;} ?
3/ Once a user/dba gets down to the actual SQL, and past all the
bl***ng Oracle Obfuscation(TM), does Oracle do the same thing with
schemas that Postgres does, i.e. the aforementioned '.' separator?

I am building an application that I want to work on Postgres, IBM DB2,
Oracle, MSSQL, et.al.

TIA, y'all.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
6 3499

On Jun 9, 2004, at 5:15 PM, Dennis Gearon wrote:
This post is as much about getting some questions answered as leaving
the following definitions in the archives for the next person.

After a quick perview of the web, I came up with the following:

tablespaces are a hardware issue, and totally transparent to SQL
execution. It is for optimization for IO, recovery, and separating
user and application usage amongst disks even in the same databases.

A bit more like database configuration based upon your hardware/design
requirements and availability, but yes, its transparent to the guy
writing the SQL. In Oracle (Sorry to use the 'O' word on the list...),
you specify a tablespace when you create a table (or it uses a default
one), but after that it only matters to the DBA actually running the
installation.
schemas are a logical issue, and NOT transparent to the SQL. If
schemas are involved, the SQL needs to know which schema tables are in
to access them.

Yep.
My questions are:
1/ Am I right/
As much as makes no odds, yes.
2/ is the use of the '.' character standard across all databases as
a schema delimiter, i.e. SELECT * FROM
{schemaname.tablename.columnname;} ?
Yep.
3/ Once a user/dba gets down to the actual SQL, and past all the
bl***ng Oracle Obfuscation(TM), does Oracle do the same thing with
schemas that Postgres does, i.e. the aforementioned '.' separator?
Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work. See your Oracle Obfuscation(TM) documentation, which
of course will tell you nothing without the decoder ring that comes
with a $10,000 service contract), and a schema in Postgres. Sybase and
DB2 IIRC float in the middle with the terminology, but again, same
effect to the author (the poor sod actually implementing the thing has
to pay attention to all the differences, of course).

I am building an application that I want to work on Postgres, IBM DB2,
Oracle, MSSQL, et.al.

If you keep your SQL generic, its not really that hard to do if you
have/write decent middleware. The temptation is always to cheat and
take advantage of native doodads to help things along.
TIA, y'all.

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--------------------

Andrew Rawnsley
President
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114
www.ravensfield.com
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2

On Jun 9, 2004, at 5:15 PM, Dennis Gearon wrote:
This post is as much about getting some questions answered as leaving
the following definitions in the archives for the next person.

After a quick perview of the web, I came up with the following:

tablespaces are a hardware issue, and totally transparent to SQL
execution. It is for optimization for IO, recovery, and separating
user and application usage amongst disks even in the same databases.

A bit more like database configuration based upon your hardware/design
requirements and availability, but yes, its transparent to the guy
writing the SQL. In Oracle (Sorry to use the 'O' word on the list...),
you specify a tablespace when you create a table (or it uses a default
one), but after that it only matters to the DBA actually running the
installation.
schemas are a logical issue, and NOT transparent to the SQL. If
schemas are involved, the SQL needs to know which schema tables are in
to access them.

Yep.
My questions are:
1/ Am I right/
As much as makes no odds, yes.
2/ is the use of the '.' character standard across all databases as
a schema delimiter, i.e. SELECT * FROM
{schemaname.tablename.columnname;} ?
Yep.
3/ Once a user/dba gets down to the actual SQL, and past all the
bl***ng Oracle Obfuscation(TM), does Oracle do the same thing with
schemas that Postgres does, i.e. the aforementioned '.' separator?
Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work. See your Oracle Obfuscation(TM) documentation, which
of course will tell you nothing without the decoder ring that comes
with a $10,000 service contract), and a schema in Postgres. Sybase and
DB2 IIRC float in the middle with the terminology, but again, same
effect to the author (the poor sod actually implementing the thing has
to pay attention to all the differences, of course).

I am building an application that I want to work on Postgres, IBM DB2,
Oracle, MSSQL, et.al.

If you keep your SQL generic, its not really that hard to do if you
have/write decent middleware. The temptation is always to cheat and
take advantage of native doodads to help things along.
TIA, y'all.

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--------------------

Andrew Rawnsley
President
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114
www.ravensfield.com
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #3
Andrew Rawnsley <ro**@ravensfield.com> writes:
Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work.


Oracle is actually SQL-spec-compliant in this regard (or possibly I
should say the spec is Oracle-compliant, seeing that they probably
dictated these semantics...) The SQL spec is carefully written
so that an implementation that enforces one-to-one matching of
schemas and users is spec-compliant.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
Andrew Rawnsley <ro**@ravensfield.com> writes:
Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work.


Oracle is actually SQL-spec-compliant in this regard (or possibly I
should say the spec is Oracle-compliant, seeing that they probably
dictated these semantics...) The SQL spec is carefully written
so that an implementation that enforces one-to-one matching of
schemas and users is spec-compliant.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #5
Actually, you *can* write your SQL to be ignorant of schemas (while
still using them because they are good).

In postgres, you specifiy a search path for the user you connect as and
make sure that have the appropriate access rights to objects in other
schemas, and that the other schemas exist in your search path so that
the objects can be located.

In Oracle the same effect is achieved using synonyms. If a (public)
synonym exists in your schema for an object in another schema then you
can reference the object by the synonym name - especially if you make
the synonym name the same as the destination object that it refers to.
(A synonym can be considered to be like a symbolic link in unix).

The upshot is that you can write your SQL to reference objects without
the schema prefix if you wish.

John Sidney-Woollett

Andrew Rawnsley wrote:

On Jun 9, 2004, at 5:15 PM, Dennis Gearon wrote:
This post is as much about getting some questions answered as leaving
the following definitions in the archives for the next person.

After a quick perview of the web, I came up with the following:

tablespaces are a hardware issue, and totally transparent to SQL
execution. It is for optimization for IO, recovery, and separating
user and application usage amongst disks even in the same databases.


A bit more like database configuration based upon your hardware/design
requirements and availability, but yes, its transparent to the guy
writing the SQL. In Oracle (Sorry to use the 'O' word on the list...),
you specify a tablespace when you create a table (or it uses a default
one), but after that it only matters to the DBA actually running the
installation.
schemas are a logical issue, and NOT transparent to the SQL. If
schemas are involved, the SQL needs to know which schema tables are
in to access them.


Yep.
My questions are:
1/ Am I right/

As much as makes no odds, yes.
2/ is the use of the '.' character standard across all databases
as a schema delimiter, i.e. SELECT * FROM
{schemaname.tablename.columnname;} ?

Yep.
3/ Once a user/dba gets down to the actual SQL, and past all the
bl***ng Oracle Obfuscation(TM), does Oracle do the same thing with
schemas that Postgres does, i.e. the aforementioned '.' separator?

Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work. See your Oracle Obfuscation(TM) documentation, which
of course will tell you nothing without the decoder ring that comes
with a $10,000 service contract), and a schema in Postgres. Sybase
and DB2 IIRC float in the middle with the terminology, but again, same
effect to the author (the poor sod actually implementing the thing has
to pay attention to all the differences, of course).

I am building an application that I want to work on Postgres, IBM
DB2, Oracle, MSSQL, et.al.


If you keep your SQL generic, its not really that hard to do if you
have/write decent middleware. The temptation is always to cheat and
take advantage of native doodads to help things along.
TIA, y'all.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--------------------

Andrew Rawnsley
President
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114
www.ravensfield.com
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if
your
joining column's datatypes do not match

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #6
Actually, you *can* write your SQL to be ignorant of schemas (while
still using them because they are good).

In postgres, you specifiy a search path for the user you connect as and
make sure that have the appropriate access rights to objects in other
schemas, and that the other schemas exist in your search path so that
the objects can be located.

In Oracle the same effect is achieved using synonyms. If a (public)
synonym exists in your schema for an object in another schema then you
can reference the object by the synonym name - especially if you make
the synonym name the same as the destination object that it refers to.
(A synonym can be considered to be like a symbolic link in unix).

The upshot is that you can write your SQL to reference objects without
the schema prefix if you wish.

John Sidney-Woollett

Andrew Rawnsley wrote:

On Jun 9, 2004, at 5:15 PM, Dennis Gearon wrote:
This post is as much about getting some questions answered as leaving
the following definitions in the archives for the next person.

After a quick perview of the web, I came up with the following:

tablespaces are a hardware issue, and totally transparent to SQL
execution. It is for optimization for IO, recovery, and separating
user and application usage amongst disks even in the same databases.


A bit more like database configuration based upon your hardware/design
requirements and availability, but yes, its transparent to the guy
writing the SQL. In Oracle (Sorry to use the 'O' word on the list...),
you specify a tablespace when you create a table (or it uses a default
one), but after that it only matters to the DBA actually running the
installation.
schemas are a logical issue, and NOT transparent to the SQL. If
schemas are involved, the SQL needs to know which schema tables are
in to access them.


Yep.
My questions are:
1/ Am I right/

As much as makes no odds, yes.
2/ is the use of the '.' character standard across all databases
as a schema delimiter, i.e. SELECT * FROM
{schemaname.tablename.columnname;} ?

Yep.
3/ Once a user/dba gets down to the actual SQL, and past all the
bl***ng Oracle Obfuscation(TM), does Oracle do the same thing with
schemas that Postgres does, i.e. the aforementioned '.' separator?

Schemas are users in Oracle, but the net effect to the SQL author is
the same. 'SELECT * FROM SERVICES.USERS' is the same, just that
'SERVICES' is a user in oracle (although referred to as a schema, and
you have to do a 'CREATE SCHEMA AUTHORIZATION blablabla' to get
anything to work. See your Oracle Obfuscation(TM) documentation, which
of course will tell you nothing without the decoder ring that comes
with a $10,000 service contract), and a schema in Postgres. Sybase
and DB2 IIRC float in the middle with the terminology, but again, same
effect to the author (the poor sod actually implementing the thing has
to pay attention to all the differences, of course).

I am building an application that I want to work on Postgres, IBM
DB2, Oracle, MSSQL, et.al.


If you keep your SQL generic, its not really that hard to do if you
have/write decent middleware. The temptation is always to cheat and
take advantage of native doodads to help things along.
TIA, y'all.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--------------------

Andrew Rawnsley
President
The Ravensfield Digital Resource Group, Ltd.
(740) 587-0114
www.ravensfield.com
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if
your
joining column's datatypes do not match

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: CK | last post by:
Need a piece of advice on allocation of tablespaces for partitioning We are using a day level range-based approach as our parititiong scheme given that we have data inflows running into 15...
8
by: Joachim Mueller | last post by:
Have written a litte sql for showing the utilization of the tablespace. (found it within the newsgroup from Paul Vernon). Looks fine for an one Partition System only. But how i can I see on which...
3
by: Lew | last post by:
Hi, I was wondering if there is a way to determine the tablespace id of each tablespace on a backup image. I want to perform a redirected restore pointing the tablespace containers to...
0
by: Dennis Gearon | last post by:
This post is as much about getting some questions answered as leaving the following definitions in the archives for the next person. After a quick perview of the web, I came up with the...
6
by: mike_dba | last post by:
Can anyone tell me why a EEE system might be created to have two separate tablespaces with the same 4k pagesize ? They both appear to be in use as I can see the underlying files being modified. ...
10
by: rAinDeEr | last post by:
Hi, I am trying to create around 70 tablespaces for around 100 tables.. Am using DB2 UDB 8.2 in Linux environment... This is one i generated through Control centre.... CREATE REGULAR...
3
by: dcruncher4 | last post by:
DB2 8.2.3 the task I have is to write a script to restore a database from a backup on to another machine. the backup can be as old as seven years. The container layout on the machine to be...
4
by: beena | last post by:
All, I'm new to the concept of automatic storage... I'm looking at the database setup by a vendor. I see few tablespaces showing up with automatic storage - Yes. Tablespace ID ...
6
by: Troels Arvin | last post by:
Hello, I have recently run a rather large data import where the imported data i pumped through some updatable views equipped with INSTEAD OF triggers. For various reasons, the exact same data...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.