tailieunhanh - OCA /OCP Oracle Database 11g A ll-in-One Exam Guide- P78

OCA /OCP Oracle Database 11g A ll-in-One Exam Guide- P78:There is an ever increasing demand for staff with IT industry certification. The benefits to employers are significant—they can be certain that staff have a certain level of competence—and the benefits to the individuals, in terms of demand for their services, are equally great. Many employers are now requiring technical staff to have certifications, and many IT purchasers will not buy from firms that do not have certified staff. | OCA OCP Oracle Database 11g All-in-One Exam Guide 726 In the example that follows there are two tables EMP and DEPT. There is a foreign key relationship between them stating that every employee in EMP must be a member of a department in DEPT. First insert a new department and an employee in that department and note the time SQL insert into dept values 50 SUPPORT LONDON 1 row created. SQL insert into emp values 8000 WATSON ANALYST 7566 27-DEC-08 3000 null 50 1 row created. SQL commit Commit complete. SQL select sysdate from dual SYSDATE 27-12-08 18 30 11 Next delete the department and the employee taking care to delete the employee first to avoid a constraint violation SQL delete from emp where empno 8000 1 row deleted. SQL delete from dept where deptno 50 1 row deleted. SQL commit Commit complete. Now attempt to flash back the tables to the time when the department and employee existed SQL flashback table emp to timestamp to_timestamp 27-12-08 18 30 11 dd-mm-yy hh24 mi ss flashback table emp to timestamp to_timestamp 27-12-08 18 30 11 dd-mm-yy hh24 mi ss ERROR at line 1 ORA-08189 cannot flashback the table because row movement is not enabled This fails because by default row movement which is a prerequisite for table flashback is not enabled for any table so enable it for both tables SQL alter table dept enable row movement Table altered. SQL alter table emp enable row movement Table altered. and now try the flashback again SQL flashback table emp to timestamp to_timestamp 27-12-08 18 30 11 dd-mm-yy hh24 mi ss flashback table emp to timestamp to_timestamp 27-12-08 18 30 11 dd-mm-yy hh24 mi ss Chapter 19 Flashback 727 ERROR at line 1 ORA-02091 transaction rolled back ORA-02291 integrity constraint violated -parent key not found This time the flashback fails for a more subtle reason. The flashback is attempting to reverse the deletion of employee 8000 by inserting him but employee 8000 was in department 50 which has been deleted and so does not exist.

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.