Analysis on oracle synonyms, sequences, and views

Source: Internet
Author: User


Synonyms are aliases of database objects. Oracle can create a specific alias for tables, views, sequences, stored procedures, functions, and packages.
Two types of synonyms:
> Private SYNONYM: a user (including non-administrator users) with the create synonym permission can CREATE a private SYNONYM. The created private SYNONYM can only be used by the current user.> Public synonym: the system administrator of www.2cto.com can create a public synonym, which can be accessed by all users. Syntax: CREATE [or replace] [PUBLIC] SYNONYM [solution]. synonym_name FOR [solution]. object_name;> CREATE [or replace]: this parameter is generally used. When creating a synonym, if it already exists, REPLACE it.> PUBLIC: create a PUBLIC synonym. Generally, you do not need to create a PUBLIC synonym. Sequence sequence: an object used to generate continuous data sorting. It is often used as the growth column in the primary key. It can be in ascending or descending order. Syntax: create sequence sequence_name [start with num] www.2cto.com [increment by increment] [MAXVALUE num | NOMAXVALUE] [MINVALUE num | NOMINVALUE] [CYCLE | NOCYCLE] [CACHE num | NOCACHE] Syntax Parsing:> start with: Starting from an integer, the default value in ascending order is 1, and the default value in descending order is-1.> increment by: Number of increases. An integer is generated in ascending order, and a negative integer is generated in descending order. The default value in ascending order is 1, and the default value in descending order is-1.> MAXVALUE: maximum value, maximum growth.> NOMAXVALUE: Use the maximum value of the default option. The maximum value in ascending order is 27 to the power of 10, and the default value in descending order is-1; >>> MINVALUE: Minimum value. >> NOMINVALUE: the default option. The default value is 1 in ascending order, and the default value is 26 to the power of (-10).> CYCLE: indicates that if the ascending order reaches the maximum value, start from the minimum value again. If the descending order sequence reaches the minimum value, start from the maximum value again.> NOCYCLE: indicates that the sequence does not start again. An error is returned when the ascending sequence reaches the maximum value or the descending sequence reaches the minimum value. The default value is NOCYCLE.> CACHE: When the CACHE option is used, a sequence number is generated according to the rule. Keep it in memory. When the next serial number is used, it can respond faster. oracle will produce the serial number 20 by default.> NOCACHE: serial numbers are not generated in memory in advance. View view: a pre-defined query for one or more tables. These tables are called base tables. Www.2cto.com Syntax: CREATE [or place] [{FORCE | NOFORCE}] VIEW view_name as select query [with read only]; Syntax Parsing:> FORCE: even if the base table does not exist, you can also create a view, but the view cannot be used normally. After the base table is created successfully, the view can be used normally.> NOFORCE: if the base table does not exist, you cannot create a view. It is the default option.> With read only: by default, you can add, delete, modify, and query the base table through the view. with read only indicates that the view is READ-ONLY. Most views are read-only. From the column of vean_system

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.