Schema__oracle in Oracle

Source: Internet
Author: User
Tags dba

You can have more than one application data table in a database, tables of these different applications can be placed in different schemas, and each schema corresponds to a user, and different applications can connect to the database with different users, so that a large database can be managed separately according to the application.
There is no direct relationship between the different schemas, the tables between different Shcema can have the same name, or they can refer to each other (but must have permission), and each user can only manipulate all the tables under its own schema without manipulating the root of the other schema. A table with the same name under a different schema can be stored in different data (that is, the schema user's own data).

Oracle schemas are common to almost user/users. A schema is a group of database object (such as tables, views, packages, sequences, and so on) that belong to the user, and all object belonging to a user is called a schema.
If you use Oracle's Enterprise Manager Enterprise Manager, you will find that the user inside is called schema.

Schema Chinese means the scheme.
"Scheme" is only a classification of Oracle, different users have different scenarios.
Take DBA Studio and divide the four categories on the left: (routines, storage, security, scenarios)
Routines: The start of the management library ... Sort of.
Storage: Manage table spaces, data files, and so on.
Security: is to manage users (password, table space allocation ...)
Scenario: There are (tables, views, stored procedures ...), different users have different cases.
For example: the user name-related table will appear after the "scheme"-> Select your username.

----------------------------Two concepts ──user and schemas that are not easily understood

User is a control, and schema is a container, and if you need to access objects under this container, you need to write the name of schema (owner) in front of the object, and if you do not want to write and create synonym, you can pass the ALTER session set Current_schema=schema_name to change the schema of the current session to omit schema (owner) when accessing the object, whether or not to access the object or to see if there is permission to access the object, regardless of schema.

Deep understanding of the difference between user and schema:

User, Oracle, and all systems are similar to the concept of user, users have a lot of system permissions and resources;

Schema covers a variety of objects, including tables, functions, packages, and so on "location", does not include their rights control.

Like a house filled with furniture, it is the owner (user) of the house, not the house (schema), that has dominion over these families.

You can also be the owner (user) of a house and have your own house (schema). You can enter someone's house by alter session.

At this time, you can see other people's House furniture (DESC).

If you do not specifically specify, the actions you do are directed at the things in your current house.

Whether or not you have permission to use (select), Move (update), or take (delete) The furniture will see if the owner of the house has given you such permission, or you are the Boss (DBA) of the entire building (DB). The ALTER session set schema can be used instead of synonyms.

If you want to invoke other schema objects (with permissions), but do not build synonym, and do not want to put other schema names into the code, you can first use ALTER session set schema=< other schema name >.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.