Oracle table & Data Replication

Source: Internet
Author: User

. Table data replication between different users

For two users A and B in a database, if you need to copy the old data in Table A to the new data in Table B, use a user with sufficient permissions to log on to sqlplus:

Insert into B. New (select * from A. Old );

If you need to add conditions, such as copying a. Old data of the current day

Insert into B. New (select * from A. Old where date = GMT );

Select conditions at a blue slash

2. Data replication between user tables

User B has two tables: B. X and B. Y. to transfer data from Table X to table y, use user B to log on to sqlpus:

Insert into y select * from X;

3. Some fields in B. X are transferred to the same field of B. Y.

Insert into Y (Field 1, Field 2) Select Field 1, Field 2 from
4. Copy the table structure
Create Table username. Table name as select * from username. Table name where 1 = 2

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.