SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Backup Oracle on remote HP-UX
Author Message
Post Backup Oracle on remote HP-UX 
In the Tips and Suggestion section there is a section where you can run a
script on a remote machine using ssh. The following, in part, is the
instructions.
The authentication is done automatically using a private key. First you have
to generate a keypair. I've done this by:

ssh-keygen -b 4096 -t dsa -f Bacula_key

This statement may take a little time to run. It creates a public/private
key pair with no passphrase. You could save the keys in /etc/bacula. Now you
have two new files : Bacula_key which contains the private key and
Bacula_key.pub which contains the public key.

Now you have to append the Bacula_key.pub file to the file authorized_keys
in the \root\.ssh directory of the remote machine. Then you have to add (or
uncomment) the line

AuthorizedKeysFile %h/.ssh/authorized_keys

to the sshd_config file on the remote machine. Where the %h stands for the
home-directory of the user (root in this case).

Assuming that your sshd is already running on the remote machine, you can
now enter the following on the machine where Bacula runs:

ssh -i Bacula_key -l root "ls -la" (THIS SHOULD BE ssh -i Bacula_key -l
root 192.168.1.1 "ls -la")

This should execute the "ls -la" command on the remote machine.

Now you could add lines like the following to your Director's conf file:

...
Run Before Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ (the quote
should be after the = sign)
"/etc/init.d/database stop"
Run After Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ (the
quote should be after the = sign)
"/etc/init.d/database start"
... "

Now the problem that I have is when I try to run my script to stop the
oracle database, for some reason it logs me out of the remote machine and
then runs the script. Here is what I have in my Job directive for a client,

RunBeforeJob = "ssh -i /home/oracle/Bacula_key -l oracle 159.71.39.55 \
/home/oracle/oracle_stop.sh >> log_oracle"

The log results are,
BeforeJob: run command "ssh -i /home/oracle/Bacula_key -l oracle
159.71.39.55
/home/oracle/oracle_stop.sh >>
log_oracle"
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: Error 6 initializing SQL*Plus
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: Message file sp1<lang>.msb not
found
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: SP2-0750: You may need to set
ORACLE_HOME to your Oracle software directory

When I did some debugging, it seems to log me out of the remote machine
before running the script on the remote machine. I am wondering why?

Does anyone have any ideas?

What I want to do is to stop the Oracle database on a remote HP-UX machine
and then run a full backup and then restart the Oracle database.

TIA
Mike

--
View this message in context: http://www.nabble.com/Backup-Oracle-on-remote-HP-UX-tf3929270.html#a11144084
Sent from the Bacula - Users mailing list archive at Nabble.com.

Post Backup Oracle on remote HP-UX 
Mike Vasquez wrote:

What I want to do is to stop the Oracle database on a remote HP-UX machine
and then run a full backup and then restart the Oracle database.

While it's not strictly an answer to your question, you might want to at least
consider using a different backup methodology for Oracle that doesn't require
the pre and post scripts:

http://wiki.bacula.org/doku.php?id=application_specific_backups#oracle_10g_release_2

--
Frank Sweetser fs at wpi.edu | For every problem, there is a solution that
WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken
GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC

Post Backup Oracle on remote HP-UX 
I was able to get the script to work. The script on the remote server listed
ORACLE_HOME but did not export it. Once I fixed that, the script was able
to run. L.

As to this methodology, this is what my boss wants and I am fairly new to
hp-ux. I am going to do a full test on the devel machine Saturday. I will
take a look at the UR

Mike

Frank Sweetser-2 wrote:

Mike Vasquez wrote:

What I want to do is to stop the Oracle database on a remote HP-UX
machine
and then run a full backup and then restart the Oracle database.

While it's not strictly an answer to your question, you might want to at
least
consider using a different backup methodology for Oracle that doesn't
require
the pre and post scripts:

http://wiki.bacula.org/doku.php?id=application_specific_backups#oracle_10g_release_2

--
Frank Sweetser fs at wpi.edu | For every problem, there is a solution
that
WPI Senior Network Engineer | is simple, elegant, and wrong. - HL
Mencken
GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
Bacula-users < at > li...
https://lists.sourceforge.net/lists/listinfo/bacula-users



--
View this message in context: http://www.nabble.com/Backup-Oracle-on-remote-HP-UX-tf3929270.html#a11144414
Sent from the Bacula - Users mailing list archive at Nabble.com.

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB