Oracle® Database Administrator's Guide 11g Release 1 (11.1) Part Number B28310-01 |
|
|
View PDF |
Oracle Scheduler (the Scheduler) can schedule and run external jobs on a remote host. The remote host does not need an Oracle database installed; however, a Scheduler agent must be installed on the remote host so that the scheduling database can start remote external jobs on that host and receive job output and error information. The agent must register with every database that is to be permitted to start remote external jobs on the agent's host. An initial setup is also required for each database that is to run remote external jobs. For each database, this setup enables secure communications between the database and remote Scheduler agents.
Enabling remote external jobs includes the following steps:
If at any time you want to disable remote external jobs—that is, remove the capability to start remote external jobs from a particular Oracle database—you can follow the instructions in "Disabling Remote External Jobs".
See Also:
"About Remote External Jobs"To set up the database to run remote external jobs:
Ensure that the XML DB option is installed on the database host.
This option is installed by default. To establish if XML DB is installed, check the RESOURCE_VIEW
view using the following command in SQL*Plus:
SQL> DESC RESOURCE_VIEW
If XML DB is not installed, this command returns an "object does not exist" error.
Note:
If XML DB is not installed, you must install it before continuing.Run the script prvtrsch.plb
on the database host using the following steps:
Start SQL*Plus and connect as the SYS
user.
Issue the following command:
SQL> @ORACLE_HOME/rdbms/admin/prvtrsch.plb
You need to run this script only once on a database host.
Set a registration password for the Scheduler agents using the SET_AGENT_REGISTRATION_PASS
procedure.
Before a database can execute jobs using a remote Scheduler agent, the agent must be registered with the database. To make the registration of remote Scheduler agents secure, an agent registration password must be set on the database. You can choose to only allow a certain number of Scheduler agents to register or to have the password expire after a specified duration.
The following example sets the agent registration password for a database host to mypassword
.
SQL> EXEC DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('mypassword')
Note:
TheMANAGE SCHEDULER
privilege is required to set an agent registration password.Before you can run remote external jobs, you must install and start the Scheduler agent on the remote host. The Scheduler agent is located in the installation media for the Oracle Database Gateway, which is included in the Database CD pack. It is also available online at:
http://www.oracle.com/technology/software
To install and configure the Scheduler agent on a remote host:
Log in to the remote host.
For Windows, log in as an administrator.
For UNIX and Linux, log in as the user under which you want the Scheduler agent to run. This user requires no special privileges.
Run the Oracle Universal Installer from the installation media for Oracle Database Gateway.
For Windows, run setup.exe
.
For UNIX and Linux, use the following command:
$/directory_path/runInstaller
where directory_path
is the path to the Oracle Database Gateway installation media.
On the Products Selection page, select Oracle Scheduler Agent.
On the Oracle Scheduler Agent page, enter the host name of the machine on which the Scheduler agent will run.
When this page is displayed, the installer uses a default value for the host name. You can also choose to retain the default value.
(UNIX only) The Oracle Universal Installer prompts you to run the script root.sh
. Enter the following command as the root
user.
#/script_path/
root.sh
where script_path
is the path where the script is located. The script is located in the directory that you chose for the installation.
On the Summary page, click Finish to complete the agent installation.
Review the agent configuration parameters by using a text editor to view the file schagent.conf
, which is located in the Scheduler agent home directory.
Note the port number, because you will need this information when creating remote external jobs. Change any agent configuration parameters as required.
Register the Scheduler agent with a database that will run remote external jobs on the agent's host. Use the following command:
schagent -registerdatabase database_host database_xmldb_http_port
You will be prompted to enter the agent registration password that you previously set on the database in "Setting Up the Database".
database_xmldb_http_port is the port that the database listens on for HTTP connections. You can determine this port by issuing the following command on the database:
SQL> SELECT DBMS_XDB.GETHTTPPORT() FROM DUAL;
Note:
Theschagent
executable can be found in the bin
subdirectory of the newly created agent directory.Repeat the previous step for each database that will run remote external jobs on the agent's host.
Start the Scheduler agent.
On UNIX or Linux operating systems, use the following command:
schagent -start
On Windows, a service must be installed and started to start the agent:
schagent -installagentservice
The name of the service is OracleSchedulerExecutionAgent
. Before starting the service, you can use the Services item in the Windows Control Panel to set the user that the service runs as. The Services icon is found under Administrative Tools in the Control Panel.
Note:
Do not confuse this service with theOracleJobScheduler
service, which runs on a Windows computer on which an Oracle database is installed, and manages the running of local external jobs on that computer.Stopping the Scheduler Agent
On UNIX and Linux operating systems, the agent can be stopped with the following command:
schagent -stop
On Windows, the agent can be stopped by stopping the OracleSchedulerExecutionAgent
service.
You can disable the capability of a database to run remote external jobs by dropping the REMOTE_SCHEDULER_AGENT
user. Use the following command:
DROP USER REMOTE_SCHEDULER_AGENT CASCADE;
Registration of new scheduler agents and execution of remote external jobs is disabled until you run prvtrsch.plb
again.