Chinaunix首页 | 论坛 | 博客
  • 博客访问: 661427
  • 博文数量: 163
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1625
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-24 11:40
个人简介

资深Oracle数据库专家 OCM认证大师 10年数据库相关服务及开发经验 各类数据库相关方案的编写,管理及实施 数据中心数据库日常运维、大型项目割接、性能优化等方面有丰富的实战经验 客户包括: 电信,银行,保险,航空,国网,汽车,烟草等 想要一起学习探讨数据安全技术的请加qq群 256041954

文章分类

全部博文(163)

文章存档

2017年(2)

2016年(112)

2015年(38)

2014年(11)

我的朋友

分类: Oracle

2016-06-06 20:41:55

rem Before begin with replication, DBA should disable such Oracle objects as triggers, 
rem foreign key constraints, cascading deleting contraints, check constraints and so on 


set echo off
set verify off
set feedback off
set pagesize 10000
set heading off
set lines 100


spool disable_constraints1.sql


select 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name||';'
  from dba_constraints
    where constraint_type in ('R','C') and owner='SIHANGYUAN'
  order by status,owner;


spool off


spool disable_triggers.sql


select 'alter trigger '||owner||'.'||trigger_name||' disable;'
  from dba_triggers where owner in ('TIANJIN');
  order by status,owner;


spool off


spool denies_users.sql


select 'alter user '||USERNAME||' account lock;'
  from splex.dr_users;


spool off


spool disable_job.sql


select 'execute DBMS_IJOB.BROKEN('||job||',TRUE); commit;'
  from dba_jobs
  where priv_user<>'SYS' and priv_user<>'system' and priv_user<>'splex' and  priv_user IN ('TIANJIN');


13002486632  任成




truncate table splex2300.dr_constraints;


insert into splex2300.dr_constraints
SELECT 
  owner,
  constraint_name,
  constraint_type,
  table_name,
  status
FROM 
  dba_constraints
where constraint_type= 'R' 
and   owner in ('TIANJIN');


commit;


insert into splex2300.dr_constraints
SELECT 
  owner,
  constraint_name,
  constraint_type,
  table_name,
  status
FROM 
  dba_constraints
where constraint_type in ('R','C')
and  owner in ('SIHANGYUAN') and STATUS='ENABLED';


commit;


sanhangju


truncate table splex2300.dr_triggers;


insert into splex2300.dr_triggers 
SELECT 
  owner,
  table_owner,
  trigger_name,
  trigger_type,
  table_name,
  status
FROM 
  dba_triggers
where owner in ('SIHANGYUAN');


commit;


truncate table splex2300.dr_jobs;


insert into splex2300.dr_jobs
select job,log_user,priv_user,schema_user,next_date,broken
from dba_jobs
where priv_user IN ('SIHANGYUAN');


commit;
hbetc


truncate table splex2300.dr_users;


insert into splex2300.dr_users
select username,account_status
from dba_users
where username IN ('LIS');


commit;




spool off
阅读(2673) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~