The following article describes how to correctly set up an Oracle exp backup machine. We all know that the Oracle server is generally installed with version 10.1 and the IP address is 129.1.9.90, first, install oracle10.1 on the backup machine with the IP address 129.1.9.91 and disable the firewall.
Create an Oracle exp backup machine and modify the tnsnames. ora file to add the following content:
- JMYBJS =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 129.1.9.90)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = jmybjs)
- )
- )
Create a folder on disk D:
- d:\backup\dmp
- d:\backup\log
Used to store dmp files and backup logs.
Set up an Oracle exp backup machine: Modify the backup script as follows:
- '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)
After the test, the backup is normal.
Modify the deletion script so that the backup data is retained on the backup machine for 30 days.
- '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)
Upload the file to system32 on the backup machine. The test is normal.
Finally, add it to the scheduled task of windows. The above content introduces how to build an Oracle exp backup machine. I hope you will find some gains.