
Last Updated (Tuesday, 30 November 1999 07:00) Monday, 12 January 2009 16:41
บาง ตารางที่ไม่มี primary key จะทำให้เกิดปัญหาข้อมูลซ้ำซ้อนได้ และ ถ้าจะทำ materialize view แบบ fast refresh ได้นั้น จำเป็นที่ตารางนั้น ต้องมี primary key
เราจึงต้องเขียน SQL หาตาราง ที่ไม่มี primary key ภายใต้ schema ที่เราต้องการ ( ในตัวอย่างนี้ คือ ตาราง ของ SCOTT ) โดยใช้ประโยชน์จาก data dictionary และ การ MINUS
เรา run SQL statement นี้ ด้วย user SYS หรือ SYSTEM
select TABLE_NAME
from DBA_TABLES
WHERE OWNER='SCOTT'
MINUS
select TABLE_NAME
from DBA_CONSTRAINTS
where owner='SCOTT' and CONSTRAINT_TYPE='P' ;
oracle database table oracle database data using pl/sql index oracle tutorial password oracle thailand oracle training thailand database administrator oracle thai oracle dba oracle training oracle consulting oracle consultance thai oracle consultance oracle consulting thailand mysql tuning indexes statistics join column migration rman tables production


