----Database objects: A collection of logical structures----synonyms: Aliases for existing objects/*function:Simplifying SQL statementshide the name and owner of an objectprovides public access to an objectCategory: */--public synonym: can be accessed by all database users, local objects take precedence when local objects have the same name as public objectscreate public synonym syn1 for scott.emp;select *
, privilege, grantable, hierarchy
FROM user_tab_privs_recd
Order by table_name, privilege;
By querying user_col_privs_recd, you can check which columns a user has granted the object privileges.
Example: Query user_col_privs_recd
SELECT owner, table_name, column_name, grantor, privilege, grantable
FROM user_col_privs_recd;
4. Use object privileges
After a user is granted the Object Privilege, the user can use this privilege to execute a specific task,
For example, steve has the SELECT privilege
Tables are divided into system tables and user tables.Database objects
Tables (basic storage objects, composed of rows and columns), views (logical subset data obtained from one or more tables), sequences (unique serial numbers automatically generated), index (improves query performance), synonym (simplified access to data objects) standard naming rules
Table Name and column Name:
The first symbol must be a letter.
1-30 characters
Can only contain A-Z
from User_sequences5, Synonyms: Object alias, do not occupy spacePurpose: Simplifies SQL statements, hides object names and owners, provides location transparency for remote objects, and provides public access to database objects.Category: Private synonyms, public synonyms1) Private synonym: Must have create [any] synonym permission only by current mode user accessCreae
1. Why use synonyms:Synonyms, as the name implies, are the same as the meaning of two words, can be replaced with each other. What is its role?A one of the most obvious goals is to simplify SQL. If a database object's name is too long, you can create a shorter synonym. It is equivalent to an abbreviation.B. Another goal is to hide information about some objects. For example, to find a table in another schema, you need to prefix the table name with the
50. SLS is a private synonym for the SH. SALES table.The user SH issues the following command:Drop synonym sls;Which statement is true regarding the above SQL statement?A. Only the synonym wocould be dropped.B. The synonym wocould be dropped and the corresponding table wocould become invalid.C. The
iSQL * Plus to check whether the "business" table has changed.
SQL> select * from business;
4. delete a view
(1) Use the Enterprise Manager to delete the "business_view" view.
(2) Use the Enterprise Manager to delete the "card_view" view.
(3) use SQL * Plus or iSQL * Plus to delete the "consume_view" view.
SQL> drop view consume_view;
(4) use SQL * Plus or iSQL * Plus to delete the "insurnce_view" view.
SQL> drop view insurance_view;
5. Create a synonym
"KISS Principle ": keep it simple and sweetheart (keep simple, sweetheart ).
9. Proofread before release
Even if you are an English professor, if you haven't proofread it again before you press the publish button, you can easily make mistakes, spelling mistakes, or grammar mistakes in the article. Especially when your mind is surging, your fingers may run faster than your head, and you may encounter missin
pathDbalist = "tianlesoftware@vip.qq.com, tianlesoftware@hotmail.com"; export dbalist
Sqlplus-s '/As sysdba' Set feed offSet heading offColumn owner format A10Column object_name format A35Column object_type format A10Column status format A10Spool invalid_object.alertSelect owner, object_name, object_type, status from dba_objects where status = 'invalid' order by owner, object_type, object_name;Spool offExitEOFIf ['cat invalid_object.alert | WC-l'-GT 0] ThenMailx-s "invalid objects for pprd10" $
Oracle Database Synonyms
I. Definition
A synonym is an alias for a database solution object. The database solution objects here refer to tables, views, sequences, stored procedures, packages, and so on.
2. Benefits of synonyms
1. No memory space occupied, saving a lot of database space
2. simplified access to database objects
3. Improved Database Object Access Security
4. the extended scope of use of databases enables seamless interaction between dif
Label:View and other object operationsExperimental purpose (1) Grasp the establishment of the view, query, modify, delete operations. (2) to master the establishment of synonyms, query, modify, delete operations, compare the operation of the synonym to the original database object is consistent with the operation. (3) Mastering sequence Establishment, query, modification, delete operation, using the sequence to insert data into the database table.
I. background
There are two sid: Asid and Bsid. There are two users Auser1 and Auser2 under Asid, and there is a user Buser1 under Bsid. Among them, Auser2 and Buser1 establish dblink. You want to log on to Buser1 to access three tables table1, table2, table3, and function function1 on auser1.
Step 2
① Log on to Auser1 and authorize Auser2 (add delete if delete is required)
Grant insert, select, update on table1 to Auser2;
Grant insert, select, update on table2 to Auser2;
Grant insert, select, u
Synonym
CREATE [PUBLIC] SYNONYM synonym For schema. object
Hide the Object Name and owner:
Select count (*) from hr. employees;
Create synonym emp for hr. employees; -- by default, it belongs to the donny user and is the private object of donny.
Select count (*) from emp;
Provides location transparency for remote objec
Tags: Io for SP data on cti bs Database SQL Oracle synonyms literally mean aliases. Similar to the view function, they are a ing relationship. Maintenance of users in Oracle is maintained by permissions. That is to say, if we want to use the database, we must have permissions, but if someone else grants us the permissions, we can also perform operations on the database, but it is the name of the user who wants to authorize the table, such as bsrun.doc tor_info, so this is troublesome. What shou
"." V_dnport "PermissionsNote: When querying with northbound log in, add DNINMSV31 to the view before the report or view does not exist.For example:SELECT * from DNINMSV31. V_dndevice; --Can execute normallySELECT * from DNINMSV31. Tb_device where rownum3) Login User viewUse northbound users to create synonyms for the other company system to access:CREATE synonym V_dndevice for DNINMSV31. V_dndevice;CREATE synony
Synonyms (study notes) and synonyms (study notes)Synonym = table alias
Syntax:CREATE [PUBLIC] SYNONYM name FOR database object;
Example 1,
-- Users created by the administrator or users with the permission to CREATE synonyms -- CREATE the synonym conn sys/change_on_install as sysdba for scott; create synonym myemp F
What is the synonym "synonym"?(1) For some long names of objects (table, view, index, sequence, ...) ) do the subtraction, Replace with aliasesThe role of synonyms(1) Shorten the length of the object name(2) Easy access to other users ' objectsCreate synonyms that correspond to the Salgrade table,Create synonym synonyms for table name/view/other objectsCreate
. -------------------------------------------------------------------------------------synonyms What is the synonym "synonym"?(1) For some long names of objects (table, view, index, sequence, ...) ) Do the subtraction, replace with aliases The role of synonyms(1) Shorten the length of the object name(2) Easy access to other users ' objects Creating synonyms for Salgrade tables, create
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.