|
Linux Shell下面的文件观察家:
[root@station90 桌面]# until [ -f f.png ]; do sleep 1 ; done ;echo "File exists"
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
一定要做:
- [root@station90 lib64]# ln -s libpam.so.0.82.2 libpam.so
复制代码 请注意观察默认有一个不起动的file watcher作业的总的“代表”:
靠上面这张图中的file_watcher_schedule基于时间来观察,我们做实验就把这个间隔10分钟改为2分钟。
- begin
- dbms_scheduler.create_file_watcher(
- file_watcher_name => 'filewatcher1',
- directory_path => '/home/oracle/myfile',
- file_name => 'botang*.txt',
- credential_name => 'credential1');
- end;
- select * from dba_scheduler_file_watchers;
- grant execute on filewatcher1 to hr;
- grant execute on SYS.SCHEDULER_FILEWATCHER_RESULT to hr;
- grant create external job to hr;
- grant create job to hr;
- create table hr.tfilewatcher1 ( a varchar2(200) ) ;
- create or replace procedure hr.procfilewatcher ( p_1 SYS.SCHEDULER_FILEWATCHER_RESULT)
- is
- begin
- insert into hr.tfilewatcher1 values ( to_char( p_1.file_timestamp,'YYYY-MM-DD:HH24:MI:SS') ||' '
- ||p_1.directory_path||' '
- ||p_1.actual_file_name||' '
- ||p_1.file_size ) ;
- commit;
- end;
- begin
- dbms_scheduler.create_program(
- program_name => 'HR.program10',
- program_type => 'STORED_PROCEDURE',
- program_action => 'HR.procfilewatcher',
- number_of_arguments => 1,
- enabled => false);
- end;
- begin
- dbms_scheduler.define_metadata_argument(
- program_name => 'HR.program10',
- metadata_attribute => 'event_message',argument_position => 1 ) ;
- end;
- begin
- dbms_scheduler.enable('HR.program10');
- end;
复制代码 当定义了第一个file watcher之后,默认的file watcher“代表”活了:
- BEGIN
- DBMS_SCHEDULER.CREATE_JOB(
- jOB_NAME=> 'hr.job10',
- PROGRAM_NAME=> 'hr.program10',
- EVENT_CONDITION => 'tab.user_data.file_size > 10',
- QUEUE_SPEC=> 'filewatcher1',
- AUTO_DROP=> FALSE,
- ENABLED=> true);
- END;
复制代码
使能并行文件到达观察,不要错过文件:
- begin
- dbms_scheduler.set_attribute('hr.job10','parallel_instances',true);
- end;
复制代码- select * from hr.tfilewatcher1;
复制代码
| A | 1 | 2018-08-04:08:11:24 /home/oracle/myfile botang1.txt 11 | 2 | 2018-08-04:08:17:17 /home/oracle/myfile botang3.txt 551920 | 3 | 2018-08-04:08:17:42 /home/oracle/myfile botang1.txt 22 |
-------------------------------------------远程外部作业
12c这一头:
- alter system set dispatchers='(PROTOCOL=TCP) (dispatchers=6)';
- alter system set shared_servers=6;
- select * from dba_users order by 1;
复制代码 | USERNAME | USER_ID | PASSWORD | ACCOUNT_STATUS | LOCK_DATE | EXPIRY_DATE | DEFAULT_TABLESPACE | TEMPORARY_TABLESPACE | CREATED | PROFILE | INITIAL_RSRC_CONSUMER_GROUP | EXTERNAL_NAME | PASSWORD_VERSIONS | EDITIONS_ENABLED | AUTHENTICATION_TYPE | PROXY_ONLY_CONNECT | COMMON | LAST_LOGIN | ORACLE_MAINTAINED | 1 | ANONYMOUS | 51 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | SYSAUX | TEMP | 7/7/2014 5:53:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G | N | PASSWORD | N | YES | | Y | 2 | APEX_040200 | 98 | | EXPIRED & LOCKED | 7/7/2014 6:31:11 AM | 7/7/2014 6:31:11 AM | SYSAUX | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 3 | APEX_PUBLIC_USER | 95 | | EXPIRED & LOCKED | 7/7/2014 6:29:17 AM | 7/7/2014 6:29:17 AM | USERS | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 4 | APPQOSSYS | 49 | | EXPIRED & LOCKED | 7/7/2014 5:53:07 AM | 7/7/2014 5:53:07 AM | SYSAUX | TEMP | 7/7/2014 5:53:07 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 5 | AUDSYS | 7 | | EXPIRED & LOCKED | 7/7/2014 5:39:13 AM | 7/7/2014 5:39:13 AM | USERS | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 6 | BI | 107 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 7 | CTXSYS | 73 | | EXPIRED & LOCKED | 7/7/2014 6:12:03 AM | 7/7/2014 6:12:03 AM | SYSAUX | TEMP | 7/7/2014 6:11:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 8 | DBSNMP | 48 | | OPEN | | 1/4/2019 10:26:08 PM | SYSAUX | TEMP | 7/7/2014 5:53:06 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 04-AUG-18 04.46.51.000000000 PM +08:00 | Y | 9 | DIP | 23 | | EXPIRED & LOCKED | 7/7/2014 5:43:05 AM | 7/7/2014 5:43:05 AM | USERS | TEMP | 7/7/2014 5:43:05 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 10 | DVF | 99 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | SYSAUX | TEMP | 7/7/2014 6:51:55 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 11 | DVSYS | 1279990 | | EXPIRED & LOCKED | 7/7/2014 6:52:07 AM | 7/7/2014 6:52:07 AM | SYSAUX | TEMP | 7/7/2014 6:51:55 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 12 | FLOWS_FILES | 94 | | EXPIRED & LOCKED | 7/7/2014 6:31:11 AM | 7/7/2014 6:31:11 AM | SYSAUX | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 13 | GSMADMIN_INTERNAL | 21 | | EXPIRED & LOCKED | 7/7/2014 5:42:58 AM | 7/7/2014 5:42:58 AM | SYSAUX | TEMP | 7/7/2014 5:42:58 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 14 | GSMCATUSER | 61 | | EXPIRED & LOCKED | 7/7/2014 5:56:36 AM | 7/7/2014 5:56:36 AM | USERS | TEMP | 7/7/2014 5:56:36 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 15 | GSMUSER | 22 | | EXPIRED & LOCKED | 7/7/2014 5:42:58 AM | 7/7/2014 5:42:58 AM | USERS | TEMP | 7/7/2014 5:42:58 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 16 | HR | 102 | | OPEN | | 1/10/2019 5:50:13 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | GROUP1 | | 10G 11G 12C | N | PASSWORD | N | NO | 04-AUG-18 02.49.16.000000000 PM +08:00 | N | 17 | IX | 104 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 18 | LBACSYS | 92 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | SYSTEM | TEMP | 7/7/2014 6:29:01 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 19 | MDDATA | 85 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | USERS | TEMP | 7/7/2014 6:20:54 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 20 | MDSYS | 79 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 21 | OE | 109 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | EXAMPLE | TEMP | 7/8/2018 10:05:46 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 22 | OJVMSYS | 70 | | EXPIRED & LOCKED | 7/7/2014 6:07:27 AM | 7/7/2014 6:07:27 AM | USERS | TEMP | 7/7/2014 6:07:27 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 23 | OLAPSYS | 82 | | EXPIRED & LOCKED | 7/7/2014 6:20:30 AM | 7/7/2014 6:20:30 AM | SYSAUX | TEMP | 7/7/2014 6:20:30 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 24 | OPS$ORACLE | 111 | EXTERNAL | OPEN | | | USERS | TEMP | 7/18/2018 8:30:39 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | | N | EXTERNAL | N | NO | 28-JUL-18 11.36.44.000000000 AM +08:00 | N | 25 | ORACLE_OCM | 36 | | EXPIRED & LOCKED | 7/7/2014 5:44:37 AM | 7/7/2014 5:44:37 AM | USERS | TEMP | 7/7/2014 5:44:37 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 26 | ORDDATA | 76 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 27 | ORDPLUGINS | 77 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 28 | ORDSYS | 75 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 29 | OUTLN | 13 | | EXPIRED & LOCKED | 7/7/2014 5:39:15 AM | 7/7/2014 5:39:15 AM | SYSTEM | TEMP | 7/7/2014 5:39:15 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 30 | PM | 106 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 31 | SCOTT | 110 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:10:54 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 32 | SH | 105 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 33 | SI_INFORMTN_SCHEMA | 78 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 34 | SPATIAL_CSW_ADMIN_USR | 90 | | EXPIRED & LOCKED | 7/7/2014 6:25:01 AM | 7/7/2014 6:25:01 AM | USERS | TEMP | 7/7/2014 6:25:01 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 35 | SPATIAL_WFS_ADMIN_USR | 87 | | EXPIRED & LOCKED | 7/7/2014 6:24:57 AM | 7/7/2014 6:24:57 AM | USERS | TEMP | 7/7/2014 6:24:57 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 36 | SYS | 0 | | OPEN | | 1/17/2019 11:00:04 AM | SYSTEM | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | SYS_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 21-JUL-18 11.00.04.000000000 AM +08:00 | Y | 37 | SYSBACKUP | 2147483617 | | EXPIRED & LOCKED | 7/7/2014 5:39:13 AM | 7/7/2014 5:39:13 AM | USERS | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 38 | SYSDG | 2147483618 | | EXPIRED & LOCKED | 7/7/2014 5:39:14 AM | 7/7/2014 5:39:14 AM | USERS | TEMP | 7/7/2014 5:39:14 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 39 | SYSKM | 2147483619 | | EXPIRED & LOCKED | 7/7/2014 5:39:14 AM | 7/7/2014 5:39:14 AM | USERS | TEMP | 7/7/2014 5:39:14 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 40 | SYSTEM | 8 | | OPEN | | 1/4/2019 10:04:24 PM | SYSTEM | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | SYS_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 28-JUL-18 03.11.38.000000000 PM +08:00 | Y | 41 | USER1 | 112 | | OPEN | | 1/14/2019 9:01:20 PM | USERS | TEMP | 7/18/2018 9:01:20 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | 28-JUL-18 03.39.15.000000000 PM +08:00 | N | 42 | USER2 | 113 | | EXPIRED | | 7/28/2018 3:22:46 PM | USERS | TEMP | 7/18/2018 9:01:51 PM | PROFILE1 | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | 28-JUL-18 03.21.46.000000000 PM +08:00 | N | 43 | WMSYS | 62 | | EXPIRED & LOCKED | 7/7/2014 6:05:43 AM | 7/7/2014 6:05:43 AM | SYSAUX | TEMP | 7/7/2014 6:05:43 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 44 | XDB | 50 | | EXPIRED & LOCKED | 7/7/2014 5:53:17 AM | 7/7/2014 5:53:17 AM | SYSAUX | TEMP | 7/7/2014 5:53:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 45 | XS$NULL | 2147483638 | | EXPIRED & LOCKED | 7/7/2014 5:44:03 AM | 7/7/2014 5:44:03 AM | USERS | TEMP | 7/7/2014 5:44:03 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 11G | N | PASSWORD | N | YES | | Y |
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 12.1.0.2.0 Production on Sat Aug 4 16:48:21 2018
- Copyright (c) 1982, 2014, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> @?/rdbms/admin/prvtrsch.plb
- PL/SQL procedure successfully completed.
- PL/SQL procedure successfully completed.
- PL/SQL procedure successfully completed.
- no rows selected
- Package created.
- Package body created.
- No errors.
- PL/SQL procedure successfully completed.
- PL/SQL procedure successfully completed.
- User altered.
- User altered.
- 1 row updated.
- Commit complete.
- Grant succeeded.
- Procedure created.
- No errors.
- Audit policy altered.
- Function created.
- Procedure created.
- Procedure created.
- Procedure created.
- Procedure created.
- Procedure created.
- Procedure created.
- No errors.
- Procedure created.
- No errors.
- Procedure created.
- No errors.
- PL/SQL procedure successfully completed.
- Commit complete.
- PL/SQL procedure successfully completed.
- Commit complete.
- SQL>
复制代码- select * from dba_users order by 1;
复制代码 | USERNAME | USER_ID | PASSWORD | ACCOUNT_STATUS | LOCK_DATE | EXPIRY_DATE | DEFAULT_TABLESPACE | TEMPORARY_TABLESPACE | CREATED | PROFILE | INITIAL_RSRC_CONSUMER_GROUP | EXTERNAL_NAME | PASSWORD_VERSIONS | EDITIONS_ENABLED | AUTHENTICATION_TYPE | PROXY_ONLY_CONNECT | COMMON | LAST_LOGIN | ORACLE_MAINTAINED | 1 | ANONYMOUS | 51 | | EXPIRED | | 7/7/2014 6:52:34 AM | SYSAUX | TEMP | 7/7/2014 5:53:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G | N | PASSWORD | N | YES | | Y | 2 | APEX_040200 | 98 | | EXPIRED & LOCKED | 7/7/2014 6:31:11 AM | 7/7/2014 6:31:11 AM | SYSAUX | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 3 | APEX_PUBLIC_USER | 95 | | EXPIRED & LOCKED | 7/7/2014 6:29:17 AM | 7/7/2014 6:29:17 AM | USERS | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 4 | APPQOSSYS | 49 | | EXPIRED & LOCKED | 7/7/2014 5:53:07 AM | 7/7/2014 5:53:07 AM | SYSAUX | TEMP | 7/7/2014 5:53:07 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 5 | AUDSYS | 7 | | EXPIRED & LOCKED | 7/7/2014 5:39:13 AM | 7/7/2014 5:39:13 AM | USERS | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 6 | BI | 107 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 7 | CTXSYS | 73 | | EXPIRED & LOCKED | 7/7/2014 6:12:03 AM | 7/7/2014 6:12:03 AM | SYSAUX | TEMP | 7/7/2014 6:11:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 8 | DBSNMP | 48 | | OPEN | | 1/4/2019 10:26:08 PM | SYSAUX | TEMP | 7/7/2014 5:53:06 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 04-AUG-18 04.49.51.000000000 PM +08:00 | Y | 9 | DIP | 23 | | EXPIRED & LOCKED | 7/7/2014 5:43:05 AM | 7/7/2014 5:43:05 AM | USERS | TEMP | 7/7/2014 5:43:05 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 10 | DVF | 99 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | SYSAUX | TEMP | 7/7/2014 6:51:55 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 11 | DVSYS | 1279990 | | EXPIRED & LOCKED | 7/7/2014 6:52:07 AM | 7/7/2014 6:52:07 AM | SYSAUX | TEMP | 7/7/2014 6:51:55 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 12 | FLOWS_FILES | 94 | | EXPIRED & LOCKED | 7/7/2014 6:31:11 AM | 7/7/2014 6:31:11 AM | SYSAUX | TEMP | 7/7/2014 6:29:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 13 | GSMADMIN_INTERNAL | 21 | | EXPIRED & LOCKED | 7/7/2014 5:42:58 AM | 7/7/2014 5:42:58 AM | SYSAUX | TEMP | 7/7/2014 5:42:58 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 14 | GSMCATUSER | 61 | | EXPIRED & LOCKED | 7/7/2014 5:56:36 AM | 7/7/2014 5:56:36 AM | USERS | TEMP | 7/7/2014 5:56:36 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 15 | GSMUSER | 22 | | EXPIRED & LOCKED | 7/7/2014 5:42:58 AM | 7/7/2014 5:42:58 AM | USERS | TEMP | 7/7/2014 5:42:58 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 16 | HR | 102 | | OPEN | | 1/10/2019 5:50:13 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | GROUP1 | | 10G 11G 12C | N | PASSWORD | N | NO | 04-AUG-18 02.49.16.000000000 PM +08:00 | N | 17 | IX | 104 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 18 | LBACSYS | 92 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | SYSTEM | TEMP | 7/7/2014 6:29:01 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 19 | MDDATA | 85 | | EXPIRED & LOCKED | 7/7/2014 6:52:34 AM | 7/7/2014 6:52:34 AM | USERS | TEMP | 7/7/2014 6:20:54 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 20 | MDSYS | 79 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 21 | OE | 109 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | EXAMPLE | TEMP | 7/8/2018 10:05:46 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 22 | OJVMSYS | 70 | | EXPIRED & LOCKED | 7/7/2014 6:07:27 AM | 7/7/2014 6:07:27 AM | USERS | TEMP | 7/7/2014 6:07:27 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 23 | OLAPSYS | 82 | | EXPIRED & LOCKED | 7/7/2014 6:20:30 AM | 7/7/2014 6:20:30 AM | SYSAUX | TEMP | 7/7/2014 6:20:30 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 24 | OPS$ORACLE | 111 | EXTERNAL | OPEN | | | USERS | TEMP | 7/18/2018 8:30:39 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | | N | EXTERNAL | N | NO | 28-JUL-18 11.36.44.000000000 AM +08:00 | N | 25 | ORACLE_OCM | 36 | | EXPIRED & LOCKED | 7/7/2014 5:44:37 AM | 7/7/2014 5:44:37 AM | USERS | TEMP | 7/7/2014 5:44:37 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 26 | ORDDATA | 76 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 27 | ORDPLUGINS | 77 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 28 | ORDSYS | 75 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 29 | OUTLN | 13 | | EXPIRED & LOCKED | 7/7/2014 5:39:15 AM | 7/7/2014 5:39:15 AM | SYSTEM | TEMP | 7/7/2014 5:39:15 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 30 | PM | 106 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 31 | REMOTE_SCHEDULER_AGENT | 115 |
| EXPIRED & LOCKED | 8/4/2018 4:48:28 PM | 8/4/2018 4:48:28 PM | USERS | TEMP | 8/4/2018 4:48:28 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | | N | PASSWORD | N | NO | | N | 32 | SCOTT | 110 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:10:54 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 33 | SH | 105 | | EXPIRED & LOCKED | 7/8/2018 10:11:03 PM | 7/8/2018 10:11:03 PM | USERS | TEMP | 7/8/2018 10:04:24 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | | N | 34 | SI_INFORMTN_SCHEMA | 78 | | EXPIRED & LOCKED | 7/7/2014 6:12:11 AM | 7/7/2014 6:12:11 AM | SYSAUX | TEMP | 7/7/2014 6:12:11 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 35 | SPATIAL_CSW_ADMIN_USR | 90 | | EXPIRED & LOCKED | 7/7/2014 6:25:01 AM | 7/7/2014 6:25:01 AM | USERS | TEMP | 7/7/2014 6:25:01 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 36 | SPATIAL_WFS_ADMIN_USR | 87 | | EXPIRED & LOCKED | 7/7/2014 6:24:57 AM | 7/7/2014 6:24:57 AM | USERS | TEMP | 7/7/2014 6:24:57 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 37 | SYS | 0 | | OPEN | | 1/17/2019 11:00:04 AM | SYSTEM | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | SYS_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 21-JUL-18 11.00.04.000000000 AM +08:00 | Y | 38 | SYSBACKUP | 2147483617 | | EXPIRED & LOCKED | 7/7/2014 5:39:13 AM | 7/7/2014 5:39:13 AM | USERS | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 39 | SYSDG | 2147483618 | | EXPIRED & LOCKED | 7/7/2014 5:39:14 AM | 7/7/2014 5:39:14 AM | USERS | TEMP | 7/7/2014 5:39:14 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 40 | SYSKM | 2147483619 | | EXPIRED & LOCKED | 7/7/2014 5:39:14 AM | 7/7/2014 5:39:14 AM | USERS | TEMP | 7/7/2014 5:39:14 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 41 | SYSTEM | 8 | | OPEN | | 1/4/2019 10:04:24 PM | SYSTEM | TEMP | 7/7/2014 5:39:13 AM | DEFAULT | SYS_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | 28-JUL-18 03.11.38.000000000 PM +08:00 | Y | 42 | USER1 | 112 | | OPEN | | 1/14/2019 9:01:20 PM | USERS | TEMP | 7/18/2018 9:01:20 PM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | 28-JUL-18 03.39.15.000000000 PM +08:00 | N | 43 | USER2 | 113 | | EXPIRED | | 7/28/2018 3:22:46 PM | USERS | TEMP | 7/18/2018 9:01:51 PM | PROFILE1 | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | NO | 28-JUL-18 03.21.46.000000000 PM +08:00 | N | 44 | WMSYS | 62 | | EXPIRED & LOCKED | 7/7/2014 6:05:43 AM | 7/7/2014 6:05:43 AM | SYSAUX | TEMP | 7/7/2014 6:05:43 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 45 | XDB | 50 | | EXPIRED & LOCKED | 7/7/2014 5:53:17 AM | 7/7/2014 5:53:17 AM | SYSAUX | TEMP | 7/7/2014 5:53:17 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 10G 11G 12C | N | PASSWORD | N | YES | | Y | 46 | XS$NULL | 2147483638 | | EXPIRED & LOCKED | 7/7/2014 5:44:03 AM | 7/7/2014 5:44:03 AM | USERS | TEMP | 7/7/2014 5:44:03 AM | DEFAULT | DEFAULT_CONSUMER_GROUP | | 11G | N | PASSWORD | N | YES | | Y |
- [oracle@station90 ~]$ netstat -lntp | grep :8888
- (Not all processes could be identified, non-owned process info
- will not be shown, you would have to be root to see it all.)
复制代码- BEGIN
- DBMS_XDB.SETHTTPPORT(8888);
- END;
复制代码- [oracle@station90 ~]$ netstat -lntp | grep :8888
- (Not all processes could be identified, non-owned process info
- will not be shown, you would have to be root to see it all.)
- tcp 0 0 :::8888 :::* LISTEN 22259/tnslsnr
复制代码- SELECT DBMS_XDB.GETHTTPPORT() FROM DUAL;
复制代码- BEGIN
- DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('mypassword');
- END;
复制代码
远程这一头:
-客户机器安装client中的定制---scheduleragent组件(一般填客户机主机名,端口1500)
->
->
->
客户机需要用schagent -registerdatabase 192.168.0.90 8888
- [oracle@station86 bin]$ ./schagent -registerdatabase 192.168.0.90 8888
- Agent Registration Password ? ***********
- Oracle Scheduler Agent Registration for 12.1 Agent
- Agent Registration Successful!
复制代码- [oracle@station86 bin]$ ./schagent -start
- Scheduler agent started
复制代码 在12c这一头:
--服务器验证:
- DECLARE
- versionnum VARCHAR2(30);
- BEGIN
- versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('station86');
- DBMS_OUTPUT.PUT_LINE(versionnum);
- END;
复制代码 12.1.0.1.1
- select * from dba_scheduler_external_dests;
复制代码 | OWNER | DESTINATION_NAME | HOSTNAME | PORT | IP_ADDRESS | ENABLED | COMMENTS | 1 | SYS | STATION86 | station86.example.com | 1025 | 192.168.0.86 | TRUE | Registered on 04-AUG-18 05.08.44.539215 PM PRC |
- grant all on station86 to hr;
复制代码
- BEGIN
- sys.dbms_scheduler.create_job(
- job_name => '"HR"."JOB11"',
- job_type => 'EXECUTABLE',
- job_action => '/home/oracle/helloworld.sh',
- repeat_interval => 'FREQ=SECONDLY;INTERVAL=30',
- start_date => systimestamp at time zone 'Asia/Shanghai',
- end_date => to_timestamp_tz('2018-08-04 17:30:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
- job_class => '"DEFAULT_JOB_CLASS"',
- comments => 'job11',
- auto_drop => TRUE,
- enabled => FALSE);
- DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB11"', attribute => 'destination', value => 'station86' );
- DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB11"', attribute => 'credential_name', value => '"SYS"."CREDENTIAL1"' );
- sys.dbms_scheduler.enable( '"HR"."JOB11"' );
- 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。
|
-
|