Oracle exp備份機(jī)上安裝oracle10.1都需添加的內(nèi)容
我們?cè)诖罱∣racle exp備份機(jī)的實(shí)際操持過(guò)程中是否遇到一些令你頭疼的問(wèn)題,比如一些需要添加的相關(guān)文件和相關(guān)的腳本,以下的文章就是針對(duì)前面的問(wèn)題而給出的解答方案,希望你在瀏覽完之后會(huì)有所收獲。
如何搭建Oracle exp備份機(jī)上安裝oracle10.1,配IP地址為129.1.9.91,關(guān)閉防火墻。并修改tnsnames.ora文件,添加如下內(nèi)容:
JMYBJS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 129.1.9.90)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = jmybjs)
)
)
在D盤新建文件夾:
d:\backup\dmp
d:\backup\log
用來(lái)存放dmp文件和備份的日志。
修改備份腳本如下:
'Nightly Bulk copy export for the customers table&veiw
'Write output to clarentYYMMDD.txt and errors to ERRYYMMDD.txt
''strssql="bcp demo.clrnuser.bill_recordview out c:\bibak\"+outfile+" -U jl_voip -P jlvoip -c -k -t,"
Dim outfile,aa,bb,stroption1,stroption2,A,B,C,strsql
set ws=WScript.CreateObject("WScript.shell")
A=cint(month(dateadd("d",0,date())))
B=cint(day(dateadd("d",0,date())))
C=cint(year(dateadd("d",0,date())))
if A<10 then aa=cstr(0)+cstr(A)
if A>=10 then aa=cstr(A)
if B<10 then bb=cstr(0)+cstr(B)
if B>=10 then bb=cstr(B)
outfile=cstr(C)+aa+bb
stroption1="D:\oracle_bf\product\10.1.0\Db_1\BIN\exp system/******@jmybjs full=y buffer=900000 file=d:\backup\dmp\jmybjs"+outfile+" log=d:\backup\log\jmybjs"+outfile+".log"""
strsql=stroption1
ret=ws.Run(strsql)
測(cè)試后,備份正常。
修改刪除腳本,使備份數(shù)據(jù)在Oracle exp備份機(jī)上保留30天
'Nightly Bulk copy export for the customers table&veiw
'Write output to clarentYYMMDD.txt and errors to ERRYYMMDD.txt
''strssql="bcp demo.clrnuser.bill_recordview out c:\bibak\"+outfile+" -U jl_voip -P jlvoip -c -k -t,"
Dim outfile,aa,bb,stroption1,stroption2,A,B,C,strsql
set ws=WScript.CreateObject("WScript.shell")
A=cint(month(dateadd("d",-30,date())))
B=cint(day(dateadd("d",-30,date())))
C=cint(year(dateadd("d",-30,date())))
if A<10 then aa=cstr(0)+cstr(A)
if A>=10 then aa=cstr(A)
if B<10 then bb=cstr(0)+cstr(B)
if B>=10 then bb=cstr(B)
outfile=cstr(C)+aa+bb
stroption1="C:\WINDOWS\system32\Delete d:\backup\dmp\jmybjs"+outfile+".dmp"
strsql=stroption1
ret=ws.Run(strsql)
測(cè)試,提示不正確,檢查后,發(fā)現(xiàn)這個(gè)Oracle exp備份機(jī)中的sytem32文件夾下沒(méi)有delete.exe文件,從其他系統(tǒng)中拷貝delete.exe文件到這個(gè)備份機(jī)的system32下,測(cè)試正常。***,添加到windows的定時(shí)任務(wù)中。
【編輯推薦】