熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

如何搭建Oracle的exp備份機

2013-11-13 16:00:17  來源: Oracle 

  Oracle服務端裝的版本為IP地址為

  在備份機上安裝oracle配IP地址為關閉防火牆

  並修改tnsnamesora文件添加如下內容

  JMYBJS =

  (DESCRIPTION =

  (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = ))

  (CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = jmybjs)

  )

  )

  在D盤新建文件夾

  d:\backup\dmp

  d:\backup\log

  用來存放dmp文件和備份的日志

  修改備份腳本如下

  Nightly Bulk copy export for the customers table&veiw

  Write output to clarentYYMMDDtxt and errors to ERRYYMMDDtxt

  strssql=bcp democlrnuserbill_recordview out c:\bibak\+outfile+ U jl_voip P jlvoip c k t

  Dim outfileaabbstroptionstroptionABCstrsql

  set ws=WScriptCreateObject(WScriptshell)

  A=cint(month(dateadd(ddate())))

  B=cint(day(dateadd(ddate())))

  C=cint(year(dateadd(ddate())))

  if A< then aa=cstr()+cstr(A)

  if A>= then aa=cstr(A)

  if B< then bb=cstr()+cstr(B)

  if B>= then bb=cstr(B)

  outfile=cstr(C)+aa+bb

  stroption=D:\oracle_bf\product\\Db_\BIN\exp system/******@jmybjs full=y buffer= file=d:\backup\dmp\jmybjs+outfile+ log=d:\backup\log\jmybjs+outfile+log

  strsql=stroption

  ret=wsRun(strsql)

  測試後備份正常

  修改刪除腳本使備份數據在備份機上保留

  Nightly Bulk copy export for the customers table&veiw

  Write output to clarentYYMMDDtxt and errors to ERRYYMMDDtxt

  strssql=bcp democlrnuserbill_recordview out c:\bibak\+outfile+ U jl_voip P jlvoip c k t

  Dim outfileaabbstroptionstroptionABCstrsql

  set ws=WScriptCreateObject(WScriptshell)

  A=cint(month(dateadd(ddate())))

  B=cint(day(dateadd(ddate())))

  C=cint(year(dateadd(ddate())))

  if A< then aa=cstr()+cstr(A)

  if A>= then aa=cstr(A)

  if B< then bb=cstr()+cstr(B)

  if B>= then bb=cstr(B)

  outfile=cstr(C)+aa+bb

  stroption=C:\WINDOWS\system\Delete d:\backup\dmp\jmybjs+outfile+dmp

  strsql=stroption

  ret=wsRun(strsql)

  測試提示不正確檢查後發現這個備份機中的sytem文件夾下沒有deleteexe文件從其他系統中拷貝deleteexe文件到這個備份機的system測試正常

  最後添加到windows的定時任務中


From:http://tw.wingwit.com/Article/program/Oracle/201311/17653.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.