0

I am trying to keep my school works under one user account. Currently I am making a new database user for every lab session. Surely this is not the right way to go?

I want to create a another schema, alongside my existing schema.

NB. I see a dropdown option for schema in the SQL workshop. So there might be a option to create multiple schema. But I can't find how to do it. The google links all say I have to create a new user.

1 Answers1

0

In Oracle user is owner of its schema. User is an account that can access database. It depends on grants if it can access only own schema or more schemas.

When you create user you create schema. You can't create just a schema and assign it to existing user. However you can create new user with schema and grant other users access to newly created schema. In your case if you want new schema for each lab you need to create user for each lab and then grant privileges to your main user.

Here you can find some explanations: Difference between a user and a schema in Oracle?

Community
  • 1
  • 1
Kacper
  • 4,798
  • 2
  • 19
  • 34
  • OK, one more small question. In oracle do I have to add each table separately? And insert each list of data per table separately? Because if I want to include everything at once, it shows invalid character. – precipice120 Oct 29 '16 at 20:52
  • @precipice120 I'm not sure if I understand. You want to create or import many tables? You can prepare script with multiple creates and inserts. Just follow the rules like putting `;` after each create and it should work – Kacper Oct 29 '16 at 20:55
  • I want to insert this: ` insert into course values ('BIO-101', 'Intro. to Biology', 'Biology', '4'); insert into course values ('BIO-301', 'Genetics', 'Biology', '4'); `, but in the sql command line, if i run these two queries at the same time, I get _ORA-00911: invalid character_. But if I just run one of these at a time it works. Is there any way to do it, without having to copy paste each and every single line individually? – precipice120 Oct 29 '16 at 21:00
  • @precipice120 As sql command line you probably mean SQLplus. One is use IDE like SQLdeveloper second is prepare script insert.sql which contains all inserts line by line and then execute it by calling `@insert.sql` – Kacper Oct 29 '16 at 21:04