Simple oracle backup without using exp or expdp Simple oracle backup without using exp or expdp oracle oracle

Simple oracle backup without using exp or expdp


If your database is not running in archive log mode the answer is yes. Here are some scripts I use to backup and restore my database.

--- backup.bat ---

sqlplus "sys/passwd@database as sysdba" @shutdown.sqlxcopy C:\oracle\oradata\database\*.* C:\oracle\oradata\backup_database\*.* /Ysqlplus "sys/passwd@database as sysdba" @startup.sql

---- shutdown.sql

shutdown immediateexit;

---- startup.sql

startupexit;

Restore script is similar. Just copies the files in the other direction.


You can just copy the data files ( make sure you get the control files as well, and make sure you TEST your backups ), however. You should probably be using RMAN.

The Oracle® Database Backup and Recovery Quick Start Guide would be a good place to start.


A very simple backup method is to export the relevant schema using the exp tool. If e.g. all your tables exist in the schema MY_APP (read database for mysql users), you can dump all its tables to one file.

exp userid=MY_APP file=dumpfile.dmp log=logfile.txt consistent=y statistics=none buffer=1024000

Restoring the dumpfile to a second database works like this

imp userid=system fromuser=MY_APP touser=MY_APP file=dumpfile.dmp commit=y buffer=102400 

Or you can restore the tables from MY_APP to another schema in the same database

imp userid=system fromuser=MY_APP touser=MY_BACKUP file=dumpfile.dmp commit=y buffer=102400

Just create a new schema MY_BACKUP before the import

create user MY_BACKUP identified by SECRET default tablespace USERS temporary tablespace temp;grant connect, resource to MY_BACKUP;