View Full Version : stop/start oracle for coldbackup

March 1st, 2011, 03:12 AM
I'm using the applications to stop and start our Oracle DB from the DLE but somehow it looks like it is not working like I expect it.

DB-SERVER / ora-tar-begin
DB-SERVER /usr comp-tar
DB-SERVER /var comp-tar
DB-SERVER /opt comp-tar
DB-SERVER /home comp-tar
DB-SERVER /oracle comp-tar
DB-SERVER /oracle_sid comp-tar
DB-SERVER /opt/sid_prt ora-tar-end

amanda.conf ;

define dumptype ora-tar-begin {
comment "To stop Oracle DB before the backup"
script "dbora_stop"

define dumptype ora-tar-end {
comment "To start Oracle DB after the backup"
script "dbora_start"
define script dbora_start{
comment "Script to start Oracle DB"
plugin "dbora_start"
execute-where CLIENT
execute-on post-dle-backup

define script dbora_stop{
comment "Script to stop Oracle DB"
plugin "dbora_stop"
execute-where CLIENT
execute-on pre-dle-backup

# ls -al
total 416
drwxr-xr-x 2 root system 4096 Nov 17 22:15 .
drwxr-xr-x 3 root system 4096 Jan 20 2010 ..
-rwsr-x--- 1 root disk 69224 Jan 20 2010 amgtar
-rwxr-xr-x 1 amandaba disk 9730 Jan 20 2010 amgtar_perl
-rwxr-xr-x 1 amandaba disk 6785 Jan 20 2010 amlog-script
-rwxr-xr-x 1 amandaba disk 18147 Jan 20 2010 amsamba
-rwsr-x--- 1 root disk 56703 Jan 20 2010 amstar
-rwxr-xr-x 1 amandaba disk 9003 Jan 20 2010 amzfs-sendrecv
-rwxr-xr-x 1 amandaba disk 6015 Jan 20 2010 amzfs-snapshot
-rwxr-xr-- 1 amandaba disk 34 Nov 17 22:14 dbora_start
-rwxr-xr-- 1 amandaba disk 44 Nov 17 22:15 dbora_stop
-rwxr-xr-x 1 amandaba disk 5623 Jan 20 2010 script-email

dbora_start is refering to /etc/dbora start
dbora_stop is refering to /etc/dbora stop

[ Backup starts at 00:01 hrs ]
dbstart.log shows that DB is started at 00:08 hrs (before backup is made)
dbshut.log shows that DB is shut at 01:06 hrs (after backup is done)

Can anyone tell me what I am doing wrong here ?

March 1st, 2011, 04:40 AM
Ok, search further end my colleague pointed me that the sendbackup-files in /tmp/amanda showed that the first DLE voor de DB-server, which has the dunptype ora-tar-begion is not started as the first but as the last one and so the DLE with dumptype ora-tar-end is started before teh begin.

in amanda.conf is set:
taperalgo largestfit

I guess this has a lot to do with it.

March 1st, 2011, 06:34 AM
There is no way to order the backup of dle.

If I understand, you want a script to be executed before all dle and a script executed after all dle are done. You should use pre-host-backup and post-host-backup for that.

But *-host-backup can only be exetuted on the amanda server, so they must do:
ssh DB-SERVER /path/to/dbora_stop
ssh DB-SERVER /path/to/dbora_start

March 3rd, 2011, 01:34 AM
I tried to get it running on the client first so tried pre-host-estimate but this returns;

planner: ERROR badly formatted response from DB-SERVER
resulting in no backup at all, although the DB was stopped at the right time ;-)

I just set up the pre-host-backup for tonight like you suggested, see how that works.
Will let you know tomorrow

March 3rd, 2011, 03:05 AM
What's in sendsize.*.debug file and amandad.*.debug file, it is probably your script that output something to stdout/stderr.

March 3rd, 2011, 03:46 AM
I guess that you mean something like this;


Processing Database instance "cohprd": log file /oracle/product/11.2.0/dbhome_1/shutdown.log
/oracle 0 SIZE 14339110
/oracle 1 SIZE 7555130
Processing Database instance "cohprd": log file /oracle/product/11.2.0/dbhome_1/shutdown.log
/oracle_cohprd 0 SIZE 10896050
/oracle_cohprd 1 SIZE 10896050
Processing Database instance "cohprd": log file /oracle/product/11.2.0/dbhome_1/shutdown.log
/opt/clp_prd_prt 0 SIZE 1380
/opt/clp_prd_prt 1 SIZE 600
Processing Database instance "cohprd": log file /oracle/product/11.2.0/dbhome_1/shutdown.log
1299106944.292136: amandad: received ACK pkt:
1299106944.292191: amandad: security_close(handle=20031918, driver=f0f58138 (BSDTCP))
1299106944.292204: amandad: security_stream_close(20039388)
1299106944.292301: amandad: pid 950460 finish time Thu Mar 3 00:02:24 2011

sendsize.*.debug is not showing any odd lines when I compare this with earlier sessions

March 3rd, 2011, 10:56 PM
OK, test failed because of user-error :( ;
1st- forgot to change the execute-where form CLIENT to SERVER for the stop-part
2nd - seems there are 2 application-directories on my amanda-server;

amreport shows;
driver: FATAL error [exec /usr/libexec/amanda/application/dbora_start: No such file or directory]

Guess that the "server-application-directory" is; /usr/libexec/amanda/application
since my scripts were in /usr/local/libexec/amanda/application nothing happened.
Made the corrections for the next run tonight.