Today, I've found how to backup/export Oracle database with bat file. I've just created it for only one schema first. Why I'm using to import Oracle with bat file because of there is no auto backup feature in Oracle (as far as I know). That's why it's needed to create bat file and integrate with window task scheduler (run daily).
First of all, open Notepad and save as OracleBackup.bat first. Then, paste following code into this file.
2echo Importing Oracle Start
3echo =======================
4exp system/password file=C:/ppshein.dmp grants=y owner='ppshein';
5echo ==========================
6echo Importing Oracle End
Above coding is to import "ppshein" schema of Oracle and save it into C:/ folder. This is very simple coding. But when we run this bat file again, new ppshein.dmp will override on old ppshein.dmp. That's what I don't want. So I need to create folder and give name as current date. That's why I need to create one new bat file for creating folder first.
2echo folder creating started
3echo ======================
4cd D:\
5set folder=%date:~10,4%%date:~7,2%%date:~4,2%
6mkdir %folder%
7echo ===================
8echo folder creating completed
Above coding is to create folder and give name as current date. For example, if I run this script today, folder name will be like "20121201" (YYYYDDMM). That's why, before importing Oracle schema we need to run above script first. After that, need to amend Oracle import script as follow.
2echo Importing Oracle Start
3echo ==================
4set folder=%date:~10,4%%date:~7,2%%date:~4,2%
5exp system/password file=D:/%folder%/exp.dmp grants=y owner='ppshein';
6echo ======================
7echo Importing Oracle End
Above coding is to import Oracle schema and save dmp file into the directory which is created by the first script.
After all, we need to add CreateFolder bat file into window task schedular first, then add OracleImport bat file into it also. Hope it will be useful for someone like me.

Android
Top of Page
#1 by Ed Andrade on 1/12/12 - 3:23 PM
The expdp/impdp utilities are a lot more powerful and from what I have been told have better performance too.
#2 by ppshein on 1/12/12 - 6:50 PM
currently, I'm using Oracle 11g and used to export/import Oracle schema by using exp/imp. I've once tried to use expdp/impdp but it's not very used to me.
By the way, thanks for pointing out expdp/impdp get better performance than exp/imp.