Menu

Reference - Using sql loader

jan ripke

Reference - Using sql loader.

The sql loader functionality of NoOra can be used, when loading of large data files is required.
In stead of sqlplus, sqlldr is used.

This feature is avaiable from NoOra version 0.0.8 and higher.

To use the sql loader functionality in NoOra consider the following:


add 'ctl' as an excluded extension in your 'project.conf'

EXCLUDED_EXTENSIONS=[......,'ctl']

create a sqlldr folder in your schema folder

I assume that that database project ''my_project_db'' is used.

> cd my_project_db
> cd apps
> mkdir sqlldr

create a ctl folder

this folder contains 1 control file, with the name of the control folder and the extension ctl.
I assume that the control folder ''example'' is used.

> cd sqlldr
> mkdir example

create the datafiles

I assume the datafile file ''example_data.txt'' is used.
The following folder structure is excepted.

my-project-db
|-- project.conf
`-- create
    |-- apps
    |   `-- dat
    |   `-- ddl
    |   `-- sqlldr
    |       `-- example
    |           `-- example.ctl
    |           `-- example_data.txt

Now we can recreate the database project.
The following parameters are expected:
* -s, the oracle sid of the database to install the project in.

I assume that that database project ''my_project_db'' is used.
Change into that directory.

> cd my_project_db

On your command line, perform the following:

> noora.py recreate -s=orcl

The command line will print out various actions, the following is shown.

dropping scheme 'apps' in database 'orcl'
apps:/plugins/static/drop/scm/drop_schemas.sql
apps:/plugins/static/drop/vw/drop_views.sql
apps:/plugins/static/drop/syn/drop_synonyms.sql
apps:/plugins/static/drop/trg/drop_triggers.sql
apps:/plugins/static/drop/typ/drop_types.sql
apps:/plugins/static/drop/tab/drop_tables.sql
apps:/plugins/static/drop/prc/drop_procedures.sql
apps:/plugins/static/drop/fct/drop_functions.sql
apps:/plugins/static/drop/pkg/drop_packages.sql
apps:/plugins/static/drop/jar/drop_jars.sql
apps:/plugins/static/drop/seq/drop_sequences.sql
apps:/plugins/static/drop/idx/drop_indexes.sql
apps:/plugins/static/drop/dbl/drop_database_links.sql
scheme 'apps' dropped.
creating scheme 'apps' in database 'orcl' using environment 'dev'
/create/apps/ddl/lib/app_prop_1.0.0.zip
/create/apps/dat/version.sql
/create/apps/dat/dev/environment.sql
/create/apps/sqlldr/example/example_data.txt
scheme 'apps' created.
scheme 'apps' compiled.

What did I just do?

You configured NoOra for using sqlldr and executed the NoOra plugin recreate. The recreate plugin recreated the project in the database. The scripts contained in the create tree of the project were executed.


Related

Wiki: Reference Guide

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.