Bo's Oracle Station

查看: 3866|回复: 0

filewatcher

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-8-4 15:25:36 | 显示全部楼层 |阅读模式
Linux Shell下面的文件观察家:
[root@station90 桌面]# until [ -f f.png ]; do sleep 1 ;  done ;echo "File exists"

g.png


filewatcher在64上一定要libpam链接:
REDHAT 6默认的样子:
[root@station90 ~]# cd /lib64/
[root@station90 lib64]# ls -l *libpam*
lrwxrwxrwx. 1 root root    17  7月 17 04:41 libpamc.so.0 -> libpamc.so.0.82.1
-rwxr-xr-x. 1 root root 11680  7月 10 2017 libpamc.so.0.82.1
lrwxrwxrwx. 1 root root    21  7月 17 04:41 libpam_misc.so.0 -> libpam_misc.so.0.82.0
-rwxr-xr-x. 1 root root 13760  7月 10 2017 libpam_misc.so.0.82.0
lrwxrwxrwx. 1 root root    16  7月 17 04:41 libpam.so.0 -> libpam.so.0.82.2
-rwxr-xr-x. 1 root root 55280  7月 10 2017 libpam.so.0.82.2
一定要做:
  1. [root@station90 lib64]# ln -s libpam.so.0.82.2 libpam.so
复制代码
请注意观察默认有一个不起动的file watcher作业的总的“代表”:
h.png


i.png

靠上面这张图中的file_watcher_schedule基于时间来观察,我们做实验就把这个间隔10分钟改为2分钟。


  1. begin
  2.    dbms_scheduler.create_file_watcher(
  3.        file_watcher_name => 'filewatcher1',
  4.        directory_path => '/home/oracle/myfile',
  5.        file_name => 'botang*.txt',
  6.        credential_name => 'credential1');
  7. end;

  8. select  * from dba_scheduler_file_watchers;

  9. grant execute on filewatcher1 to hr;
  10. grant execute on SYS.SCHEDULER_FILEWATCHER_RESULT to hr;
  11. grant create external job to hr;
  12. grant create job to hr;

  13. create table hr.tfilewatcher1 ( a  varchar2(200)  ) ;  

  14. create or replace procedure hr.procfilewatcher ( p_1   SYS.SCHEDULER_FILEWATCHER_RESULT)
  15. is
  16. begin
  17.   insert into hr.tfilewatcher1  values ( to_char( p_1.file_timestamp,'YYYY-MM-DD:HH24:MI:SS') ||'      '
  18.                                                       ||p_1.directory_path||'        '
  19.                                                       ||p_1.actual_file_name||'       '
  20.                                                       ||p_1.file_size  ) ;
  21.   commit;
  22. end;

  23. begin
  24.     dbms_scheduler.create_program(
  25.      program_name => 'HR.program10',
  26.      program_type => 'STORED_PROCEDURE',
  27.      program_action => 'HR.procfilewatcher',
  28.      number_of_arguments => 1,
  29.      enabled => false);
  30. end;

  31. begin
  32.    dbms_scheduler.define_metadata_argument(
  33.    program_name => 'HR.program10',
  34.    metadata_attribute => 'event_message',argument_position => 1 ) ;
  35. end;

  36. begin
  37.   dbms_scheduler.enable('HR.program10');
  38. end;


复制代码
当定义了第一个file watcher之后,默认的file watcher“代表”活了:
j.png

  1. BEGIN
  2.   DBMS_SCHEDULER.CREATE_JOB(
  3.    jOB_NAME=> 'hr.job10',
  4.    PROGRAM_NAME=> 'hr.program10',
  5.    EVENT_CONDITION => 'tab.user_data.file_size > 10',
  6.    QUEUE_SPEC=> 'filewatcher1',
  7.    AUTO_DROP=> FALSE,
  8.    ENABLED=> true);
  9. END;
复制代码

使能并行文件到达观察,不要错过文件:
  1. begin
  2.    dbms_scheduler.set_attribute('hr.job10','parallel_instances',true);
  3. end;
复制代码
  1. select  * from hr.tfilewatcher1;
复制代码

   A
12018-08-04:08:11:24      /home/oracle/myfile        botang1.txt       11
22018-08-04:08:17:17      /home/oracle/myfile        botang3.txt       551920
32018-08-04:08:17:42      /home/oracle/myfile        botang1.txt       22

