Oracle cold backup

If your Database in "NOARCHIVELOG" mode, you can do cold backup only.

  1. List of files for the backup:

                   Select name from v$datafile 
                                         union all
                   select name from v$tempfile
                                         union all
                   select member from v$logfile
                                         union all
                   select name from v$controlfile

Example:

D:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DBF
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\TEMP.DBF
D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_BGQ5ZKBM_.LOG
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\CONTROL.DBF

  1. Cmd -> sqlplus " / as sysdba"

  2. SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

  1. Copy files manually

  2. SQL>startup

Backup.bat:

mkdir %1
copy D:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\SYSTEM02.DAT d:\backup\%1\
copy D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_BGQ5ZKNZ_.LOG d:\backup\%1\
copy D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_BGQ5ZKBM_.LOG d:\backup\%1\

Restore.bat

copy d:\backup\%1\SYSTEM.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\SYSAUX.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\UNDOTBS1.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\USERS.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\TEMP.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\CONTROL.DBF D:\ORACLEXE\APP\ORACLE\ORADATA\XE\
copy d:\backup\%1\SYSTEM02.DAT D:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\SYSTEM02.DAT
copy d:\backup\%1\O1_MF_2_BGQ5ZKNZ_.LOG D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_BGQ5ZKNZ_.LOG
copy d:\backup\%1\O1_MF_1_BGQ5ZKBM_.LOG D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_BGQ5ZKBM_.LOG

All files for backup should be (recommendation)  in the  same catalog. Files *.Log usually has name REDO: redo01.log,redo02.log… How can we change names of files?

  1. Do cold backup

  2. Copy and rename files:

    1. SQL> shutdown immediate

    2. Cmd> copy D:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\SYSTEM02.DAT D:\ORACLEXE\APP\ORACLE\ORADATA\XE\

    3. Cmd> copy D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_BGQ5ZKNZ_.LOG D:\ORACLEXE\APP\ORACLE\ORADATA\XE\ REDO02.LOG

    4. Cmd> copy D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\ O1_MF_1_BGQ5ZKBM_.LOG  D:\ORACLEXE\APP\ORACLE\ORADATA\XE\ REDO01.LOG

    5. SQL> STARTUP MOUNT

    6. SQL>ALTER DATABASE  RENAME FILE ‘D:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\SYSTEM02.DAT’ to ‘D:\ORACLEXE\APP\ORACLE\ORADATA\XE\ SYSTEM02.DAT’

    7. SQL>ALTER DATABASE RENAME FILE ‘D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_BGQ5ZKNZ_.LOG’ to ‘D:\ORACLEXE\APP\ORACLE\ORADATA\XE\ REDO02.LOG’

    8. SQL>ALTER DATABASE RENAME FILE ‘D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\ O1_MF_1_BGQ5ZKBM_.LOG’ to ‘D:\ORACLEXE\APP\ORACLE\ORADATA\XE\ REDO01.LOG’

2.9. SQL>ALTER DATABASE OPEN;

    1. If OK =>

Cmd> remove D:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\SYSTEM02.DAT;

Cmd>remove D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_BGQ5ZKNZ_.LOG

Cmd> remove D:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\ O1_MF_1_BGQ5ZKBM_.LOG

 

New Backup file:

----

BACKUP.bat

Mkdir D:\backup

Cd D:\backup\

mkdir 20151116

cd D:\ORACLEXE\APP\ORACLE\ORADATA\XE
copy *.* D:\backup\20151116\