"Translated from MoS article" establishes synonym for the partition of table

Source: Internet
Author: User

This document is referenced from:

How to Create a synonym on a Table Partition (Doc ID 119805.1)

How to create a synonym on a Table partition:=============================================you cannot directly create a SYN  onym on a table partition by specifying the partition name and table name with the CREATE synonym command.  You had to create a view in the partition, and then create a synonym on the view. This is a two-step method instead of a Single-step method. Follow the steps in this example to create the synonym: $ sqlplus scott/tiger sql> CREATE TABLE emp_pt (empno num BER primary KEY, Ename VARCHAR2 (()) partition by range (EMPNO) (partition p8000 values less than (8001) , partition p9000 values less than (9001), partition p10000 values less than (10001), partition pothe RS values less than (99999999));        sql> INSERT INTO Emp_pt select Empno, ename from EMP; ---populated the partition table EMP_PT with existing---data from the EMP table. Sql> commit;      Sql> select * from Emp_pt; EMPNO ename----------------------7369 SMITH 7499 ALLEN 7521 WARD 7566 JONES 7654 MARTIN ...      9999 ANDY sql> SELECT * from EMP_PT partition (p8000);  EMPNO ename--------------------------7369 SMITH 7499 ALLEN 7521 WARD 7566 JONES 7654      MARTIN ... 7934 MILLER sql> CREATE VIEW emp_pt_p8000 as SELECT * from EMP_PT partition (p8000);    sql> desc emp_pt_p8000 Name Null? Type----------------------------------------------------EMPNO Numbe R ename VARCHAR2 (sql>) create synonym p8000 for emp_pt_p8000;    sql> desc p8000 Name Null? Type----------------------------------------------------EMPNO Numbe R ename VARCHAR2 (sql>) SELECT * from p8000; EMPNO ename-----------------------------------7369 SMITH 7499 ALLEN 7521 WARD 7566 JONES 7654 M     Artin ... 7934 MILLER sql>


"Translated from MoS article" establishes synonym for the partition of table

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.