Tuesday, April 17, 2012

HP Data Protector integration with Oracle Architecture

 

image

The components of this integration, as shown in Figure 8-1, are
SM The Data Protector Session Manager, which manages the backup and restore sessions.
MA The Data Protector General Media Agent, which reads and writes data from and to media
devices.
Data Protector MML The Data Protector Oracle Integration Media Management Library, which
is a set of routines that enables data transfer between the Oracle server and Data Protector. The
Data Protector MML links Data Protector and Oracle server software.
Ob2rman.pl The Data Protector Oracle Integration agent, which works with RMAN to manage
all aspects of the backup/recovery operations on the Oracle target database.
Backup API The Oracle-defined application programming interface.
IDB The Internal Database, where all the information about Data Protector sessions, including
session messages, objects, data, used devices, and media, is written.
RMAN The Oracle Recovery Manager.

Backup Process

When a backup is started with Data Protector, the following happens in the background:
1. Data Protector executes ob2rman.pl, which starts RMAN on the client and sends the
preconfigured RMAN script.
2. RMAN contacts the Oracle server, which contacts Data Protector via the MML interface
and initiates the backup.
3. During the backup session, the Oracle server reads data from the disk and sends it to
Data Protector for writing to the backup device.
4. Messages from the Data Protector backup session and messages generated by Oracle are
logged to the Data Protector database.

Wednesday, April 04, 2012

Using WinSCP in DOS Batch file to copy files from Unix Host to Windows Server

 

Here is the sample script I use to copy from Unix Host to Windows Host by DOS Batch will using WinSCP.

Main Script

@echo off

del .\WinSCP_Copy.log /Q

cd "D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\D1_Copy.txt" /log="D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\"
cd D:

call UnixBox_Copy.bat

"C:\Program Files\WinSCP\WinSCP.exe" /console /script="D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\UnixBox1_Copy_Script.txt" /log="D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\WinSCP_Copy.log"

@echo on


UnixBox_Copy.bat

set lan_dir=D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP
set unix_dir1=Oracle_DB_Build
set unix_dir2=Build_SubDir
set uname=DBUser1
set pwd=1sJ8*&^!

del .\UnixBox1_Copy_Script.txt  /Q
 

:: To execute the script "C:\Program Files\WinSCP\WinSCP.exe" /console /script="D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\D1_Copy.txt"

:: To switch to batch mode &  Automatically abort script on errors

echo option batch abort                                              > .\UnixBox1_Copy_Script.txt                                                                 

:: Disable overwrite confirmations that conflict with the previous

echo option confirm off                                              >> .\UnixBox1_Copy_Script.txt                                                                

:: connect using a password

echo open sftp://%uname%:%pwd%@unixDBsrvr1.production.siva.com      >> .\UnixBox1_Copy_Script.txt

                                                      
:: Change Local Directory

cd "%lan_dir%"

IF NOT EXIST "%unix_dir2%"  (mkdir "%lan_dir%\"%unix_dir2% ) ELSE ( GOTO _END )

echo lcd "%lan_dir%\%unix_dir2%" >> .\UnixBox1_Copy_Script.txt

:: Force binary mode transfer
echo option transfer binary                                              >> .\UnixBox1_Copy_Script.txt

:: Download the file to local directory Y:\
echo get /app/oracle/Build_PRD/%unix_dir1%/%unix_dir2%/*.* -append       >> .\UnixBox1_Copy_Script.txt

:: Disconnect
echo close                                                                    >> .\UnixBox1_Copy_Script.txt
:: Exit WinSCP
echo exit                                                                     >> .\UnixBox1_Copy_Script.txt

:: Exit WinSCP
echo exit                                                                     >> .\UnixBox1_Copy_Script.txt

:_END
echo *** W A R N I N I N G *** Floder already exists
pause ..

Sample UnixBox1_Copy_Script.txt, generated by  UnixBox_Copy.bat. The following Script is called on WinSCP as set of command to execute on WinSCP console.

option batch abort                                                                                                               
option confirm off                                                                                                              
open sftp://DBUser1:1sJ8*&^!@unixDBsrvr1.production.siva.com    
lcd "D:\Documents and Settings\Siva\My Documents\SQL_Pack\WinSCP\Build_SubDir"
option transfer binary                                             
get /app/oracle/Build_PRD/Oracle_DB_Build/Build_SubDir/*.* –append    
close                                                                   
exit