Cold Backup

SQL> create table cold_back(name varchar(100)); 

Table created.

 

SQL> insert into cold_back values('********* DATA INSERTED BEFORE BACKUP ***********');

1 row created.

 

SQL> commit;

Commit complete.

 

SQL> select name from v$datafile

    union

    select name from v$controlfile

    union

    select member from v$logfile;

 

NAME

--------------------------------------------------------------

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\CONTROL01.CTL

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\CONTROL02.CTL

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\CONTROL03.CTL

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\REDO01.LOG

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\REDO02.LOG

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\REDO03.LOG

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\SYSAUX01.DBF

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\SYSTEM01.DBF

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\TEST01.DBF

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\UNDOTBS01.DBF

C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\USERS01.DBF

 

11 rows selected.


SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

 

C:\>mkdir c:\cold_back


C:\>copy c:\oracle\product\10.2.0\oradata\dba20\* c:\cold_back

c:\oracle\product\10.2.0\oradata\dba20\SYSAUX01.DBF

c:\oracle\product\10.2.0\oradata\dba20\UNDOTBS01.DBF

c:\oracle\product\10.2.0\oradata\dba20\CONTROL01.CTL

c:\oracle\product\10.2.0\oradata\dba20\CONTROL02.CTL

c:\oracle\product\10.2.0\oradata\dba20\CONTROL03.CTL

c:\oracle\product\10.2.0\oradata\dba20\REDO01.LOG

c:\oracle\product\10.2.0\oradata\dba20\REDO02.LOG

c:\oracle\product\10.2.0\oradata\dba20\REDO03.LOG

c:\oracle\product\10.2.0\oradata\dba20\TEMP01.DBF

c:\oracle\product\10.2.0\oradata\dba20\SYSTEM01.DBF

c:\oracle\product\10.2.0\oradata\dba20\USERS01.DBF

c:\oracle\product\10.2.0\oradata\dba20\TEST01.DBF

       12 file(s) copied.

 

SQL> startup;

ORACLE instance started.

Total System Global Area  167772160 bytes

Fixed Size                  1247876 bytes

Variable Size              83887484 bytes

Database Buffers           75497472 bytes

Redo Buffers                7139328 bytes

Database mounted.

Database opened.

 

SQL> insert into cold_back values('********* DATA INSERTED AFTER BACKUP ***********');

1 row created.

 

SQL> commit;

Commit complete.

 

SQL> select * from cold_back;

NAME

--------------------------------------------------------------------------------

********* DATA INSERTED BEFORE BACKUP ***********

********* DATA INSERTED AFTER BACKUP ***********

 

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

 

C:\>del C:\oracle\product\10.2.0\oradata\dba20\USERS01.DBF

 

SQL> startup;

ORACLE instance started.

Total System Global Area  167772160 bytes

Fixed Size                  1247876 bytes

Variable Size              83887484 bytes

Database Buffers           75497472 bytes

Redo Buffers                7139328 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 4 - see DBWR trace file

ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\USERS01.DBF'

 

SQL> shutdown immediate;

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

 

C:\>copy /Y c:\cold_back\* c:\oracle\product\10.2.0\oradata\dba20\

c:\cold_back\SYSAUX01.DBF

c:\cold_back\UNDOTBS01.DBF

c:\cold_back\CONTROL01.CTL

c:\cold_back\CONTROL02.CTL

c:\cold_back\CONTROL03.CTL

c:\cold_back\REDO01.LOG

c:\cold_back\REDO02.LOG

c:\cold_back\REDO03.LOG

c:\cold_back\TEMP01.DBF

c:\cold_back\SYSTEM01.DBF

c:\cold_back\USERS01.DBF

c:\cold_back\TEST01.DBF

       12 file(s) copied.

 

SQL> startup;

ORACLE instance started.

 

Total System Global Area  167772160 bytes

Fixed Size                  1247876 bytes

Variable Size              83887484 bytes

Database Buffers           75497472 bytes

Redo Buffers                7139328 bytes

Database mounted.

Database opened.

 

SQL> select * from cold_back;

NAME

-----------------------------------------------------------------------------

********* DATA INSERTED BEFORE BACKUP ***********

Comments