DBlink建立方法如下:create database link资料库链结名connect to 用户名 identified by 密码 using ‘资料库连接字串’; 资料库参数global_name=true时要求资料库链结名称跟远端资料库名称一样 资料库全局名称可以用以下命令查出 select * from global_name;首先你建立好DBlink,然后写个procedure,然后通过job定时执行procedure就可以了
谢谢大家 我在C2上建了用户与link 如下: -- Create the user create user tuser identified by tuser default tablespace SYSTEM temporary tablespace SYSTEM profile DEFAULT; --给用户 tuser权限 -- Grant/Revoke object privileges GRANT select ON system.t_wilcom_log TO tuser; -- Grant/Revoke role privileges grant connect to tuser with admin option; --Create link server LINKDB create public database link LINKDB.US.ORACLE.COM connect to tuser identified by tuser using 'wilcom8I';我现在访问出现问题 select * from [email protected];错误提示: 无法处理服务名 请问如何解决?
sys.dbms_job.submit(job => :job,
what => 'drop table b@c2; create table b@c2
as select * from a; truncate table a;',
next_date => to_date('16-12-2005 10:48:14', 'dd-mm-yyyy hh24:mi:ss'),
interval => '24 * 60 * 60');
commit;
end;
/--注意c2作为数据连接具有的操作权限
sys.dbms_job.submit(job => :job,
what => 'begin
insert /*+append nologging*/ into b
select * from A@dblinkname ;
delete from a@dblinkname;
commit;
end;',
next_date => to_date('16-12-2005 01:00:00', 'dd-mm-yyyy hh24:mi:ss'),
interval => 'sysdate+1');
commit;
end;
资料库参数global_name=true时要求资料库链结名称跟远端资料库名称一样
资料库全局名称可以用以下命令查出
select * from global_name;首先你建立好DBlink,然后写个procedure,然后通过job定时执行procedure就可以了
我在C2上建了用户与link 如下:
-- Create the user
create user tuser
identified by tuser
default tablespace SYSTEM
temporary tablespace SYSTEM
profile DEFAULT;
--给用户 tuser权限
-- Grant/Revoke object privileges
GRANT select ON system.t_wilcom_log TO tuser;
-- Grant/Revoke role privileges
grant connect to tuser with admin option;
--Create link server LINKDB
create public database link LINKDB.US.ORACLE.COM
connect to tuser identified by tuser using 'wilcom8I';我现在访问出现问题
select * from [email protected];错误提示:
无法处理服务名 请问如何解决?