creating a copy of table in oracle code example

Example 1: copy table oracle

CREATE TABLE New_Table_name AS SELECT * FROM Existing_table_Name;

Example 2: oracle copy table

-- Copy a table (datas, columns and storage parameters)
CREATE TABLE my_new_table AS SELECT * FROM my_source_table;
-- Use NOLOGGING, and PARALLEL if allowed for faster copy
CREATE TABLE my_new_table
    PARALLEL 10 NOLOGGING
AS
SELECT /*+ parallel(10) */ * FROM my_source_table;
-- To create an empty table:
CREATE TABLE my_new_table AS SELECT * FROM my_source_table
	WHERE rownum = 0;

Tags:

Sql Example