Original link http://database.51cto.com/art/201004/192790.htm
The following article focuses on SQL statements that describe Oracle replicated tables, including how to replicate the table structure of SQL.
And how to copy the structure of the related table and copy the data SQL in the table.
as follows, table A is a table that already exists in the database, and B is a table that is ready to be copied from table A:1, copy only table structure sqlcreate table B as Select* fromAwhere 1<>1
2sqlcreate Table B, that is, copying the tables structure and copying the data in the table as Select* fromA
3, the Sqlcreate table B of the development field for Oracle replication tables as SelectRow_id,name,age fromAwhere 1<>1
The premise is that row_id,name,age are all columns of table A.4, copying the specified fields of the table and the data for those specified fields Sqlcreate table B as SelectRow_id,name,age fromA
Although the above statement can easily be based on the structure of a table to create a B table, but the index of a table can not be copied, you need to manually set up in B. 5, insert into will save the query results to an existing table insert into T2 (column1, Column2, ....)SelectColumn1, Column2, .... fromT1
The above related content is the Oracle copy table of SQL statement, I hope you can gain some.
"Editor's recommendation"
- The actual operation of parallel execution of the Oracle database
- Issues to be aware of in Oracle RAC configuration
- Specific ways to reinstall after Oracle removal
- About Oracle Memory Architecture Research
- An explanation of the installation and configuration of Oracle database
"Go" Oracle How to copy a table's SQL statement