Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Oracle database USER and SCHEMA [SOLVED]

Oracle database USER and SCHEMA [SOLVED]

Scheduled Pinned Locked Moved Database
databasequestionoraclexmlhelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Valentinor
    wrote on last edited by
    #1

    In Oracle DB, what are the terms USER and SCHEMA? From what I've read, schema refers to all the content a database has (tables, sequences, views ...) which belongs to a USER. But what is a USER? Is it like an "internal database"? I mean, let say that I have 2 programs (Planet Help | City industries) that each need 2 separate databases. So, can I create a USER with the name planetDatabase, and another with the name cityDatabase, which would mean I have 2 "internal databases"? And in each "internal database" I can create specific users that have restricted access to certain functions in their respective "internal database"? Or I am way off what a USER actually is?

    C L 2 Replies Last reply
    0
    • V Valentinor

      In Oracle DB, what are the terms USER and SCHEMA? From what I've read, schema refers to all the content a database has (tables, sequences, views ...) which belongs to a USER. But what is a USER? Is it like an "internal database"? I mean, let say that I have 2 programs (Planet Help | City industries) that each need 2 separate databases. So, can I create a USER with the name planetDatabase, and another with the name cityDatabase, which would mean I have 2 "internal databases"? And in each "internal database" I can create specific users that have restricted access to certain functions in their respective "internal database"? Or I am way off what a USER actually is?

      C Offline
      C Offline
      CHill60
      wrote on last edited by
      #2

      USER in Oracle is a function that returns the name of the User for the current session - Oracle / PLSQL: USER function[^] - an analogy for that would be the "person" logged on (but a user is not necessarily a person) Schemas can be User specific - within a database. They are not databases in themselves. Think of them as the "user account". Well I made that as clear as mud! The best explanations of the differences that I've found are on this link[^] which also includes a link to this post[^] . General consensus of opinion seems to be that Oracle made a mess of the terminology!

      V 1 Reply Last reply
      0
      • V Valentinor

        In Oracle DB, what are the terms USER and SCHEMA? From what I've read, schema refers to all the content a database has (tables, sequences, views ...) which belongs to a USER. But what is a USER? Is it like an "internal database"? I mean, let say that I have 2 programs (Planet Help | City industries) that each need 2 separate databases. So, can I create a USER with the name planetDatabase, and another with the name cityDatabase, which would mean I have 2 "internal databases"? And in each "internal database" I can create specific users that have restricted access to certain functions in their respective "internal database"? Or I am way off what a USER actually is?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        As an example, let's see what Oracle says about "schema";

        docs.Oracle.com[^] wrote:

        A schema is a collection of logical structures of data, or schema objects. A schema is owned by a database user and has the same name as that user. Each user owns a single schema. Schema objects can be created and manipulated with SQL and include the following types of objects: (list of stuff)

        Introduction is here[^].

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

        1 Reply Last reply
        0
        • C CHill60

          USER in Oracle is a function that returns the name of the User for the current session - Oracle / PLSQL: USER function[^] - an analogy for that would be the "person" logged on (but a user is not necessarily a person) Schemas can be User specific - within a database. They are not databases in themselves. Think of them as the "user account". Well I made that as clear as mud! The best explanations of the differences that I've found are on this link[^] which also includes a link to this post[^] . General consensus of opinion seems to be that Oracle made a mess of the terminology!

          V Offline
          V Offline
          Valentinor
          wrote on last edited by
          #4

          So, using my example, if I have 2 programs, and if I need a DB for each of them "Planet Help DB" and "City industries DB" (random names, no connection to real ones), can I create two Database users, using Application Express, one with the name "PlanetHelpDB" and the other "CityIndustriesDB", and use those as a DB for each app? I see that in both of them I can have tables with the same names as in the other one, and also for each I can create new users using "Administration" tools (from Application Express), which will be linked/restricted to a default schema (PlanetHelpDB or CityIndustriesDB, in my example). Is this a good or a bad way to do it? In case it is bad, what is the recommended way to do it (to have 1 database for each app)?

          C 1 Reply Last reply
          0
          • V Valentinor

            So, using my example, if I have 2 programs, and if I need a DB for each of them "Planet Help DB" and "City industries DB" (random names, no connection to real ones), can I create two Database users, using Application Express, one with the name "PlanetHelpDB" and the other "CityIndustriesDB", and use those as a DB for each app? I see that in both of them I can have tables with the same names as in the other one, and also for each I can create new users using "Administration" tools (from Application Express), which will be linked/restricted to a default schema (PlanetHelpDB or CityIndustriesDB, in my example). Is this a good or a bad way to do it? In case it is bad, what is the recommended way to do it (to have 1 database for each app)?

            C Offline
            C Offline
            CHill60
            wrote on last edited by
            #5

            In my own experience, having tables with the same name in two different schemas on the same database has led to issues (when people writing queries have omitted the schema name when referring to the table). If there is absolutely nothing in common between the databases then I would probably have two separate databases and manage them separately. It rather depends on how things like backups, transaction logs, etc will be handled and if there are benefits to having the schemas held on the same db. However, if these apps are for the same corporation and use different tables then I would put them on the same database, no need for differentiating schemas and users unless you want to use them to control access, or might want to in the future. We are currently using schemas in a corporate database to indicate which "area" (application if you like) "owns" the data in the table(s) and using the dbo schema for common data (i.e. no tables with the same name in different schema). I'm yet to discover if this will cause us problems. As you can probably gather .. "good" or "bad" is quite subjective and depends greatly on what the overall infrastructure is going to look like

            V 1 Reply Last reply
            0
            • C CHill60

              In my own experience, having tables with the same name in two different schemas on the same database has led to issues (when people writing queries have omitted the schema name when referring to the table). If there is absolutely nothing in common between the databases then I would probably have two separate databases and manage them separately. It rather depends on how things like backups, transaction logs, etc will be handled and if there are benefits to having the schemas held on the same db. However, if these apps are for the same corporation and use different tables then I would put them on the same database, no need for differentiating schemas and users unless you want to use them to control access, or might want to in the future. We are currently using schemas in a corporate database to indicate which "area" (application if you like) "owns" the data in the table(s) and using the dbo schema for common data (i.e. no tables with the same name in different schema). I'm yet to discover if this will cause us problems. As you can probably gather .. "good" or "bad" is quite subjective and depends greatly on what the overall infrastructure is going to look like

              V Offline
              V Offline
              Valentinor
              wrote on last edited by
              #6

              Quote:

              If there is absolutely nothing in common between the databases then I would probably have two separate databases and manage them separately.

              They will have some stuff in common, like the user data (username, email, password ...) and other stuff too, but they will also have some data that will be needed only for them separatly. So I'm goin to use something like you said.

              Quote:

              We are currently using schemas in a corporate database to indicate which "area" (application if you like) "owns" the data in the table(s) and using the dbo schema for common data (i.e. no tables with the same name in different schema).

              I'm new to this whole area of DB, so comments/suggestions like this one are really useful (practical not theoretical). Thanks!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups