Presentation is loading. Please wait.

Presentation is loading. Please wait.

9 Copyright © 2004, Oracle. All rights reserved. Managing Data.

Similar presentations


Presentation on theme: "9 Copyright © 2004, Oracle. All rights reserved. Managing Data."— Presentation transcript:

1 9 Copyright © 2004, Oracle. All rights reserved. Managing Data

2 9-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Manipulate data through SQL Use Data Pump to export data Use Data Pump to import data Load data with SQL Loader

3 9-3 Copyright © 2004, Oracle. All rights reserved. Manipulating Data Through SQL SQL> INSERT INTO employees VALUES 2 (9999,'Bob','Builder','bob@abc.net',NULL,SYSDATE, 3 'IT_PROG',NULL,NULL,100,90); 1 row created. SQL> UPDATE employees SET SALARY=6000 2 WHERE EMPLOYEE_ID = 9999; 1 row updated. SQL> DELETE from employees 2 WHERE EMPLOYEE_ID = 9999; 1 row deleted.

4 9-4 Copyright © 2004, Oracle. All rights reserved. The INSERT Command Create one row at a time. Insert many rows from another table.

5 9-5 Copyright © 2004, Oracle. All rights reserved. The UPDATE Command Use to change zero or more rows of a table.

6 9-6 Copyright © 2004, Oracle. All rights reserved. The DELETE Command Use to remove zero or more rows from a table.

7 9-7 Copyright © 2004, Oracle. All rights reserved. The COMMIT and ROLLBACK Commands Used to finish a transaction. Commit: Makes the change permanent Rollback: Undoes the change

8 9-8 Copyright © 2004, Oracle. All rights reserved. Integrity Constraints and DML

9 9-9 Copyright © 2004, Oracle. All rights reserved. Data Pump Export

10 9-10 Copyright © 2004, Oracle. All rights reserved. Data Pump Export Full Notes Page

11 9-11 Copyright © 2004, Oracle. All rights reserved. Data Pump Import

12 9-12 Copyright © 2004, Oracle. All rights reserved. Data Pump Import Full Notes Page

13 9-13 Copyright © 2004, Oracle. All rights reserved. DIRECTORY Objects SQL> CREATE DIRECTORY dpump_dir1 2 AS '/usr/apps/datafiles'; Directory created. SQL> SELECT * FROM DBA_DIRECTORIES 2 WHERE DIRECTORY_NAME = 'DPUMP_DIR1'; OWNER DIRECTORY_NAME DIRECTORY_PATH ------- --------------- -------------------- SYS DPUMP_DIR1 /usr/apps/datafiles

14 9-14 Copyright © 2004, Oracle. All rights reserved. SQL*Loader Input data files Control File SQL*Loader Log file Bad files Discard files Tables and indexes

15 9-15 Copyright © 2004, Oracle. All rights reserved. SQL*Loader Full Notes Page

16 9-16 Copyright © 2004, Oracle. All rights reserved. The SQL*Loader Control File The loader control file tells SQL*Loader: Where to find the load data The data format Configuration details: –Memory management –Record rejection –Interrupted load handling details How to manipulate the data

17 9-17 Copyright © 2004, Oracle. All rights reserved. The SQL*Loader Control File Full Notes Page

18 9-18 Copyright © 2004, Oracle. All rights reserved. The SQL*Loader Control File Full Notes Page

19 9-19 Copyright © 2004, Oracle. All rights reserved. Control File Syntax Considerations The syntax is free-format. Syntax is not case sensitive. Comments extend from the two hyphens (--) that mark the beginning of the comment to the end of the line. The CONSTANT keyword is reserved.

20 9-20 Copyright © 2004, Oracle. All rights reserved. Input Data and Data Files SQL*Loader reads data from one or more files specified in the control file. From SQL*Loader’s perspective, the data in the data file is organized as records. A data file can be in one of three formats: –Fixed-record format –Variable-record format –Stream-record format

21 9-21 Copyright © 2004, Oracle. All rights reserved. Input Data and Data Files Full Notes Page

22 9-22 Copyright © 2004, Oracle. All rights reserved. Input Data and Data Files Full Notes Page

23 9-23 Copyright © 2004, Oracle. All rights reserved. Loading Methods Conventional Direct path Array insert Block writes Table SGA High-water mark

24 9-24 Copyright © 2004, Oracle. All rights reserved. Loading Methods Full Notes Page

25 9-25 Copyright © 2004, Oracle. All rights reserved. Comparing Direct and Conventional Path Loads Conventional Load Uses COMMIT to make changes permanent Redo entries always generated Enforces all constraints INSERT triggers fire Can load into clustered tables Other users can make changes to tables Direct Path Load Uses data saves Generates redo only under specific conditions Enforces only PRIMARY KEY, UNIQUE, and NOT NULL INSERT triggers do not fire Cannot load into clustered tables Other users cannot make changes to tables

26 9-26 Copyright © 2004, Oracle. All rights reserved. Comparing Direct and Conventional Path Loads - Full Notes Page

27 9-27 Copyright © 2004, Oracle. All rights reserved. Loading Data with SQL*Loader

28 9-28 Copyright © 2004, Oracle. All rights reserved. Loading Data with SQL*Loader Full Notes Page

29 9-29 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Manipulate data through SQL Use Data Pump to export data Use Data Pump to import data Load data with SQL Loader

30 9-30 Copyright © 2004, Oracle. All rights reserved. Practice 9: Using Data Pump Export and Import This practice covers the following: Creating a directory object Extracting the HR schema objects Using Data Pump import to load tables into a different schema

31 9-31 Copyright © 2004, Oracle. All rights reserved. Practice 9 – Using Data Pump Export and Import - Full Notes Page

32 9-32 Copyright © 2004, Oracle. All rights reserved.


Download ppt "9 Copyright © 2004, Oracle. All rights reserved. Managing Data."

Similar presentations


Ads by Google