Oracle DBA & All IT » Database, DBA, Oracle, Oracle Tips » How to change an Oracle table owner ???
How to change an Oracle table owner ???
อิอิ.. วันนี้ขำนำมาก่อน ^^' เหตุเพราะหายไปนานเลยจากบทความล่าสุด ด้วยความที่ยุ่งๆ + กับไม่อยากให้บล็อกร้าง วันนี้เลยเอาเรื่องเบาๆ มาแบ่งปันกันจ้า
วันก่อนเปลี่ยนชื่อ Database วันนี้เอาแค่จิ๊บๆ เปลี่ยนแค่เจ้าของ Table พอแระ
วิธีที่จะเปลี่ยนให้เป็นเจ้าของแบบจริงจัง จะเป็นวิธีการ CTAS or Export / Import
มาลองดูตัวอย่างกัน:
CTAS ( Create Table As Select )
— การ create table ใหม่บน owner bill —
create table bill.employee as select * from hr.employee;
Export / Import
— ทำการ export ข้อมูลตามปกติ —
export file=emp.dmp log=emp.explog tables=hr.employee
— ทำการย้ายเจ้าของตอน Import —
imp file=emp.dmp log=imp_emp.log fromuser=hr touser=bill
เท่านี้เราก็จะได้เจ้าของ Table ใหม่สมใจแล้วเย่… แล้วพบกันพบความถัดไปจ้า
.. Preview : 3142
Filed under: Database, DBA, Oracle, Oracle Tips · Tags: change owner, change owner oracle, change owner table, create as select, create table, exp, export, How to change an Oracle table owner, imp, import