3 Replies Latest reply: Jul 16, 2012 4:56 PM by RnR RSS

    scheduler credentials for external jobs and SSH keys

    michael.friedl
      Hi everybody,

      I am trying to access a scheduler agent that runs on a remote machine, which (for me, anyway) is only accessible via username/ssh key, not via username/password. Registering the database was no problem, but now I cannot make the agent to do some simple test task, e.g.

      begin
         dbms_scheduler.create_credential('myuser.connect_to_other_host', 'hostuser', '');
          --
         dbms_scheduler.create_program (
            program_name      => 'myuser.scheduler_test_program',
            program_type      => 'EXECUTABLE',
            program_action    => 'sh',
            number_of_arguments => 2,
            enabled           => false
         );
         --
         dbms_scheduler.define_program_argument(
            program_name            => 'myuser.scheduler_test_program',
            argument_position       => 1,
            argument_name           => null,
            argument_type           => 'varchar2',
            default_value           => '-c',
            out_argument            => false
         );
         --
         dbms_scheduler.define_program_argument(
            program_name            => 'myuser.scheduler_test_program',
            argument_position       => 2,
            argument_name           => null,
            argument_type           => 'varchar2',
            default_value           => 'cd /home/someDir; touch this',
            out_argument            => false
         );
         --
         dbms_scheduler.enable('myuser.scheduler_test_program');
         --
         dbms_scheduler.create_job (
            job_name           => 'myuser.scheduler_test_job',
            program_name       => 'myuser.scheduler_test_program',
            credential_name    => 'myuser.connect_to_other_host',
            auto_drop          => false,
            destination_name   => 'sys.that_other_host',
            enabled            => true
         );
      end;
      The error I am getting via dba_scheduler_job_run_details is, perhaps not surprisingly,
      EXTERNAL_LOG_ID="job_697558_8",
      USERNAME="hostuser",
      STANDARD_ERROR="Launching external job failed: Invalid username or password"
      Is there any way to make this work, without giving hostuser a password?

      Thanks a lot in advance,

      Alex

      Edited by: Alex on 02.07.2012 10:16