Page 1 of 1
LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Tue 27 Aug 2013 08:29
by AKRRKA
My Code:
Code: Select all
var contextForCreateDatabase = new ceDataContext(ConnectionString, mappingSource);
if (contextForCreateDatabase.DatabaseExists())
{
MessageBox.Show("Database already exist!");
}
else
{
contextForCreateDatabase.CreateDatabase(false, true);
}
Connection String is (ConnectionString):
"user id=sys;password=*;server=XE;connect mode=SysDba;direct=True;sid=XE;persist security info=True"
Database:
- Oracle 11 XE;
- User "sys", pass "1";
- Need create schema with name "CEDATABASE";
Question:
-What should be the connection string (ConnectionString) for this? Please give me the right example.
Thanks!
PS: I think this issue is related to the others:
Link to topic.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Thu 29 Aug 2013 16:32
by Shalex
We have answered about context.DatabaseExists() at
http://forums.devart.com/viewtopic.php?f=31&t=27794.
AKRRKA wrote:Question:
-What should be the connection string (ConnectionString) for this? Please give me the right example.
Could you please describe the problem with your current connection string? Is there any error (specify the exact text) or incorrect behaviour?
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Fri 30 Aug 2013 13:27
by AKRRKA
What is there to understand?
In this connection string is not indicated the name of the schema that I need to create!
How to do it?
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Fri 06 Sep 2013 16:27
by Shalex
AKRRKA wrote:In this connection string is not indicated the name of the schema that I need to create!
The contextForCreateDatabase.CreateDatabase method doesn't create a new schema (database user) at the moment. We are investigating the possibility of implementing this functionality.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Sat 07 Sep 2013 08:18
by AKRRKA
Just add a new parameter "Database" (...;database = newdb;...).
And thus was created "schema/user" with that name "newdb" and with the same password "newdb", that's all.
That is enough.
It is waiting.
Thank you.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Mon 09 Sep 2013 09:51
by MariiaI
Thank you for your involvement. We will let you know about the results as soon as any are available.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Mon 23 Sep 2013 13:44
by MariiaI
The possibility of creating and deleting Oracle schemas (users) for mapped model classes via the CreateDatabase/DeleteDatabase methods of the DataContext class is implemented.
New build of LinqConnect 4.2.338 is available for download now!
It can be downloaded from
http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to
http://forums.devart.com/viewtopic.php?f=31&t=27983.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Tue 05 Nov 2013 09:01
by AKRRKA
And what parameter has been added to the connection string to support the connection to the other scheme.
Please give an example of the connection string.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Tue 05 Nov 2013 13:37
by MariiaI
The possibility of creating and deleting Oracle schemas (users) for mapped model classes via the CreateDatabase/DeleteDatabase methods of the DataContext class was implemented.
Features of the implementation:
- the names of the objects, which should be created, are get from the names of the tables, on which entity classes are mapped;
- the DatabaseAttribute value is ignored;
- if all entity classes are mapped to simple table names (without any schema name) - no schema (user) will be created/deleted;
- the user, under which you are connecting to Oracle, and with which a schema(user) is created, must have the necessary privileges to create users and grant them privileges CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, UNLIMITED TABLESPACE;
- if the entity classes are mapped to tables from different schemas and have foreign keys between each other, such a situation is not currently supported.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Mon 14 Sep 2015 11:22
by AKRRKA
Hello.I decided to try the new features. I can not understand how to create a connection string.
Please help me understand. Initial data:
1) There is established "Orakle 11 XE";
2) There is a user "SYS" and the password is known;
To test the connection string I use just such a:
"user id = SYS; password = *********; server = 10.5.5.199; connect mode = SysDba; unicode = True; direct = True; sid = XE ; persist security info = True "
1) How to build a connection string, and call the function "CreateDatabase ()", to create a scheme such as "CEDATABASE"?
2) How to set a password for the user CEDATABASE?
3) What are his access rights and roles?
Please give an example.
Re: LinqConnect Professional Version 4.2.306 (08-Aug-2013)- Oracle create Database.
Posted: Wed 16 Sep 2015 05:26
by MariiaI
1) How to build a connection string, and call the function "CreateDatabase ()", to create a scheme such as "CEDATABASE"?
The names of the schemas/users, which should be created, are get from the names of the tables, on which entity classes are mapped:
Code: Select all
[Table(Name = @"CEDATABASE.""Class1s""")]
public partial class Class1 : INotifyPropertyChanging, INotifyPropertyChanged
{...}
JIC: you can set the Target Schema for the whole model via the
Model Settings -> Synchronization -> Mapping
Please see the sample project, which we have sent you.
2) How to set a password for the user CEDATABASE?
When this user is created, the CREATE SESSION privilege is not set for it. Thus, by default, the password is not needed.
You can set the necessary password and privileges/roles after the user is created.
3) What are his access rights and roles?
As we have written above, the user, under which you are connecting to Oracle, and with which a schema(user) is created, must have the necessary privileges to create users and grant them privileges CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, UNLIMITED TABLESPACE.
Thus, the user is created with privileges : "GRANT CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, UNLIMITED TABLESPACE..."
You can set the necessary password and privileges/roles after the user is created.
We've sent you a sample project to the e-mail address you provided in your forum profile. Please check that is not blocked by your mail filter.