dblink对比本地和远程表的记录数量是否一致
declarev_count1 int :=-1;v_count2 int :=-1;j int :=0;diff int :=0;beginfor i in (select tname from tab) loop j:=j+1; execute immediate 'select count(*) from ' || i.tname into v_count1; execute immediate 'select count(*) from ' || i.tname |...
dblink对比本地和远程表的记录数量是否一致
declarev_count1 int :=-1;v_count2 int :=-1;j int :=0;diff int :=0;beginfor i in (select tname from tab) loop j:=j+1; diff := v_count1 - v_count2; execute immediate 'select count(*) from ' || i.tname into v_count1; execute immediate 'select count(*) from...
健康检查项
检查项 说明 查找方法 数据库警告日志 1、检查警告日志中是否存在以下关键字: WARNING|fail|errs|ORA-|abort|corrupt|bad|not complete。 如果...
查询表空间的大小和使用率
查询表空间的大小和使用率注:用到的视图有 dba_data_file 和dba_free_space。------------------------ ‘SQL脚本’----------------------------------select a.tablespace_name,a.bytes/...
查询用户的系统权限和用户所拥有的角色
注:视图dba_sys_privs是用来查询用户系统权限的;视图dba_role_privs是用来查询用户角色的在sqlplus 环境中运行下列语句:define 1=‘关注的用户’set linesize 200select grantee, privilege from dba_sys_privs &nb...
DBA_2PC_PENDING中的分布式锁-解锁
运行shell脚本后,会生成 roll.sql文件。只需要运行roll.sql就会解除dba_2pc_pending 中的分布式锁。注意:根据情况决定shell脚本中是否需要where 条件,比如过滤status 是prepare的,还是其他的,还...