Oracle automatic export script (WINDOWS stops, export file name automatically adds date and time)
Only applicable to Windows clients, database export is completed through exp command.
Has the following features:
The date and time are automatically added to the exported file name to avoid confusion when exporting data.
2. The exported data is automatically compressed by RAR, and at the same time, the data before compression is eliminated (WINRAR is urgently needed to be installed). Oracle's DMP data compression ratio is very high.
3. Support Windows task schedule.
Fourth, encapsulate the exported logs and dmp data together to avoid forgetting the contents of the exp.
Conditions: The window must be equipped with Oracle client and equipped with Net Manager (specify database connection code pcchina)
The following is the specific script: named oracleBackup.bat
-------------------------------------------------- -------------------------------------------------- --------------------------
rem windows environment stops the automatic backup script of Oracle database.
rem can set this batch process to be automatically executed under the Windows task plan.
@echo off
@echo ==================================================
@echo Windows environment stops the automatic backup script of Oracle database
@echo Note: When starting backup, it is urgent to configure the following variables
@echo 1. BACKUP_DIR specifies which index to back up to
@echo 2. ORACLE_USERNAME specifies the Oracle user name used for backup
@echo 3. ORACLE_PASSWORD specifies the Oracle password used for backup
@echo 4. ORACLE_DB specifies the Oracle connection name used for backup
@echo 5. BACK_OPTION backup option, which can be considered empty, full=y, owner=user a, user b, etc....
@echo 6. RAR_CMD specifies the index where the RAR command line compression tool is located
@echo ==================================================
rem The following variables are urgently needed and configured according to the actual situation ------> Note: This script must be placed under the d:bakcup index
set BACKUP_DIR=D:backup
set ORACLE_USERNAME=loan_admin
set ORACLE_PASSWORD=xxxx
set ORACLE_DB=pcchina
set BACK_OPTION=
set RAR_CMD="C:Progra~一WinRARRar.exe"
for /f "tokens=一,二" %%a in ('date/t') do set TODAY=%%a
set BACK_NAME=%ORACLE_DB%_%TODAY%(%time:~zero,two%hour%time:~three,two%minute)_
set BACK_FULL_NAME=%BACKUP_DIR%%BACK_NAME%
rem starts backup
exp %ORACLE_USERNAME%/%ORACLE_PASSWORD%@%ORACLE_DB% %BACK_OPTION% file="%BACK_FULL_NAME%.dmp" log="%BACK_FULL_NAME%exp.log"
rem compresses and removes original data
%RAR_CMD% a -df "%BACK_FULL_NAME%back.rar" "%BACK_FULL_NAME%.dmp" "%BACK_FULL_NAME%exp.log
Source of this article:
My abnormal network
JavaException
DotnetException
OracleException
720-Exception in thread
721 - Java exception
722 - Exception in thread 'main' java.lang.NullPointerException
723 - An internal error occurred during
724 - org.hibernate.LazyInitializationException: could not initialize proxy
725 - java.lang.IllegalStateException: getWriter() has already been called for this response
726 - org.hibernate.SessionException: Session is closed!
727 - javax.naming.NameNotFoundException
728 - java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
729 - javax.mail.MessageRemovedException
730 - org.hibernate.LazyInitializationException:could not initialize proxy
731 - Warning: Error setting value
732 - override and commit
733 - Building workspace has encountered a problem. Errors during build
734 - Could not open the editor: An unexpected exception was thrown
735 - Error creating the view.An error occurred while automatically activating bundle org.eclipse.jdt.ui
736 - java.lang.IllegalMonitorStateException
737 - java.lang.UnsupportedClassVersionError: Bad version number in .class file
738-java.io.EOFException
739 - not allowed to send
This article comes from the CSDN blog. Please indicate the source when reprinting: http://blog.csdn.net/liangdiwei/archive/2009/12/22/5051844.aspx
-