實(shí)現(xiàn)一個(gè)功能即從本地Oracle導(dǎo)出數(shù)據(jù)表,文件名為.dmp,然后將該dmp文件導(dǎo)入到另一臺(tái)主機(jī)的oracle表中。感受頗深。主要還是不了解oracle各文件的作用。
首先要更改tnsnames.ora(Oracle安裝目錄中D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora)文件內(nèi)容:
ORA10G = //本地Oracle標(biāo)識(shí)(文件已有內(nèi)容)
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
ORA10G2 = //***遠(yuǎn)程電腦Oracle標(biāo)識(shí)(需添加的)***
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.3.43.130)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora10g)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PL***tProc)
(PRESENTATION = RO)
)
)
通過(guò)導(dǎo)入導(dǎo)出命令:
exp ckkh/ckkh@ora10g file= c:\datanewsmgnt.dmp tables=(ckkh_account,ckkh_account_tmp)
//將本地標(biāo)識(shí)為ora10g的數(shù)據(jù)庫(kù)的表數(shù)據(jù)導(dǎo)出到c盤(pán)
imp ckkh/ckkh@ora10g2 file=c:\datanewsmgnt.dmp full=y
//將導(dǎo)出的dmp文件導(dǎo)入到標(biāo)識(shí)為ora10g2的數(shù)據(jù)庫(kù)中。
本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|