Bo's Oracle Station

查看: 1879|回复: 0

课程第43/44次(2017-10-14星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-10-14 10:50:06 | 显示全部楼层 |阅读模式
cloud control安装完的端口总结:
Screenshot.png

job1准备:
  1. select   * from v$version;
  2. select * from dba_sys_privs sp where sp.GRANTEE='HR';
  3. grant create job to hr;
  4. select * from dba_sys_privs sp where sp.GRANTEE='HR';
  5. alter user hr identified by oracle_4U account unlock;
复制代码

job1的program1:
Screenshot.png

job1的schedule1:
Screenshot-1.png

job1的状态:
Screenshot-2.png

job2是一个操作系统的外部作业:

job2的准备:
  1. grant create external job to hr;
  2. select * from dba_sys_privs sp where sp.GRANTEE='HR';
  3. select  * from dba_scheduler_credentials;
  4. begin
  5. dbms_scheduler.create_credential('CRED1','oracle','oracle');
  6. end;
  7. select  * from dba_scheduler_credentials;
  8. select  * from dba_tab_privs tp where tp.GRANTEE='HR';
  9. grant execute on sys.cred1 to hr;
  10. select  * from dba_tab_privs tp where tp.GRANTEE='HR';
复制代码
shell程序文本:
  1. #!/bin/sh

  2. export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2
  3. export ORACLE_SID=orcl
  4. export ORACLE_BASE=/u01/app/oracle

  5. /u01/app/oracle/product/12.1.0/dbhome_2/bin/sqlplus /nolog >> /home/oracle/job2a.log <<EOF
  6. conn hr/oracle_4U
  7. alter session set nls_date_format='yyyy-mm-dd:hh24:mi:ss';
  8. select  sysdate from dual;
  9. exit
  10. EOF

  11. date +%Y%m%d-%H%M%S >> /home/oracle/job2b.log
复制代码
Screenshot-3.png

Screenshot-4.png

Screenshot-5.png


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-26 13:02 , Processed in 0.035127 second(s), 27 queries .

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