Guideline for APS Oracle user

Download as pdf : 
Products: Aspen Petroleum Scheduler 
Last Updated: 06-May-2020
Versions: 
Article ID: 000062200
Primary Subject: 
Problem statement 
Based on experience managing Oracle issues R&D prepared the guideline for APS users with Oracle databases

Solution
1. Setup an empty model.
a. Open Command window. Log on SQLPlus via system dba
e.g.
sqlplus system/PWD@Service as sysdba 
b. Create a new user via below script. Change UID and PWD, and paste script to SQLPlus, and press Enter key (NOTE: It is better to make the name of UID and PWD are all upper case, e.g. TESTUSER1. 
The name mix with lower case letter may cause case sensitive issue.)

CREATE USER UID IDENTIFIED BY PWD;
GRANT CONNECT,RESOURCE TO UID;
GRANT DBA TO UID;
c. Typing commit; and press Enter key.
d. Exit the SQLPlus
e. Log on SQLPlus via the new create user
sqlplus UID/PWD@Service
f. Copy all text on Oracle_Create_Tables.sql which under Aspen Petroleum Scheduler folder. And paste to SQLPlus, press Enter key.
g. Typing commit; and press Enter key.
              The new Oracle APS empty model is created, then user might need use other tools to prepare the model data.
2. Create a database base from dmp file of other database.
a. Log on SQLPlus via system dba
b. Create a new user via below script. Change UID and PWD, and paste script to SQLPlus, and press Enter key
CREATE USER UID IDENTIFIED BY PWD;
GRANT CONNECT,RESOURCE TO UID;
GRANT DBA TO UID;
c. Typing commit; and press Enter key.
d. Exit the SQLPlus
e. Create a new server on Oracle Net Assistant 
f. IMP the dmp file to the new created user.
imp newuser/password@service  file=the full path of dmp file fromuser=user of old database of dmp file touser=newuser ignore=Y
3. Import Assay function doesn’t work or EIU failed to import data
a. Check sqlldr is installed on the machine which run APS. 
Go to command window, enter sqlldr, and press Enter key. There will be message box if sqlldris not installed. 
User-added image
If it is not installed, install sqlldrfirst.( sqlldr is used to import batch data to DB on EIU and Import Assay dialog on APS)
Make sure select Administrator install type when you install oracle client.
b. Make sure user has privilege to access sqlldr. 
If the user has limit to access Command window, so sqlldr can’t be used either. In this case, EIU and Import Assay dialog doesn’t work as expected. 
c. Manually trace the sqlldr import issue.
Go to working folder, there is a subfolder name “Temp”
Please check whether has any file which the extension name “.bad”
• If yes, it means the data was import failed. Open it via notepad, we can see which data wasn’t imported and the reason.
• Here is a sample how to import via sqlldr manually.
e.g. Import data to  ORION_MGR_ASSAY_IMPORT_CRUDE table.
(1). create a text file with name ORION_MGR_ASSAY_IMPORT_CRUDE.txt
(2). Enter the Name column in each line.
User-added image
(3). Create a control file which control.ctl
User-added image
(4). Execute the SQLLDR command.
                sqlldr uid/pwd@service control=the path of control.ctl
                e.g. sqlldr DEMO/DEMO@PSC1 control='F:\APS_Working\Temp\control.ctl'
User-added image
If the data is imported successfully, then check the data on table is correct or not.
            If the data is imported failed, check the error from log.
4. DBUpdate
If after execute the update script and found the database still can’t be opened on APS, DBUpdate validate it still has error. Please check whether current Oracle user has privilege to other database Schema on the same oracle server.
5. Foreign Language setting
Please refer to KB for ORACLE NLS_LANG setting which relate to CQ00767558.