Ⅰ oracle怎樣導入*.sql文件
oracle導入*.sql文件只需要在Oracle伺服器的命令行里sqlplus / as sysdba命令可以登陸到sqlplus命令行里。
然後比如是C:/a.sql,那麼就執行@C:/a.sql,然後跑完後這個a.sql就被導入進來了。
Ⅱ 怎樣將Oracle中的數據導出成SQL腳本
1、打開PL/SQL DEV,然中要進行導出的表,點擊右鍵,在彈出的菜單中,選中Export data(如下圖所示)。
在窗口下方,選中SQL Inserts標簽頁,設置導出條件。
3、設置完成後,點擊Export按鈕,即可導出。
Ⅲ oracle導入sql文件
1. 獲取幫助
imp help=y
2. 導入一個完整資料庫
imp system/manager file=bible_db log=dible_db full=y ignore=y
3. 導入一個或一組指定用戶所屬的全部表、索引和其他對象
imp system/manager file=seapark log=seapark fromuser=seapark
imp system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)
4. 將一個用戶所屬的數據導入另一個用戶
imp system/manager file=tank log=tank fromuser=seapark touser=seapark_
imp system/manager file=tank log=tank fromuser=(seapark,amy)
touser=(seapark1, amy1)
5. 導入一個表
imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)
6. 從多個文件導入
imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G full=y
7. 使用參數文件
imp system/manager parfile=bible_tables.par
bible_tables.par參數文件:
#Import the sample tables used for the Oracle8i Database Administrator's
Bible. fromuser=seapark touser=seapark_ file=seapark log=seapark_import
8. 增量導入
imp system./manager inctype= RECTORE FULL=Y FILE=A
-------------------------------------------------------------------------------------------------------------------------------------------
1. 獲取幫助
exp help=y
2. 導出一個完整資料庫
exp system/manager file=bible_db log=dible_db full=y
3. 導出資料庫定義而不導出數據
exp system/manager file=bible_db log=dible_db full=y rows=n
4. 導出一個或一組指定用戶所屬的全部表、索引和其他對象
exp system/manager file=seapark log=seapark owner=seapark
exp system/manager file=seapark log=seapark owner=(seapark,amy,amyc,harold)
注意:在導出用戶時,盡管已經得到了這個用戶的所有對象,但是還是不能得到這些對象引用的任何同義詞。解決方法是用以下的SQL*Plus命令創建一個腳本文件,運行這個腳本文件可以獲得一個重建seapark所屬對象的全部公共同義詞的可執行腳本,然後在目標資料庫上運行該腳本就可重建同義詞了。
SET LINESIZE 132
SET PAGESIZE 0
SET TRIMSPOOL ON
SPOOL c:\seapark.syn
SELECT 'Create public synonym '||synonym_name
||' for '||table_owner||'.'||table_name||';'
FROM dba_synonyms
WHERE table_owner = 'SEAPARK' AND owner = 'PUBLIC';
SPOOL OFF
5. 導出一個或多個指定表
exp seapark/seapark file=tank log=tank tables=tank
exp system/manager file=tank log=tank tables=seapark.tank
exp system/manager file=tank log=tank tables=(seapark.tank,amy.artist)
6. 估計導出文件的大小
全部表總位元組數:
SELECT sum(bytes)
FROM dba_segments
WHERE segment_type = 'TABLE';
seapark用戶所屬表的總位元組數:
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE';
seapark用戶下的aquatic_animal表的位元組數:
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE'
AND segment_name = 'AQUATIC_ANIMAL';
7. 導出表數據的子集(oracle8i以上)
NT系統:
exp system/manager query='Where salad_type='FRUIT'' tables=amy.salad_type
file=fruit log=fruit
UNIX系統:
exp system/manager query=\"Where salad_type=\'FRUIT\'\" tables=amy.salad_type
file=fruit log=fruit
8. 用多個文件分割一個導出文件
exp system/manager
file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G tables=hr.paycheck
9. 使用參數文件
exp system/manager parfile=bible_tables.par
bible_tables.par參數文件:
#Export the sample tables used for the Oracle8i Database Administrator's Bible.
file=bible_tables
log=bible_tables
tables=(
amy.artist
amy.books
seapark.checkup
seapark.items
)
10. 增量導出
「完全」增量導出(complete),即備份整個資料庫
exp system/manager inctype=complete file=990702.dmp
「增量型」增量導出(incremental),即備份上一次備份後改變的數據
exp system/manager inctype=incremental file=990702.dmp
「累計型」增量導出(cumulative),即備份上一次「完全」導出之後改變的數據
exp system/manager inctype=cumulative file=990702.dmp
imp boss/boss@scott file=jkluio.dmp log=jkluio.log fromuser=boss touser=boss commit=y;
exp boss/123qwe!@CBGLDB file=boss.dmp log=boss.log owner=boss;
Ⅳ 怎麼向oracle中導入大sql文件
向oracle中導入大sql文件:
在SQL_PLUS裡面執行:
sql>@full_path/test.sql;
例:sql>@D:/test.sql;
不需要commit; 一般都是在test.sql 裡面最後加上一個commit;
但是需要注意的是:在test.sql文件裡面每條語句後必須加上「;」,代表一條語句的執行。
Ⅳ 如何 oracle 導出 數據 sql 格式
導出是用ms自帶的ole
db
provider訪問介面導出:
1.右鍵要導出的資料庫【任務】-》【導出數據】-》設置導出數據源
2.設置oracle為目標數據源
3.設置目標表(創建)
4.編輯欄位
由於sqlserver的t-sql與oracle的pl/sql定義數據類型不一樣,這里注意要修改類型:
int
->
number
(注意設置number的精度)
nvarchar
->
varchar2
(最好是nvarchar2,但ms這個驅動只提供這種轉換)
datetime
->
date
也可以直接編輯sql,注意pl/sql的編寫方式,編輯完之後下一步
5.這里的datetime轉成date是有警告的,不過沒關系,然後可以忽略出錯與截斷,下一步:
6.點擊完成
在oracle
em裡面查看剛才導出的數據表及數據