DBA Hub

📋Steps in this guide1/5

OS Backup Commands

A summary of the operating system backup commands you might encounter whilst backing up Oracle databases.

oracle miscconfigurationintermediate
by OracleDba
14 views
1

ntbackup

Under WindowsNT and Windows2000 filesystem backups are done using the program. This is a GUI tool with easy to use wizards to get you started, but it is also accessible from the command line. The command line parameters differ between WindowsNT and Windows2000. Under WindowsNT a typical backup command would look like. Under Windows 2000 a similar command would look like. The Windows2000 backup logs always appear in. Where user-name is the user who ran ntbackup. The Windows2000 is rather troublesome regarding reuse of tapes. Using the following procedure should alleviate most of these problems. - From the task bar click "Start" -> "Run..." - Enter "ntbackup" and click "OK". - From the ntbackup menu select "Tools" -> "Options" and click on the "General" tab. - Check the "Always move new import mediato the Backup media pool" option and click "OK". - Exit ntbackup. If there are still issues you must right-click the appropriate tape drive in "Computer Management" and select the "Mark as clean" option. At this point the tape should be reused properly.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ntbackup backup c:\ /d "Daily Backup" /hc:on /l "C:\backup.log" /e /t normal /v

c:\                : The drive to backup.
/d "Daily Backup"  : The name of the backup set.
/hc:on             : Harware compression on.
/l "C:\backup.log" : Location of the logfile.
/e                 : Log exceptions only.
/t normal          : Backup type normal.
/v                 : Verify backup.

ntbackup backup c:\ /D "Daily Backup" /HC:on /L:s /M normal /P DLT /V:yes /UM

c:\                : The drive to backup.
/D "Daily Backup"  : The name of the backup set.
/HC:on             : Harware compression on.
/L:s               : Summary data only in log.
/M normal          : Backup type normal.
/P DLT             : Media pool assignment (Backup/DLT).
/V:yes             : Verify backup.
/UM                : Unmanaged.

C:\Documents and Settings<user-name>Local Settings\Application Data\Microsoft\Windows NT\NTbackup\Data
2

tar

The command can be used to backup and restore files to another filesystem or an offile storage device. If a full path is used during the archive creation the extract locations are fixed rather than relative. The process is similar when accessing a tape device except the destination is the mounted device.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Create archive.
cd /u01/app/oracle
tar -cvf /tmp/admin.tar admin

# Restore archive.
cd /tmp
tar -xvf admin.tar

# Mount and rewind the tape.
mt -f /dev/rmt/2m rew

# Create archive.
tar -cvf /dev/rmt/2m /u01/*

# Restore archive.
tar -xvf /dev/rmt/2m
3

dd

The command is similar to the tar command.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
# Mount and rewind the tape.
mt -f /dev/rmt/2m rew

# Create archive.
dd if=/u01/app/oracle/* of=/dev/rmt/2m BS=32K

# Restore archive.
dd if=/dev/rmt/2m of=/u01/app/oracle BS=32K
4

cpio

The command deals with the standard input so filesystem paths must be piped to it. If a full path is used during the archive creation the extract locations are fixed rather than relative:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
# Create archive.
cd /u01/app/oracle
find admin | cpio -oc > /tmp/admin.cpio

# Restore archive.
cd /tmp
cpio -idmv < admin.cpio

find /u01/app/oracle/admin | cpio -oc > /tmp/admin.cpio
5

vdump, rvdump, vrestore and rvrestore

Full level 0 backup of a local filesystem (/u01) to a local device (/dev/tape/tape1_d6). Full level 0 backup of a local filesystem (/u01) to a remote device (server2:/dev/tape/tape1_d6). Restore a vdump or rvdump archive from a local device (/dev/tape/tape1_d6) to a local filesystem (/u01). Restore a vdump or rvdump archive from a remote device (server2:/dev/tape/tape1_d6) to a local filesystem (/u01). For more information see: - UNIX For DBAs Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
/sbin/vdump -0 -u -f /dev/tape/tape1_d6 /u01

/sbin/rvdump -0 -u -f server2:/dev/tape/tape1_d6 /u01

/sbin/vrestore -xf /dev/tape/tape1_d6 -D /u01

/sbin/rvrestore -xf server2:/dev/tape/tape1_d6 -D /u01

Comments (0)

Please to add comments

No comments yet. Be the first to comment!