Chinaunix首页 | 论坛 | 博客
  • 博客访问: 980808
  • 博文数量: 358
  • 博客积分: 8185
  • 博客等级: 中将
  • 技术积分: 3751
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:27
个人简介

The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.

文章分类

全部博文(358)

文章存档

2012年(8)

2011年(18)

2010年(50)

2009年(218)

2008年(64)

我的朋友

分类: Oracle

2010-03-15 17:10:14

--プロシージャを新規する
create or replace procedure createTblG202T
Authid Current_User
as
  tabname varchar(200);
begin
  select 'G202T_' || to_char(sysdate, 'yyyymmdd') into tabname from dual;
  execute immediate 'create table ' || tabname ||' tablespace gau12d as select * from ;
  commit;
end;
/
--実行テスト
begin
 createTblG202T;
end;
--Create new Job
VARIABLE jobno number;
begin
dbms_job.submit(JOB=>:jobno,
            WHAT=>'createTblG202T;',
            NEXT_DATE=>SYSDATE+5/60/24,
            INTERVAL=>'TRUNC(SYSDATE+1)+18/24'
            );
commit;
end;
/
--显示地赋予权限:
grant create table to dev;
--手动执行JOB测试
BEGIN
  DBMS_JOB.RUN(23);
END;
--查看JOB信息
select * from user_jobs;
select * from dba_jobs;
select * from dba_jobs_running

手順:
--Oracle通过job定时创建表

--Managing Job Queues
 
問題纏め:

You might review all those database objects you are trying to access from that procedure in the job.
Sometimes, Oracle expects you to grant explicit privileges on database objects rather than through roles.
So try granting explicit select/update/delete (or whatever) privileges and rerun the job
 
--job prucedure ORA-01031: 权限不足 错误诊断
http://blog.csdn.net/liuya1985liuya/archive/2008/11/12/3285476.aspx
--ORA-12012+ORA-01031

阅读(1827) | 评论(0) | 转发(0) |
0

上一篇:Linux下架设Mail服务器

下一篇:Linux Qmail

给主人留下些什么吧!~~