12.07.2015 Views

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>Soluti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>Guide</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> <str<strong>on</strong>g>Migrating</str<strong>on</strong>g> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>on</strong> <strong>UNIX</strong> <strong>to</strong> <strong>SQL</strong> <strong>Server</strong> <strong>on</strong> Windows 141Note The DEPT view was added <strong>to</strong> the HR schema <strong>to</strong> dem<strong>on</strong>strate this point.The EMP_DETAILS_VIEW can be created under the HR schema using thefollowing command:CREATE VIEW hr.EMP_DETAILS_VIEW ASSELECTe.employee_id,e.job_id,e.manager_id,e.department_id,d.locati<strong>on</strong>_id,l.country_id,e. first_name,e.last_name,e.salary,e.commissi<strong>on</strong>_pct,d.department_name,j.job_title,l.city,l.state_province,c.country_name,r.regi<strong>on</strong>_nameFROM hr.employees e INNER JOIN hr.departments dON e.department_id = d.department_idINNER JOIN hr.locati<strong>on</strong>s lON d.locati<strong>on</strong>_id = l.locati<strong>on</strong>_idINNER JOIN hr.countries cON l.country_id = c.country_idINNER JOIN hr.regi<strong>on</strong>s rON c.regi<strong>on</strong>_id = r.regi<strong>on</strong>_idINNER JOIN hr.jobs jON j.job_id = e.job_id;The WITH READ ONLY clause will have <strong>to</strong> be en<str<strong>on</strong>g>for</str<strong>on</strong>g>ced by ensuring <strong>on</strong>ly SELECTprivilege is given <strong>to</strong> users.9. Create functi<strong>on</strong>s, s<strong>to</strong>red procedures, and packages.The following command can be used <strong>to</strong> get a listing of all functi<strong>on</strong>s defined by theschema owner, HR:SELECT object_name, object_typeFROM dba_objectsWHERE owner = 'HR'AND object_type IN ('FUNCTION', 'PROCEDURE', 'PACKAGE', 'PACKAGE BODY')The output retuned is:OBJECT_NAME OBJECT_TYPEADD_JOB_HISTORY PROCEDURESECURE_DML PROCEDUREThe source code of each of these objects can be extracted from the data dicti<strong>on</strong>aryusing the command:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!