Posts

Showing posts from December, 2017

SQL Loader: loading data from Fixed Length files into Oracle database

SQL-Loader to load fixed length files: ------------------------------------------------------------------------ Step1: ----------- create a text file and convert it into .dat file and copy it to the required directory. [oracle@pavanorcl101 sqlloader]$ ls customerfix.dat 01 pavan   bhimavaram 02 harish  vijayawada 03 patty   guntur 04 bhanu   vijayawada 05 thrilok pulivendhula    First Open the file in a text editor and count the length of fields, for example in our fixed length file, id number is from 1st position to 2nd position, name is from 4th position to 10th position, City is from 12th position to 23rd position. Step2: ----------- Creating table with name customer with columns id, name and city which is required to load the data from .dat file [oracle@pavanorcl101 sqlloader]$ sqlplus scott/tiger SQL> create table customerfix (id number(5), name varchar(50), city varchar(30)); Table created Step3: ----------- Creating control file in which action

SQL-Loader

SQL Loader: ----------------- SQL LOADER utility is used to load data from other data source into Oracle. For example, if you have a table in ACCESS or SYBASE or any other third party database, you can use SQL Loader to load the data into Oracle Tables. SQL Loader will only read the data from Flat files. So If you want to load the data from Access or any other database, you have to first convert that data into Delimited Format flat file or Fixed length format flat file, and then use SQL loader to load the data into Oracle. Following is procedure to load the data from Third Party Database into Oracle using SQL Loader. Convert the Data into Flat file using third party database command. Create the Table Structure in Oracle Database using appropriate datatypes Write a Control File, describing how to interpret the flat file and options to load the data. Execute SQL Loader utility specifying the control file in the command line argument Example: ---------------- Creating a dir

Creating services on standalone database

Creating Services in standalone database: -------------------------------------------------------------------------- SQL> exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'account_app',NETWORK_NAME=>'account_app.mydomain.com') PL/SQL procedure successfully completed. [oracle@pavanorcl101 admin]$ lsnrctl status LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 01-DEC-2017 15:25:05 Copyright (c) 1991, 2014, Oracle.  All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=pavanorcl101.mydomain.com)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias                     LISTENER Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production Start Date                01-DEC-2017 15:09:01 Uptime                    0 days 0 hr. 16 min. 4 sec Trace Level               off Security                  ON: Local OS Authentication SNMP                      OFF Listener Parameter File   /u01/app/or