Schema Analysis in Oracle

Source: Internet
Author: User
A database can contain data tables of multiple applications. Tables of different applications can be stored in different schemas,
At the same time, each schema corresponds to one user, and different applications can connect to the database with different users,
In this way, a large database can be managed separately based on the application. Www.2cto.com
  There is no direct relationship between different schemas. Different shcema tables can have the same name,
You can also reference each other (but you must have permissions). If you do not have the root permission to operate other schemas,
Each user can only operate on all tables in its own schema. Tables of the same name in different schemas,
You can store different data (that is, the data of the schema user ).   In Oracle, schema is almost the same as user/user. Schema refers to a group of database objects.
(Such as tables, views, packages, sequences, and so on), and these objects belong to users,
All objects belonging to a user are called schema. If you use Enterprise Manager of Oracle, you will find that the user is called schema.   Schema is a solution. "solution" is only a classification of Oracle, and different users have different solutions. For DBA studio, there are four categories on the left: (routine, storage, security, solution) Routine: it is the start of the Management Library, such as. www.2cto.com. Storage: Manage tablespaces and data files. Security: it is to manage users (password, tablespace allocation ...) Solution: There are (tables, views, stored procedures...). Different users have different cases. For example, a table related to the user name appears only after you select "solution"> "User Name.   ---------------------------- Two concepts that are hard to understand-user and schema   The user permission is controlled, while the schema is a container. If the user is not the owner, access the objects in the container
You need to write the schema (owner) name before the object. If you do not want to write but have not created synonym, in this case, you can use alter session set current_schema = Schema_name to change the schema of the current session and save the schema (owner) when accessing the object ); the final access to the object depends on whether the object has the permission to access the object and is not related to the schema.   A deep understanding of the differences between user and Schema:   A user is a user in Oracle. Similar to a user in all systems, a user has system permissions and resources;   Schema covers various objects, including the "location" of objects such as tables, functions, and packages, and does not include permission control over them.   For example, a house is filled with furniture. The owner of the house (User) who has the right to control the furniture, rather than the schema ).

You can also be the owner of a house and have your own schema ). You can use the alter session method.
Enter someone else's house. Www.2cto.com   At this time, you can see the furniture (DESC) in someone else's house ).   If you do not specify anything, all the operations you do are for the things in your current house.   Whether you have the permission to use (select), update, or delete the furniture depends on the house.
Has the master granted you such permissions, or you are the boss (DBA) of the entire building (db ).
Alter session set schema can be used to replace synonyms.   If you want to call other schema objects (with permissions) but have not created synonym,
At the same time, I do not want to put other schema namesCode, You can first use alter session set schema = <other schema names>.   From the column of it_man


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.