col current_scn for 999999999999999999
select current_scn from v$database;
expdp userid=system/oracle add114_ogg_bak.par
directory=dmpdir
tables=(add114.t_name_sequence )
filesize=10G
dumpfile=add114_ogg_bak_%U.dmp
logfile=add114_ogg_bak.log
content=all
同步表统计:
--查外键表NC56.CSCI有无对应的主键表
SELECT a.owner,
A.TABLE_NAME primary_table_name,
A.CONSTRAINT_NAME primary_table_key_name,
b.owner,
B.TABLE_NAME foreign_table_name,
B.CONSTRAINT_NAME foreign_table_foreign_key_name,
B.STATUS foreign_table_foreign_key_stat
FROM DBA_CONSTRAINTS A, DBA_CONSTRAINTS B
WHERE A.CONSTRAINT_NAME = B.R_CONSTRAINT_NAME
and B.CONSTRAINT_TYPE = 'R'
AND b.TABLE_NAME = 'EMP'
and a.owner = 'SCOTT'
and b.owner = 'SCOTT'
ORDER BY 1, 2, 3, 4;
--查主键表NC56.CBH有无对应的外键表
SELECT a.owner,
A.TABLE_NAME primary_table_name,
A.CONSTRAINT_NAME primary_table_key_name,
b.owner,
B.TABLE_NAME foreign_table,
B.CONSTRAINT_NAME foreign_table_foreign_key_name,
B.STATUS foreign_table_foreign_key_stat
FROM DBA_CONSTRAINTS A, DBA_CONSTRAINTS B
WHERE A.CONSTRAINT_NAME = B.R_CONSTRAINT_NAME
and B.CONSTRAINT_TYPE = 'R'
AND a.TABLE_NAME = 'EMP'
and a.owner = 'SCOTT'
and b.owner = 'SCOTT'
ORDER BY 1, 2, 3, 4;
==========================
====
select 'alter table '|| t.table_name||' disable constraint '||t.constraint_name||';'
from user_constraints t where t.constraint_type = 'R'
order by t.table_name
启用外键
[sql] view plain copy
select 'alter table '|| t.table_name ||' enable constraint '||t.constraint_name||';'
from user_constraints t where t.constraint_type = 'R'
order by t.table_name
==
grant connect,resource to add114;
grant create view to add114;
grant CREATE DATABASE LINK to ADD114;
grant CREATE SYNONYM to ADD114;
grant DEBUG CONNECT SESSION to ADD114;