Connecting to a tablespace

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
irfan
Posts: 15
Joined: Wed 13 Apr 2005 00:56

Connecting to a tablespace

Post by irfan » Fri 01 Dec 2006 19:58

I created a user in oracle using the following.

create tablespace user3_ts
logging
datafile 'user3_ts'
size 32m
autoextend on
extent management local;

create user user3
identified by password3
default tablespace user3_ts
TEMPORARY TABLESPACE user3_ts

grant connect to user3

grant create session, create table, create view to user3

When I connect to oracle using corelab, it connects me to the system tablespace and not the user3_ts tablespace. How do I get corelab to see only the user3_ts tablespace and not the system tablespace when issuing queries or programmatically creating tables?

Thanks,
Irfan

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 04 Dec 2006 08:33

Try to check this with SQL Plus. Oradirect .NET should connect to user3_ts
schema. This schema will become current (if ConnectMode=OracleConnectMode.Default).

irfan
Posts: 15
Joined: Wed 13 Apr 2005 00:56

Post by irfan » Tue 05 Dec 2006 03:34

Thank you. It worked.

I have another question. Is it possible to tell the Oradirect .NET to connect to a particular tablespace or schema assuming the user has access instead of the default one?

Thanks,
Irfan

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 05 Dec 2006 08:28

OraDirect .NET operates same way as other providers.
You can connect to any schema very simple. Just connect to appropriate user, and this will be connection to his schema. Then you can execute

Code: Select all

ALTER SESSION SET CURRENT_SCHEMA = ...
and switch to another schema. A tablespace will be that, in which current schema resides.
For more information please see Oracle documentation.

irfan
Posts: 15
Joined: Wed 13 Apr 2005 00:56

Post by irfan » Tue 05 Dec 2006 17:46

Thank you. I was hoping for something more automatic when creating the connection. For now I will just change the database connection creation code to always issue this command before returning the connection to the calling code.

Thanks,
Irfan

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 05 Dec 2006 17:49

You are welcome.

Post Reply