新聞中心
怎么批量導(dǎo)入oracle包頭和包體
先修改包頭,加入存儲過程聲明,然后再在包體中增加即可! select text from dba_source where owner='xxx' and name='包名' and type='PACKAGE BODY' order by line asc
成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比平南網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式平南網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋平南地區(qū)。費用合理售后完善,十年實體公司更值得信賴。
oracle怎樣導(dǎo)入數(shù)據(jù)庫
我給你一些數(shù)據(jù)庫常用的導(dǎo)入導(dǎo)出命令吧:\x0d\x0a該命令在“開始菜單運行CMD”中執(zhí)行\(zhòng)x0d\x0a一、數(shù)據(jù)導(dǎo)出(exp.exe)\x0d\x0a1、將數(shù)據(jù)庫orcl完全導(dǎo)出,用戶名system,密碼accp,導(dǎo)出到d:\daochu.dmp文件中\(zhòng)x0d\x0aexp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、將數(shù)據(jù)庫orcl中scott用戶的對象導(dǎo)出\x0d\x0aexp scott/accp@orcl file=d:\daochu.dmp owner=(scott)\x0d\x0a\x0d\x0a3、將數(shù)據(jù)庫orcl中的scott用戶的表emp、dept導(dǎo)出\x0d\x0aexp scott/accp@orcl file= d:\daochu.dmp tables=(emp,dept)\x0d\x0a\x0d\x0a4、將數(shù)據(jù)庫orcl中的表空間testSpace導(dǎo)出\x0d\x0aexp system/accp@orcl file=d:\daochu.dmp tablespaces=(testSpace)\x0d\x0a\x0d\x0a二、數(shù)據(jù)導(dǎo)入(imp.exe)\x0d\x0a1、將d:\daochu.dmp 中的數(shù)據(jù)導(dǎo)入 orcl數(shù)據(jù)庫中。\x0d\x0aimp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、如果導(dǎo)入時,數(shù)據(jù)表已經(jīng)存在,將報錯,對該表不會進行導(dǎo)入;加上ignore=y即可,表示忽略現(xiàn)有表,在現(xiàn)有表上追加記錄。\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y\x0d\x0a\x0d\x0a3、將d:\daochu.dmp中的表emp導(dǎo)入\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp tables=(emp)
oracle怎么批量導(dǎo)入導(dǎo)
需要用exp和imp命令,具體用法如下:
1. 獲取幫助
imp help=y
2. 導(dǎo)入一個完整數(shù)據(jù)庫
imp system/manager file=bible_db log=dible_db full=y ignore=y
3. 導(dǎo)入一個或一組指定用戶所屬的全部表、索引和其他對象
imp system/manager file=seapark log=seapark fromuser=seapark
imp system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)
4. 將一個用戶所屬的數(shù)據(jù)導(dǎo)入另一個用戶
imp system/manager file=tank log=tank fromuser=seapark touser=seapark_copy
imp system/manager file=tank log=tank fromuser=(seapark,amy)
touser=(seapark1, amy1)
5. 導(dǎo)入一個表
imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)
6. 從多個文件導(dǎo)入
imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G full=y
7. 使用參數(shù)文件
imp system/manager parfile=bible_tables.par
bible_tables.par參數(shù)文件:
#Import the sample tables used for the Oracle8i Database Administrator's
Bible. fromuser=seapark touser=seapark_copy file=seapark log=seapark_import
8. 增量導(dǎo)入
imp system./manager inctype= RECTORE FULL=Y FILE=A
-------------------------------------------------------------------------------------------------------------------------------------------
1. 獲取幫助
exp help=y
2. 導(dǎo)出一個完整數(shù)據(jù)庫
exp system/manager file=bible_db log=dible_db full=y
3. 導(dǎo)出數(shù)據(jù)庫定義而不導(dǎo)出數(shù)據(jù)
exp system/manager file=bible_db log=dible_db full=y rows=n
4. 導(dǎo)出一個或一組指定用戶所屬的全部表、索引和其他對象
exp system/manager file=seapark log=seapark owner=seapark
exp system/manager file=seapark log=seapark owner=(seapark,amy,amyc,harold)
注意:在導(dǎo)出用戶時,盡管已經(jīng)得到了這個用戶的所有對象,但是還是不能得到這些對象引用的任何同義詞。解決方法是用以下的SQL*Plus命令創(chuàng)建一個腳本文件,運行這個腳本文件可以獲得一個重建seapark所屬對象的全部公共同義詞的可執(zhí)行腳本,然后在目標(biāo)數(shù)據(jù)庫上運行該腳本就可重建同義詞了。
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. 導(dǎo)出一個或多個指定表
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. 估計導(dǎo)出文件的大小
全部表總字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE segment_type = 'TABLE';
seapark用戶所屬表的總字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE';
seapark用戶下的aquatic_animal表的字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE'
AND segment_name = 'AQUATIC_ANIMAL';
7. 導(dǎo)出表數(shù)據(jù)的子集(oracle8i以上)
NT系統(tǒng):
exp system/manager query='Where salad_type='FRUIT'' tables=amy.salad_type
file=fruit log=fruit
UNIX系統(tǒng):
exp system/manager query=\"Where salad_type=\'FRUIT\'\" tables=amy.salad_type
file=fruit log=fruit
8. 用多個文件分割一個導(dǎo)出文件
exp system/manager
file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G tables=hr.paycheck
9. 使用參數(shù)文件
exp system/manager parfile=bible_tables.par
bible_tables.par參數(shù)文件:
#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. 增量導(dǎo)出
“完全”增量導(dǎo)出(complete),即備份整個數(shù)據(jù)庫
exp system/manager inctype=complete file=990702.dmp
“增量型”增量導(dǎo)出(incremental),即備份上一次備份后改變的數(shù)據(jù)
exp system/manager inctype=incremental file=990702.dmp
“累計型”增量導(dǎo)出(cumulative),即備份上一次“完全”導(dǎo)出之后改變的數(shù)據(jù)
exp system/manager inctype=cumulative file=990702.dmp
怎樣往oracle數(shù)據(jù)庫里導(dǎo)入數(shù)據(jù)
可用圖形界面或者命令導(dǎo)入:
圖形界面需要借助第三方工具plsql,方法如下:
1、登錄到要導(dǎo)入的數(shù)據(jù)庫及用戶。
2、依次點擊“工具”——“導(dǎo)入表”。
3、上方選擇“oracle導(dǎo)入”,下方找到.dmp的文件,然后點擊“導(dǎo)入”等待完成即可。
命令導(dǎo)入:
1、win鍵+R鍵,進入命令提示符。
2、進到.dmp文件所在文件夾:
3、輸入如下命令:
imp?被導(dǎo)入用戶名/密碼@實例名?file=文件名.dmp?log=日志.dmp?fromuser=導(dǎo)出用戶?touser=導(dǎo)入用戶
輸入后按回車鍵,等待導(dǎo)入完成即可。
說明:第三點中中文部分,請根據(jù)實際情況填寫。
網(wǎng)站標(biāo)題:oracle怎么導(dǎo)入包體,oracle中包和包體
當(dāng)前鏈接:http://fisionsoft.com.cn/article/hdhpdj.html