Thinking Out Loud

August 30, 2016

Simple Cold Backup using tar

Filed under: oracle — mdinh @ 1:50 pm

At times, I find it much simpler to shutdown my test database and create cold backup which will allow me to revert from any errors.

$ echo $ORACLE_SID
DB01

$ tar -cvzf /media/sf_OracleSoftware/$ORACLE_SID_$USER_`hostname -s`_backup.tar.gz .
./
./obj_source.out
./onlinelog/
./onlinelog/o1_mf_1_cw3syboq_.log
./onlinelog/o1_mf_2_cw3sybrt_.log
./onlinelog/o1_mf_3_cw3syc03_.log
./controlfile/
./controlfile/o1_mf_cw3sybl0_.ctl
./datafile/
./datafile/o1_mf_temp_cw3syrhz_.tmp
./datafile/o1_mf_users_cw3syrk7_.dbf
./datafile/o1_mf_sysaux_cw3syl2w_.dbf
./datafile/o1_mf_demo_cw4tz56f_.dbf
./datafile/o1_mf_undotbs1_cw3syoc6_.dbf
./datafile/o1_mf_system_cw3syd5k_.dbf

$ ll /media/sf_OracleSoftware/DB01_oracle_arrow_backup.tar.gz
-rwxrwx---. 1 root vboxsf 382676286 Aug 28 13:09 /media/sf_OracleSoftware/DB01_oracle_arrow_backup.tar.gz

++++++++++

[06:45]oracle@arrow:DB01:/oradata
$ mkdir DB01/
[06:45]oracle@arrow:DB01:/oradata
$ cd DB01/
[06:45]oracle@arrow:DB01:/oradata/DB01
$ ll
total 0
[06:45]oracle@arrow:DB01:/oradata/DB01
$ tar -xvf /media/sf_OracleSoftware/$ORACLE_SID_$USER_`hostname -s`_backup.tar.gz .
./
./obj_source.out
./onlinelog/
./onlinelog/o1_mf_1_cw3syboq_.log
./onlinelog/o1_mf_2_cw3sybrt_.log
./onlinelog/o1_mf_3_cw3syc03_.log
./controlfile/
./controlfile/o1_mf_cw3sybl0_.ctl
./datafile/
./datafile/o1_mf_temp_cw3syrhz_.tmp
./datafile/o1_mf_users_cw3syrk7_.dbf
./datafile/o1_mf_sysaux_cw3syl2w_.dbf
./datafile/o1_mf_demo_cw4tz56f_.dbf
./datafile/o1_mf_undotbs1_cw3syoc6_.dbf
./datafile/o1_mf_system_cw3syd5k_.dbf
[06:46]oracle@arrow:DB01:/oradata/DB01
$ ll
total 28
drwxr-x---. 2 oracle oinstall  4096 Aug 27 12:19 controlfile
drwxr-x---. 2 oracle oinstall  4096 Aug 27 12:19 datafile
-rw-r--r--. 1 oracle oinstall 14506 Aug 27 22:23 obj_source.out
drwxr-x---. 2 oracle oinstall  4096 Aug 27 12:19 onlinelog
[06:46]oracle@arrow:DB01:/oradata/DB01
$
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: