Monday, October 7, 2013

How to create sample schema sales history for oracle by example ?

I am trying to install sales history sample schema for obe oracle by example tutorials to follow.

To install sample schema ( sales history only) use below command.

@?\demo\schema\sales_history\sh_main.SQL TRPASS123 EXAMPLE TEMP TRPASS123

'F:\app\Admin\product\11.1.0\db_2\demo\schema\sales_history\' 'F:\app\Admin\product\11.1.0\db_2\demo\schema\log\' v3


The first argument is sh_main.sql which is the file name which calls other scripts to create, populate the schema.

however while running the same script i was getting the error as below

SQL*Loader-00522 lfiopn failed for file (string)

Cause: LFI failed to open the file.

Action: Check for any possible operating system errors and/or potential memory problems.

the cause of the problem was oracle home was not set and i was issuing the command as

@?\demo\schema\sales_history\lsh_v3.sql TRPASS123 \app\Admin\oradata\orcl\ $ORACLE_HOME\demo\schema\log\ V3

To set the oracle home I use the below command and also inspected regedit entries like hkey local machine etc.

SET ORACLE_HOME=F:\app\Admin\product\11.1.0\db_1 at the command prompt

However before creating the sample schema the prerequisite is to create example tablespace

so use the below command to create the tablespace.


CREATE TABLESPACE example
 NOLOGGING
 DATAFILE '\app\Admin\oradata\orcl\EXAMPLE'
 SIZE 150M REUSE
AUTOEXTEND ON NEXT 640k
 MAXSIZE UNLIMITED
 EXTENT MANAGEMENT LOCAL
 SEGMENT SPACE MANAGEMENT AUTO;


and then only run the script for creating the sample schema.

once example tablesapce is created use the below to create the sample schema.

@?\demo\schema\sales_history\sh_main.SQL TRPASS123 EXAMPLE TEMP TRPASS123

'F:\app\Admin\product\11.1.0\db_2\demo\schema\sales_history\' 'F:\app\Admin\product\11.1.0\db_2\demo\schema\log\' v3

to understand the arguments to sh_main .sql go through the script file and check what each argument means.

this will create the sample schema. you can use this schema to follow obe tutorials














Posted By: Azhar Mulla

How to create sample schema sales history for oracle by example ?

Share:

Post a Comment

Facebook
Blogger

No comments :

Post a Comment

Follow Us

About Us

Like Us

© BIDW All rights reserved | Theme Designed by Seo Blogger Templates