-------------------------------------------远程外部作业
12c这一头:
  1. alter system set dispatchers='(PROTOCOL=TCP) (dispatchers=6)';
  2. alter system set shared_servers=6;
  3. select  * from dba_users  order by 1;
复制代码
   USERNAMEUSER_IDPASSWORDACCOUNT_STATUSLOCK_DATEEXPIRY_DATEDEFAULT_TABLESPACETEMPORARY_TABLESPACECREATEDPROFILEINITIAL_RSRC_CONSUMER_GROUPEXTERNAL_NAMEPASSWORD_VERSIONSEDITIONS_ENABLEDAUTHENTICATION_TYPEPROXY_ONLY_CONNECTCOMMONLAST_LOGINORACLE_MAINTAINED
1ANONYMOUS51 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMSYSAUXTEMP7/7/2014 5:53:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G NPASSWORDNYES Y
2APEX_04020098 EXPIRED & LOCKED7/7/2014 6:31:11 AM7/7/2014 6:31:11 AMSYSAUXTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
3APEX_PUBLIC_USER95 EXPIRED & LOCKED7/7/2014 6:29:17 AM7/7/2014 6:29:17 AMUSERSTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
4APPQOSSYS49 EXPIRED & LOCKED7/7/2014 5:53:07 AM7/7/2014 5:53:07 AMSYSAUXTEMP7/7/2014 5:53:07 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
5AUDSYS7 EXPIRED & LOCKED7/7/2014 5:39:13 AM7/7/2014 5:39:13 AMUSERSTEMP7/7/2014 5:39:13 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
6BI107 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
7CTXSYS73 EXPIRED & LOCKED7/7/2014 6:12:03 AM7/7/2014 6:12:03 AMSYSAUXTEMP7/7/2014 6:11:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
8DBSNMP48 OPEN 1/4/2019 10:26:08 PMSYSAUXTEMP7/7/2014 5:53:06 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES04-AUG-18 04.46.51.000000000 PM +08:00Y
9DIP23 EXPIRED & LOCKED7/7/2014 5:43:05 AM7/7/2014 5:43:05 AMUSERSTEMP7/7/2014 5:43:05 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
10DVF99 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMSYSAUXTEMP7/7/2014 6:51:55 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
11DVSYS1279990 EXPIRED & LOCKED7/7/2014 6:52:07 AM7/7/2014 6:52:07 AMSYSAUXTEMP7/7/2014 6:51:55 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
12FLOWS_FILES94 EXPIRED & LOCKED7/7/2014 6:31:11 AM7/7/2014 6:31:11 AMSYSAUXTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
13GSMADMIN_INTERNAL21 EXPIRED & LOCKED7/7/2014 5:42:58 AM7/7/2014 5:42:58 AMSYSAUXTEMP7/7/2014 5:42:58 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
14GSMCATUSER61 EXPIRED & LOCKED7/7/2014 5:56:36 AM7/7/2014 5:56:36 AMUSERSTEMP7/7/2014 5:56:36 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
15GSMUSER22 EXPIRED & LOCKED7/7/2014 5:42:58 AM7/7/2014 5:42:58 AMUSERSTEMP7/7/2014 5:42:58 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
16HR102 OPEN 1/10/2019 5:50:13 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTGROUP1 10G 11G 12C NPASSWORDNNO04-AUG-18 02.49.16.000000000 PM +08:00N
17IX104 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
18LBACSYS92 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMSYSTEMTEMP7/7/2014 6:29:01 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
19MDDATA85 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMUSERSTEMP7/7/2014 6:20:54 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
20MDSYS79 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
21OE109 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMEXAMPLETEMP7/8/2018 10:05:46 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
22OJVMSYS70 EXPIRED & LOCKED7/7/2014 6:07:27 AM7/7/2014 6:07:27 AMUSERSTEMP7/7/2014 6:07:27 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
23OLAPSYS82 EXPIRED & LOCKED7/7/2014 6:20:30 AM7/7/2014 6:20:30 AMSYSAUXTEMP7/7/2014 6:20:30 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
24OPS$ORACLE111EXTERNALOPEN USERSTEMP7/18/2018 8:30:39 PMDEFAULTDEFAULT_CONSUMER_GROUP NEXTERNALNNO28-JUL-18 11.36.44.000000000 AM +08:00N
25ORACLE_OCM36 EXPIRED & LOCKED7/7/2014 5:44:37 AM7/7/2014 5:44:37 AMUSERSTEMP7/7/2014 5:44:37 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
26ORDDATA76 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
27ORDPLUGINS77 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
28ORDSYS75 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
29OUTLN13 EXPIRED & LOCKED7/7/2014 5:39:15 AM7/7/2014 5:39:15 AMSYSTEMTEMP7/7/2014 5:39:15 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
30PM106 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
31SCOTT110 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:10:54 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
32SH105 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
33SI_INFORMTN_SCHEMA78 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
34SPATIAL_CSW_ADMIN_USR90 EXPIRED & LOCKED7/7/2014 6:25:01 AM7/7/2014 6:25:01 AMUSERSTEMP7/7/2014 6:25:01 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
35SPATIAL_WFS_ADMIN_USR87 EXPIRED & LOCKED7/7/2014 6:24:57 AM7/7/2014 6:24:57 AMUSERSTEMP7/7/2014 6:24:57 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
36SYS0 OPEN 1/17/2019 11:00:04 AMSYSTEMTEMP7/7/2014 5:39:13 AMDEFAULTSYS_GROUP 10G 11G 12C NPASSWORDNYES21-JUL-18 11.00.04.000000000 AM +08:00Y
37SYSBACKUP2147483617 EXPIRED & LOCKED7/7/2014 5:39:13 AM7/7/2014 5:39:13 AMUSERSTEMP7/7/2014 5:39:13 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
38SYSDG2147483618 EXPIRED & LOCKED7/7/2014 5:39:14 AM7/7/2014 5:39:14 AMUSERSTEMP7/7/2014 5:39:14 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
39SYSKM2147483619 EXPIRED & LOCKED7/7/2014 5:39:14 AM7/7/2014 5:39:14 AMUSERSTEMP7/7/2014 5:39:14 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
40SYSTEM8 OPEN 1/4/2019 10:04:24 PMSYSTEMTEMP7/7/2014 5:39:13 AMDEFAULTSYS_GROUP 10G 11G 12C NPASSWORDNYES28-JUL-18 03.11.38.000000000 PM +08:00Y
41USER1112 OPEN 1/14/2019 9:01:20 PMUSERSTEMP7/18/2018 9:01:20 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO28-JUL-18 03.39.15.000000000 PM +08:00N
42USER2113 EXPIRED 7/28/2018 3:22:46 PMUSERSTEMP7/18/2018 9:01:51 PMPROFILE1DEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO28-JUL-18 03.21.46.000000000 PM +08:00N
43WMSYS62 EXPIRED & LOCKED7/7/2014 6:05:43 AM7/7/2014 6:05:43 AMSYSAUXTEMP7/7/2014 6:05:43 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
44XDB50 EXPIRED & LOCKED7/7/2014 5:53:17 AM7/7/2014 5:53:17 AMSYSAUXTEMP7/7/2014 5:53:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
45XS$NULL2147483638 EXPIRED & LOCKED7/7/2014 5:44:03 AM7/7/2014 5:44:03 AMUSERSTEMP7/7/2014 5:44:03 AMDEFAULTDEFAULT_CONSUMER_GROUP 11G NPASSWORDNYES Y

  1. [oracle@station90 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 12.1.0.2.0 Production on Sat Aug 4 16:48:21 2018

  3. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> @?/rdbms/admin/prvtrsch.plb

  7. PL/SQL procedure successfully completed.


  8. PL/SQL procedure successfully completed.


  9. PL/SQL procedure successfully completed.


  10. no rows selected


  11. Package created.


  12. Package body created.

  13. No errors.

  14. PL/SQL procedure successfully completed.


  15. PL/SQL procedure successfully completed.


  16. User altered.


  17. User altered.


  18. 1 row updated.


  19. Commit complete.


  20. Grant succeeded.


  21. Procedure created.

  22. No errors.

  23. Audit policy altered.


  24. Function created.


  25. Procedure created.


  26. Procedure created.


  27. Procedure created.


  28. Procedure created.


  29. Procedure created.


  30. Procedure created.

  31. No errors.

  32. Procedure created.

  33. No errors.

  34. Procedure created.

  35. No errors.

  36. PL/SQL procedure successfully completed.


  37. Commit complete.


  38. PL/SQL procedure successfully completed.


  39. Commit complete.

  40. SQL>
复制代码
  1. select * from dba_users order by 1;
复制代码
   USERNAMEUSER_IDPASSWORDACCOUNT_STATUSLOCK_DATEEXPIRY_DATEDEFAULT_TABLESPACETEMPORARY_TABLESPACECREATEDPROFILEINITIAL_RSRC_CONSUMER_GROUPEXTERNAL_NAMEPASSWORD_VERSIONSEDITIONS_ENABLEDAUTHENTICATION_TYPEPROXY_ONLY_CONNECTCOMMONLAST_LOGINORACLE_MAINTAINED
1ANONYMOUS51 EXPIRED 7/7/2014 6:52:34 AMSYSAUXTEMP7/7/2014 5:53:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G NPASSWORDNYES Y
2APEX_04020098 EXPIRED & LOCKED7/7/2014 6:31:11 AM7/7/2014 6:31:11 AMSYSAUXTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
3APEX_PUBLIC_USER95 EXPIRED & LOCKED7/7/2014 6:29:17 AM7/7/2014 6:29:17 AMUSERSTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
4APPQOSSYS49 EXPIRED & LOCKED7/7/2014 5:53:07 AM7/7/2014 5:53:07 AMSYSAUXTEMP7/7/2014 5:53:07 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
5AUDSYS7 EXPIRED & LOCKED7/7/2014 5:39:13 AM7/7/2014 5:39:13 AMUSERSTEMP7/7/2014 5:39:13 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
6BI107 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
7CTXSYS73 EXPIRED & LOCKED7/7/2014 6:12:03 AM7/7/2014 6:12:03 AMSYSAUXTEMP7/7/2014 6:11:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
8DBSNMP48 OPEN 1/4/2019 10:26:08 PMSYSAUXTEMP7/7/2014 5:53:06 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES04-AUG-18 04.49.51.000000000 PM +08:00Y
9DIP23 EXPIRED & LOCKED7/7/2014 5:43:05 AM7/7/2014 5:43:05 AMUSERSTEMP7/7/2014 5:43:05 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
10DVF99 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMSYSAUXTEMP7/7/2014 6:51:55 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
11DVSYS1279990 EXPIRED & LOCKED7/7/2014 6:52:07 AM7/7/2014 6:52:07 AMSYSAUXTEMP7/7/2014 6:51:55 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
12FLOWS_FILES94 EXPIRED & LOCKED7/7/2014 6:31:11 AM7/7/2014 6:31:11 AMSYSAUXTEMP7/7/2014 6:29:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
13GSMADMIN_INTERNAL21 EXPIRED & LOCKED7/7/2014 5:42:58 AM7/7/2014 5:42:58 AMSYSAUXTEMP7/7/2014 5:42:58 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
14GSMCATUSER61 EXPIRED & LOCKED7/7/2014 5:56:36 AM7/7/2014 5:56:36 AMUSERSTEMP7/7/2014 5:56:36 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
15GSMUSER22 EXPIRED & LOCKED7/7/2014 5:42:58 AM7/7/2014 5:42:58 AMUSERSTEMP7/7/2014 5:42:58 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
16HR102 OPEN 1/10/2019 5:50:13 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTGROUP1 10G 11G 12C NPASSWORDNNO04-AUG-18 02.49.16.000000000 PM +08:00N
17IX104 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
18LBACSYS92 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMSYSTEMTEMP7/7/2014 6:29:01 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
19MDDATA85 EXPIRED & LOCKED7/7/2014 6:52:34 AM7/7/2014 6:52:34 AMUSERSTEMP7/7/2014 6:20:54 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
20MDSYS79 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
21OE109 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMEXAMPLETEMP7/8/2018 10:05:46 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
22OJVMSYS70 EXPIRED & LOCKED7/7/2014 6:07:27 AM7/7/2014 6:07:27 AMUSERSTEMP7/7/2014 6:07:27 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
23OLAPSYS82 EXPIRED & LOCKED7/7/2014 6:20:30 AM7/7/2014 6:20:30 AMSYSAUXTEMP7/7/2014 6:20:30 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
24OPS$ORACLE111EXTERNALOPEN USERSTEMP7/18/2018 8:30:39 PMDEFAULTDEFAULT_CONSUMER_GROUP NEXTERNALNNO28-JUL-18 11.36.44.000000000 AM +08:00N
25ORACLE_OCM36 EXPIRED & LOCKED7/7/2014 5:44:37 AM7/7/2014 5:44:37 AMUSERSTEMP7/7/2014 5:44:37 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
26ORDDATA76 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
27ORDPLUGINS77 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
28ORDSYS75 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
29OUTLN13 EXPIRED & LOCKED7/7/2014 5:39:15 AM7/7/2014 5:39:15 AMSYSTEMTEMP7/7/2014 5:39:15 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
30PM106 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
31REMOTE_SCHEDULER_AGENT115
EXPIRED & LOCKED8/4/2018 4:48:28 PM8/4/2018 4:48:28 PMUSERSTEMP8/4/2018 4:48:28 PMDEFAULTDEFAULT_CONSUMER_GROUP NPASSWORDNNO N
32SCOTT110 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:10:54 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
33SH105 EXPIRED & LOCKED7/8/2018 10:11:03 PM7/8/2018 10:11:03 PMUSERSTEMP7/8/2018 10:04:24 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO N
34SI_INFORMTN_SCHEMA78 EXPIRED & LOCKED7/7/2014 6:12:11 AM7/7/2014 6:12:11 AMSYSAUXTEMP7/7/2014 6:12:11 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
35SPATIAL_CSW_ADMIN_USR90 EXPIRED & LOCKED7/7/2014 6:25:01 AM7/7/2014 6:25:01 AMUSERSTEMP7/7/2014 6:25:01 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
36SPATIAL_WFS_ADMIN_USR87 EXPIRED & LOCKED7/7/2014 6:24:57 AM7/7/2014 6:24:57 AMUSERSTEMP7/7/2014 6:24:57 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
37SYS0 OPEN 1/17/2019 11:00:04 AMSYSTEMTEMP7/7/2014 5:39:13 AMDEFAULTSYS_GROUP 10G 11G 12C NPASSWORDNYES21-JUL-18 11.00.04.000000000 AM +08:00Y
38SYSBACKUP2147483617 EXPIRED & LOCKED7/7/2014 5:39:13 AM7/7/2014 5:39:13 AMUSERSTEMP7/7/2014 5:39:13 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
39SYSDG2147483618 EXPIRED & LOCKED7/7/2014 5:39:14 AM7/7/2014 5:39:14 AMUSERSTEMP7/7/2014 5:39:14 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
40SYSKM2147483619 EXPIRED & LOCKED7/7/2014 5:39:14 AM7/7/2014 5:39:14 AMUSERSTEMP7/7/2014 5:39:14 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
41SYSTEM8 OPEN 1/4/2019 10:04:24 PMSYSTEMTEMP7/7/2014 5:39:13 AMDEFAULTSYS_GROUP 10G 11G 12C NPASSWORDNYES28-JUL-18 03.11.38.000000000 PM +08:00Y
42USER1112 OPEN 1/14/2019 9:01:20 PMUSERSTEMP7/18/2018 9:01:20 PMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO28-JUL-18 03.39.15.000000000 PM +08:00N
43USER2113 EXPIRED 7/28/2018 3:22:46 PMUSERSTEMP7/18/2018 9:01:51 PMPROFILE1DEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNNO28-JUL-18 03.21.46.000000000 PM +08:00N
44WMSYS62 EXPIRED & LOCKED7/7/2014 6:05:43 AM7/7/2014 6:05:43 AMSYSAUXTEMP7/7/2014 6:05:43 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
45XDB50 EXPIRED & LOCKED7/7/2014 5:53:17 AM7/7/2014 5:53:17 AMSYSAUXTEMP7/7/2014 5:53:17 AMDEFAULTDEFAULT_CONSUMER_GROUP 10G 11G 12C NPASSWORDNYES Y
46XS$NULL2147483638 EXPIRED & LOCKED7/7/2014 5:44:03 AM7/7/2014 5:44:03 AMUSERSTEMP7/7/2014 5:44:03 AMDEFAULTDEFAULT_CONSUMER_GROUP 11G NPASSWORDNYES Y

  1. [oracle@station90 ~]$ netstat -lntp | grep :8888
  2. (Not all processes could be identified, non-owned process info
  3. will not be shown, you would have to be root to see it all.)
复制代码
  1. BEGIN
  2. DBMS_XDB.SETHTTPPORT(8888);
  3. END;
复制代码
  1. [oracle@station90 ~]$ netstat -lntp | grep :8888
  2. (Not all processes could be identified, non-owned process info
  3. will not be shown, you would have to be root to see it all.)
  4. tcp        0      0 :::8888                     :::*                        LISTEN      22259/tnslsnr   
复制代码
  1. SELECT DBMS_XDB.GETHTTPPORT() FROM DUAL;
复制代码
  1. BEGIN
  2. DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('mypassword');
  3. END;
复制代码

远程这一头:
-客户机器安装client中的定制---scheduleragent组件(一般填客户机主机名,端口1500)
1.png

->
2.png

->
3.png
->
4.png



客户机需要用schagent -registerdatabase 192.168.0.90 8888
  1. [oracle@station86 bin]$ ./schagent  -registerdatabase  192.168.0.90  8888

  2. Agent Registration Password ? ***********

  3. Oracle Scheduler Agent Registration for 12.1 Agent
  4. Agent Registration Successful!
复制代码
  1. [oracle@station86 bin]$ ./schagent -start
  2. Scheduler agent started
复制代码
在12c这一头:
--服务器验证:
  1. DECLARE
  2. versionnum VARCHAR2(30);
  3. BEGIN
  4. versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('station86');
  5. DBMS_OUTPUT.PUT_LINE(versionnum);
  6. END;
复制代码
12.1.0.1.1
  1. select  * from dba_scheduler_external_dests;
复制代码
   OWNERDESTINATION_NAMEHOSTNAMEPORTIP_ADDRESSENABLEDCOMMENTS
1SYSSTATION86station86.example.com1025192.168.0.86TRUERegistered on 04-AUG-18 05.08.44.539215 PM PRC


  1. grant all on station86 to hr;
复制代码

  1. BEGIN
  2. sys.dbms_scheduler.create_job(
  3. job_name => '"HR"."JOB11"',
  4. job_type => 'EXECUTABLE',
  5. job_action => '/home/oracle/helloworld.sh',
  6. repeat_interval => 'FREQ=SECONDLY;INTERVAL=30',
  7. start_date => systimestamp at time zone 'Asia/Shanghai',
  8. end_date => to_timestamp_tz('2018-08-04 17:30:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
  9. job_class => '"DEFAULT_JOB_CLASS"',
  10. comments => 'job11',
  11. auto_drop => TRUE,
  12. enabled => FALSE);
  13. DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB11"', attribute => 'destination', value => 'station86' );
  14. DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB11"', attribute => 'credential_name', value => '"SYS"."CREDENTIAL1"' );
  15. sys.dbms_scheduler.enable( '"HR"."JOB11"' );
  16. END;
复制代码

在windows上外部作业(包含远程外部作业)容易报以下错误:

Host Credentials报错"Connection to host as user oracle failed: ERROR: Wrong password for user"的解决一例


我成功安装了Oracle 10g,可以登录到企业管理器,但无法执行一些操作,如数据库的备份调度,
执行恢复等,由于操作系统登录全权证书的问题。我被要求提供操作系统登录凭证才可以执行这些操作。

我在Host Credentials那里输入的是用户administrator,并且administrator已经加入到了ORA_DBA组
但执行操作是报错如下:
Error: Connection to host as user oracle failed:
ERROR: Wrong password for user

如何解决这个问题呢?
我查阅了Oracle的官方文档,发现如下解决办法:

1. 打开组策略,用gpedit.msc命令。
2. 逐步找到compute configuration -- windows setting -- security setting -- local policy
-- user rights assignment -- log on as a batch job
3.双击"log on as a batch job",在这里加入你需要的操作系统user
4.再次在OEM的Host Credentials输入那些user和password,一切ok。




windows.png
回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-4 00:57 , Processed in 0.053314 second(s), 28 queries .

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