Whether we encounter some headaches during the actual operation of the Oracle exp backup machine, such as some related files and related scripts to be added, the following articles provide solutions to the previous questions. I hope you will gain some benefits after browsing them.
Install oracle10.1 on the Oracle exp backup machine with the IP address 129.1.9.91 and disable the firewall. Modify the tnsnames. ora file and 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.
Modify the backup script as follows:
'Nightly Bulk copy export for the MERs 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 ()
If A> = 10 then aa = cstr ()
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 to keep the backup data on the Oracle exp backup machine for 30 days.
'Nightly Bulk copy export for the MERs 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 ()
If A> = 10 then aa = cstr ()
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)
Test: the error message is incorrect. Check that the sytem32 file in the Oracle exp;machine does not contain the delete.exefile. The test is normal from the beidelete.exe file in other systems to the system32 of the backup machine. Finally, add it to the scheduled task of windows.