Bo's Oracle Station

查看: 1797|回复: 0

远程数据库作业(Oracle世界的ansible)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-12-1 21:51:40 | 显示全部楼层 |阅读模式
管理端:
  1. grant create job to hr;

  2. --grant create external job to hr;

  3. select  * from dba_scheduler_credentials;

  4. begin
  5.    dbms_scheduler.create_credential('credential13','HR','oracle_4U');
  6. end;
  7. /

  8. grant execute on  credential13 to hr;


  9. select * from dba_scheduler_external_dests;


  10. set serveroutput on

  11. DECLARE
  12. versionnum VARCHAR2(30);
  13. BEGIN
  14. versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('CLASSROOM');
  15. DBMS_OUTPUT.PUT_LINE(versionnum);
  16. END;
  17. /



  18. begin
  19.    dbms_scheduler.create_database_destination(
  20.    destination_name => 'orcl2',
  21.    agent => 'CLASSROOM',tns_name => 'orcl2');
  22. end;
  23. /

  24. select * from dba_scheduler_db_dests;

  25. grant all on orcl2 to  hr;


  26. BEGIN
  27. sys.dbms_scheduler.create_job(
  28. job_name => '"HR"."JOB13"',
  29. program_name => '"HR"."PROGRAM13"',
  30. schedule_name => '"HR"."SCHEDULE13"',
  31. job_class => '"DEFAULT_JOB_CLASS"',
  32. auto_drop => FALSE,
  33. enabled => true,
  34. credential_name =>'SYS.CREDENTIAL13' ,
  35. destination_name =>'SYS.ORCL2'
  36. );
  37. END;
  38. /


复制代码

受控端:
  1. [oracle@classroom bin]$ ./schagent  -stop
复制代码
  1. [oracle@classroom bin]$ ./schagent  -registerdatabase 192.168.0.254 8888
复制代码
  1. [oracle@classroom bin]$ ./schagent  -start
复制代码
  1. [oracle@classroom bin]$ netstat -lntp | grep :1025
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-21 19:53 , Processed in 0.031267 second(s), 25 queries .

快速回复 返回顶部 返回列表