Backup of Oracle database tables and deletion of data tables

Source: Internet
Author: User

--table backups in the Oracle database:--BACKUP statement: After the backup, you can delete all the data sources for this table, but then someone will manipulate the table's data, but remember to restore the data table after the operation is complete.CREATE TABLEDzhyukkt_backup as SELECT *  fromDzhyukkt;--query Backup is not successful:SELECT *  fromDzhyukkt_backup;--data can be found to prove that the backup was successful--to restore a database backup table:INSERT  intoDzhyukktSELECT *  fromDzhyukkt_backup;--two ways to clear database table information:--1. Delete from T--2. TRUNCATE TABLE T --difference:--1. Delete is a DML operation; Truncate is a DDL operation and DDL Implicit commits cannot be rolled back--2, delete from T can be rolled back, TRUNCATE TABLE t can not be rolled back--3. TRUNCATE TABLE T performs more efficiently, reclaims table space, delete from T performs slowly, does not reclaim tablespace--4. TRUNCATE TABLE T high waterline drops, delete from T high watermark does not drop (this is not quite clear ...) Starting from 1 after the id,truncate, the delete is followed by a self-increment--Call Delete to delete the table data:DELETE  fromDzhyukkt;COMMIT;--Use Backup table: dzhyukkt_backup restore Dzhyukkt;INSERT  intoDzhyukktSELECT *  fromDzhyukkt_backup;COMMIT;--Normal recovery data

Backup of Oracle database tables and deletion of data tables

Related Article

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.