Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI

Slides:



Advertisements
Similar presentations
Data Definition Language (DDL)
Advertisements

Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Database System Concepts and Architecture
18 Copyright © Oracle Corporation, All rights reserved. Transporting Data Between Databases.
CHAPTER 13 Data Pump. Tool that replaces legacy exp/imp utilities Data Pump is a scalable, feature-rich utility that allows you to extract objects and.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 8 Application Data Auditing.
Loading & organising data. Objectives Loading data using direct-load insert Loading data into oracle tables using SQL*Loader conventional and direct paths.
18 Copyright © 2005, Oracle. All rights reserved. Moving Data.
18 Copyright © 2005, Oracle. All rights reserved. Moving Data.
17 Copyright © 2007, Oracle. All rights reserved. Moving Data.
DataMigrator 7.7 in Real Time
The New Data Pump Caleb Small Next generation Import / Export New features Better performance Improved security Versatile interfaces.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 12 System and Object Privileges.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
MI807: Database Systems for Managers Introduction –Course Goals & Schedule –Logistics –Syllabus Review Relational DBMS Basics –RDBMS Role in Applications.
System Administration Accounts privileges, users and roles
Backup The flip side of recovery. Types of Failures Transaction failure –Transaction must be aborted System failure –Hardware or software problem resulting.
Harvard University Oracle Database Administration Session 2 System Level.
Database objects User schema DCL Oracle dictionary.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
MD807: Relational Database Management Systems Introduction –Course Goals & Schedule –Logistics –Syllabus Review RDBMS Basics –RDBMS Role in Applications.
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Data Pump in Oracle Database 10 g : Foundation for Ultra-High Speed Data Movement Utilities Session id: George H. Claborn Data Pump Technical Project.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
ORACLE Using ORACLE 8 SQL using ORACLE 8 PL/SQL using ORACLE 8.
Oracle Database Administration
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Module 3: Table Selection
Oracle for Software Developers. What is a relational database? Data is represented as a set of two- dimensional tables. (rows and columns) One or more.
Workflow Manager and General Tuning Tips. Topics to discuss… Working with Workflows Working with Tasks General Tuning Tips.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Chapter 6 Additional Database Objects
Week 6 Lecture 2 System and Object Privileges. Learning Objectives  Identify and manage system and object privileges  Grant and revoke privileges to.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
Siebel 8.0 Module 5: EIM Processing Integrating Siebel Applications.
Oracle Data Integrator Procedures, Advanced Workflows.
A Brief Documentation.  Provides basic information about connection, server, and client.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
Siebel 8.0 Module 2: Overview of EIM Processing Integrating Siebel Applications.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Controlling User Access Fresher Learning Program January, 2012.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
SQL LOADER. SQL*Loader (sqlldr ) is the utility to use for high performance data loads. The data can be loaded from any text file and inserted into the.
Indexes- What?  Optional structures associated with tables  Provides a quick access path to table data  You can create indexes on one or more columns.
Hyperion Artifact Life Cycle Management Agenda  Overview  Demo  Tips & Tricks  Takeaways  Queries.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
1 Chapters 21, 22, 23, 37  Ch. 21: SQL*Loader  Ch. 22: Database Links, Oracle Net  Ch. 23: Materialized Views (aka Snapshots)  Ch. 37: Data Dictionary.
 CONACT UC:  Magnific training   
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
11 Copyright © 2004, Oracle. All rights reserved. Performing a Migration Using Oracle Migration Workbench (Part II)
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Databases and DBMSs Todd S. Bacastow January 2005.
Controlling User Access
Managing, Storing, and Executing DTS Packages
Database System Concepts and Architecture
Using Data Dictionary and Dynamic Performance Views
Chapter 4 Relational Databases
Managing Objects with Data Dictionary Views
Managing Objects with Data Dictionary Views
UTILITY TO EXPORT/IMPORT DATA Gary M. Noble LDS Church
Presentation transcript:

Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI SQL Utilities

Dale Roberts 2 SQL Utilities 1. SQL*Loader 2. Data Pump Export and Import 3. Accessing Remote Data (Database Links, Oracle Net) 4. Materialized Views (aka Snapshots) 5. Data Dictionary Views

Dale Roberts 3 SQL*Loader – Bulk Load SQL*Loader, executed as sqlldr, loads data from external files into tables in Oracle. Very common utility used to process external input interfaces from other applications. Uses a control file to describe the input data files. Control file is flexible and supports the following features: Variable and fixed length record formats Many-to-one physical to logical records One-to-many physical to logical records Data transformations NULLIF Functions – UPPER(:Authorname) Expressions - :taxamount / 100 Formatting – DATE(:birthdate, ‘MM-DD-YYYY’) Default column values – SYSDATE Row selection - WHEN Batch and interactive interfaces Supports partial loads set error and discard tolerance levels

Dale Roberts SQL*Loader Architecture SQL*Loader runs locally on the client, therefore all files resides on the client except for the database tables. Input files contain data to be loaded. Control file contains instructions to sqlldr, including describing the input files. Log file contains a detailed summary of the load, including a description of any errors that occurred. Can set max allowed. Discard file contains rows that are filtered out by the control file and did not make it to the database. Can set max allowed. 4

Dale Roberts 5 SQL*Loader Control File Examples Variable-length field control file Fixed-length field control file

