• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Oracle Create Schema - What do I use for authorization?

 
Ranch Foreman
Posts: 884
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Oracle Live to practice SQL.  

I expect that before I begin creating tables I need to create a schema.   I found the syntax below but what do I use for the authorization name?

CREATE SCHMA  hospital AUTHORIZATION kevin

Thanks,

Kevin
 
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You (or the DBA) create the user using the CREATE USER DDL command. I cannot recall offhand what Oracle's exact usages are, but generally, you'd use a statement like "CREATE USER fred IDENTIFIED BY 'fredspassword';"

When using JDBC or logging into an Oracle server via something like SQL*PLUS, you'd supply those credentials rather than the (unsafe) master credentials. You use the GRANT DDL statement to control which user(s) have what rights on which schema resources.

Some DBMS's allow not only individual user definitions, but assigning them to security groups or roles, which can often be useful when you want common rules for multiple users and/or don't want to tie GRANT rights to a specific user.  Here again, I can't recall if Oracle has something like that, but as it's an advanced feature, probably.
 
Marshal
Posts: 4519
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't worked with an Oracle DB for a while so this may not be exactly correct, but it should be something like this:
 
kevin Abel
Ranch Foreman
Posts: 884
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim and Ron,

I appreciate the responses.  

The information that you sent all looks familiar but I also don't remember the details.  

I'm in the Oracle Live Practice area.  Since I don't know the DB part about creating the schema and then attaching Tables that its OK to Create Tables and use them as stand alones.  I'm hoping that I can still do the joins and SQL searches with out the full name of schema.table.

I guess that I'll find out.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic