oracle如何備份表的資料或者是將表中的資料插入到令一張新表裡

2022-02-14 01:24:02 字數 4271 閱讀 9116

1樓:匿名使用者

只複製空表結構

create table 新表名 as

select * from 舊錶名 where 1<>1;

複製表結構和資料

create table 新表名 as

select * from 舊錶名

2樓:煙忒

insert into 《新表表名》 select * from 《舊錶表名》

在oracle中怎麼把一張表的資料插入到另一張表中

在oracle中如何將一個表中所有資料加到另一個表中

3樓:匿名使用者

create table newtablename as select * from oldtablename;

insert into tab2(id,num) select id, num, from tab1 where id>12;

如果是全部複製的話 ,這個where 條件可以省略。

其實你簡單的而理解後面的select是一個view或者是一箇中間表都ok;

只要你知道他們的欄位什麼的設定都一樣就完全可以insert 。條件是他們的欄位必須對應

4樓:我愛瓜瓜啊

首先要看兩個表的欄位是否一致,如果一致的話,就

insert into table1 select * from table2;

如果不一致,還需要分情況處理的:

1、如table1的欄位為 id,name,value,而table2的欄位為id,name

insert into table1 select id,name,null from table2;//在這裡需要給table1的value欄位賦值的,先賦空值,不然會出錯的

2、如table1的欄位為 id,name,而table2的欄位為id,name,value

insert into table1 select id,name from table2;試下吧

5樓:匿名使用者

insert into table1 select * from table2 ;

或者create table1 as select * from table2 ;

6樓:匿名使用者

create table 表b as select * from 表a;

insert into 表a (select * from 表b);

7樓:匿名使用者

local_table

select * from table@remote_db_link;

8樓:匿名使用者

insert into a_table as select * from table_b

9樓:

insert into ...select

oracle 怎麼快速把一個資料庫其中一個表的內容插入到另一個資料庫裡面。

10樓:咖哩小西瓜

1、先建立一個database link,將兩個庫連線起來語法:create database link 連結名 connect to 賬戶 identified by 口令 using 服務名;

例子:create database link mylink connect to user_name identified by password using 'test01'

2、用insert into將test01表a的資料寫入test表ainsert into [資料庫名].[dbo].[表名] select * from [資料庫名].

[dbo].[表名]@mylink where 時間》'2013-07-24'

11樓:

有2種解決方式,

1種是建立一個資料連結

create table t_b as select * from t_a@orcl_db;

2 直接通過 匯出、匯入解決

12樓:西門公子慶

資料都在一個資料庫的話,那就直接insert into table1 select * from table2 where 。。。時間條件。。 就可以了。

不再一個庫的話。可以建dblink,然後同樣。。

13樓:匿名使用者

可以加個database link

oracle 如何備份一個表的資料 或者是將一個表中的資料插入到令一張新表裡?

14樓:匿名使用者

只複製空表結構

create table 新表名 as

select * from 舊錶名 where 1<>1;

複製表結構和資料

create table 新表名 as

select * from 舊錶名

在oracle中怎麼將查詢到的資料插入到另一個表中

15樓:小丁創業

1、首先,一個學生資料表,在這裡需要修改資料表中studentname資料表中的個人資料,如下圖所示,然後進入下一步。

2、其次,完成上述步驟後,開啟資料庫查詢語句,輸入查詢語句,然後首先查詢資料表中的資料內容,如下圖所示,然後進入下一步。

4、然後,完成上述步驟後,在student表的第4行(studentname中的「崔」)中,需要將其更改為「亮亮」,如下圖所示,然後進入下一步。

6、接著,完成上述步驟後,選擇內部內容並將其更改為「

亮亮」,如下圖所示,然後進入下一步。

7、然後,完成上述步驟後,選擇右鍵單擊內容,然後選擇內部執行選項,如下圖所示,然後進入下一步。

8、最後,完成上述步驟後,使用資料查詢語句以相同的方式查詢資料,可以看到下圖中的資料內容已成功修改並插入到另一個表中,如下圖所示。這樣,問題就解決了。

16樓:匿名使用者

insert into t1(c1,c2,c3) select c1,c2,c3 from t2

create v1 as select c1,c2,c3 from t2,檢視不是實際表,資料不用sql句插入。

17樓:

insert into t_tab

select * from s_tab where 條件檢視 可以看作是哈哈鏡裡看到的 一個或多個table的變形,只要表變化, 檢視看到的內容也會跟著變化的

18樓:匿名使用者

1.insert into 表1 (欄位1,欄位2,……) select 欄位1,欄位2,…… from 表2

2.試圖是虛擬表,它不能當做操作步驟進行 ;

19樓:惠惠

1、insert into t_tab

2、select * from  s_tab where 條件oracle database,又名oracle rdbms,或簡稱oracle。

是甲骨文公司的一款關聯式資料庫管理系統。它是在資料庫領域一直處於領先地位的產品。可以說oracle資料庫系統是目前世界上流行的關聯式資料庫管理系統,系統可移植性好、使用方便、功能強,適用於各類大、中、小、微機環境。

它是一種高效率、可靠性好的 適應高吞吐量的資料庫解決方案。

20樓:

select * into table2 from table1

對檢視也是這樣

oracle中怎麼把一個資料庫其中一個表的內容插入到另一個資料庫裡面?

21樓:橙子

回答步驟:

1、先建立一個database link,將兩個庫連線起來2、用insert into將test01表a的資料寫入test表ainsert into [資料庫名].[dbo].[表名] select * from [資料庫名].

[dbo].[表名]@mylink where 時間》'2013-07-24'

3.語法:

create database link 連結名 connect to 賬戶 identified by 口令 using 服務名;

4.例子:

create database link mylink connect to user_name identified by password using 'test01'

如何資料備份,如何備份電腦資料

進行資料備份 將當前系統資料備份到某一指定碟片 a 盤或b 盤 或特定路徑 硬碟c 或d 盤的某一目錄 下,主要用於資料的備存或將當前系統資料資料移植到其它電腦上。一 將資料備份到軟盤上 由於軟盤容量小 易損壞等原因,本方式不予推薦 進入 管理主系統 的 資料維護 在資料選項框 系統設定庫等 內,通...

如何將excel表中資料匯入oracle資料庫

操作步驟如下 準備資料 在excel中構造出需要的資料 2.將excel中的資料另存為文字檔案 有製表符分隔的 3.將新儲存到文字檔案中的資料匯入到pl sql中 在pl sql中選擇tools text importer,在出現的視窗中選擇 data from textfile 然後再選擇 ope...

如何修改oracle表空間資料檔案的大小為不限制

如果你單獨是想擴充套件表空間,增加資料檔案的個數或增加每個資料檔案的大小均可,增加資料檔案 alter tablespace table name add datafile 資料檔案 size 400m 增加資料檔案的大小 alter tablespace table name add datafi...