Dale Roberts Data Pump Overview Oracle Data Pump technology enables very high-speed movement of data and metadata from one database to another. Data Pump Export is a utility for unloading data and metadata into a set of operating system files called a dump file set. The dump file set can be moved to another system and loaded by the Data Pump Import utility. Data Pump Import is a utility for loading an export dump file set into a target system. The dump file set is made up of one or more disk files that contain table data, database object metadata, and control information. The files are written in a proprietary, binary format. 6

Dale Roberts 7 Data Pump Export Operation Network Export File(s) expdp.exe Oracle Database

Dale Roberts Types of Exports TableSchemaTablespaceDatabase Transportable Tablespace INCLUDE / EXCLUDE object filters QUERY and SAMPLE data filters CONTENTS = data | metadata | both

Dale Roberts Directory Objects Created as a database object Requires CREATE_ANY_DIRECTORY privilege Permissions (read, write) granted on the object to specific user(s) Not validated – existence, syntax, OS privilege Accessed as user “oracle” at the OS level Default DATA_PUMP_DIR maps to …

Dale Roberts Data Punp Interactive Mode NOT the same as old imp/exp! Default starts schema mode export Use command line arguments or par file “logging” vs “interactive command” mode Default logging mode logs to terminal Ctrl-C to enter interactive command mode Job will continue to run even if client disconnects! expdp parfile=myjob.par expdp parfile=myjob.par

Dale Roberts Interactive Mode Commands STATUS Status of current job CONTINUE_CLIENT Resume “logging” mode EXIT_CLIENT Exit client, leave job running STOP_JOB Stop current job, do not delete START_JOB Re-start current job KILL_JOB Delete current job PARALLEL Add/remove worker processes ADD_FILE Add dump file during export HELP Get help

Dale Roberts Data Pump SQL File Import can generate an SQL file instead of actually performing the import using SQLFILE parameter Contains DDL that would have been executed based on job parameters Passwords excluded No change to target DB Does not include DML for data. (i.e. no inserts)

Dale Roberts 13 Database Links Database links allow you to access data in another Oracle database. Requires that Oracle Net (aka Oracle SQL*Net or Net8) be running on both database servers. Links specify: Protocol (eg. TCP/IP) Host name of remote server. Database name on the remote server The database account and password to access the data. Database links expressed sign:

Dale Roberts 14 Database Links Create Database Link syntax: CREATE DATABASE LINK MYLINK CONNECT TO DALE IDENTIFIED BY PASSWORD USING ‘FIREBIRD’; Using a database link: SELECT COUNT(*) FROM Using a synonym with a database link (location independence): CREATE SYNONYM MYTABLE FOR SELECT COUNT(*) FROM MYTABLE; “Dynamic” links using SQL*Plus’s copy command: COPY FROM CREATE NEWTABLECOPY USING SELECT * FROM MYTABLE;

Dale Roberts 15 Oracle Net  Oracle Net is Oracle’s networking software. Formerly called SQL*Net (7.x) and Net8 (8.0.x and 8i).  Oracle Net’s local configuration files are sqlnet.ora and tnsnames.ora. These are located in $ORACLE_HOME\network\admin.  Example tnsnames.ora entries below. LOCAL = (DESCRIPTION = (SOURCE_ROUTE = OFF) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = DALE)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORACLE) ) FIREBIRD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = firebird.cs.iupui.edu)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = cs10gorc.cs.iupui.edu) )

Dale Roberts 16 Materialized Views  Materialized Views (formerly called Snapshots) pre-aggregate data, index the data, and therefore improve query performance. Oracle creates a table that holds the data that otherwise might be accessed from queries/views.  Materialized views are commonly used in reporting applications. Why materialized views instead of views? Classic space vs time trade-off.  When you create a materialized view, you must specify: The query the materialized view is based on. The refresh schedule. How the update is performed (update vs. complete refresh) The key type (rowid vs. primary key)

Dale Roberts 17 Data Dictionary - Metadata  Oracle’s Data Dictionary views stores all the information about what is stored in the database.  Three types of data dictionary views: DBA_% views are only available to DBAs (granted DBA role). ALL_% views show all objects the user has privileges on. USER_% views show only objects in your schema.  The Road Map views “meta metadata data”: DICT and DICT_COLUMNS DICTIONARY (DICT) – describes other dictionary views DICT_COLUMNS – describes columns of DICT views  Data Dictionary views can be found in the SYS tablespace but have public synonyms so no schema owner is necessary.  Access to production source code: Viewing production source code requires compilation privilege, which is not normally allowed in production. Granting select access to DBA_SOURCE is one workaround.

Dale Roberts 18 Data Dictionary  Important Data Dictionary views: USER_TABLES (TABS) – tables USER_TAB_COLUMNS (COLS) – columns of tables USER_VIEWS – views USER_SYNONYMS (SYN) – synonyms USER_SEQUENCES (SEQ) – sequences USER_CONSTRAINTS – constraints USER_CONS_COLUMNS – columns of the constraints USER_INDEXES (IND) – indexes USER_IND_COLUMNS – columns of indexes

Dale Roberts 19 Acknowledgements Loney, Oracle Database 10g The Complete Reference Calgary Oracle User‘s Group,