データベース作成

要件

Note that Sybase は現在ベータ版で、CompiereとSybaseに関する充分な知識がなければ、お勧めできないということにご注意ください。

環境設定

Oracle接続

まず最初に、Oracleインスタンスを作成して、SYSとSYSTEMのパスワードを定義します。

グローバルデータベース名またはデータベースのTNS名は、同じものを意味します。
tnsping <tns name>経由で、オペレーティングシステムレベル上でデータベースに接続できることをチェックします。

環境設定

フォルダ $COMPIERE_HOME/utils はサーバー操作に必要なスクリプトを含んでいます。

  1. スクリプト myEnvironment を確認します。
    • _HOME and JAVA_HOME の設定を確認します。
    • COMPIERE_DB_TNS (グローバルデータベース名)の値を確認します。
    • データベース設定を反映するために SYSTEM のパスワードを確認します。
    • 間違いがあれば、ここで変更をせず RUN_setupスクリプト経由で行います。
  2. RUN_Env を実行して、環境を再確認します。
    • 「compiere」ユーザーへの接続に失敗したら、 Control-C または exit を入力します。

Compiere データベースのインポート

Compiere.dmp の検証

ファイル Compiere.dmp は $COMPIERE_HOME/data に存在し、Compiereインストールのためのシードデータベースを含んでいます。

データベースインポートの実行

$COMPIERE_HOME/utils ディレクトリで、スクリプトRUN_ImportCompiereを実行します。
(イメージをクリックするとフルスクリーン表示します)

サーバー設定イメージ

インポートプログラムは、インポートシーケンスの問題のため、警告(IMP-00041:警告:コンパイル警告付きオブジェクト生成)を発します。これは正常なので無視して構いません。インポートプログラムの後に、SQL手続きがすべてが正しくインポートされているかを確認して、無効なオブジェクトをリスト表示します。

サーバー設定イメージ

これは最終的に表示される画面の様子です:選択された列(エラー)はありませんでした。

Sever Setup Image

最終的な環境チェック

$COMPIERE_HOME/utils ディレクトリでスクリプト RUN_Env を再度実行することができます。今回はエラーがあってはいけません。

Complete Server Installation

次のステップ

Please check 製品ステータス, 既知の問題, よくある問題 and オープン項目 as そして最新版の インストール手順を是非ご覧ください。間違いやエラーを見つけられた場合は、ぜひCompiereの改善のためにサポートリクエスト をお送り下さい!

スクリプトのバックグラウンド情報&タスク

インストールには、この情報は必要ありません。

サーバースクリプトは、 $COMPIERE_HOME/utils フォルダ内に存在しています(例: D\Compiere2\utils)。 RUN_* で始まるスクリプトを使います。他のワーカースクリプトは、RUN_* スクリプトによって呼び出し/実行されます。

すべての RUN_* スクリプトは、最初にmyEnvironment スクリプトを呼び出し、必要な環境変数を設定します。主な環境変数は(parantesisにおけるwindowsの例):

  • COMPIERE_HOME (D:\Compiere2) - アプリケーションホームディレクトリ
  • COMPIERE_DB_TNS (compiere.compiere.org) - データベースのtns名
  • JAVA_HOME (D:\Compiere2\jre) - Javaホーム

ワーカースクリプトは RUN_* スクリプトで始まり、ユーザーIDとパスワードを提供します。容易に管理するために、以下の環境変数が使われています:

  • COMPIERE_DB_SYSTEM = manager - システムパスワード
  • COMPIERE_DB_USER = compiere - compiere DBユーザーID
  • COMPIERE_DB_PASSWORD = compiere - compiere DB のパスワード

パスワードを変更する場合(本番環境において推奨)は、RUN_setup 経由で上記の環境変数を変える必要があります。

デフォルトデータベーステーブルスペース名

必ず、データベースユーザー Compiereのためのテーブルスペースが存在していることを確認してください:デフォルトテーブルスペースは USER、インデックステーブルスペースがINDX、一時的なテーブルスペースはTEMPです。もし異なるテーブルスベース名を使用するのであれば、CreateUser.sql スクリプトと DBA_*.sql ファイル(ソースダウンロード参照)スクリプトを変更し、その都度更新する必要があります

Updates

アップデートは、スクリプトを(予告なく)更新または上書きする場合があります。スクリプトを変更した場合、その修正に名前をつけ直すこと(例えば、myDBexport)をお勧めします。変更についての記録をとって、アップグレード後にチェックしてください。

出力例(少々古い)

tnsping の実行

TNS Ping 出力
D:\Compiere2>tnsping dev

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-2002 16:40:22

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
D:\Oracle\Ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dev)(PORT = 1521))) (CONNECT_DATA = (SERVER
= DEDICATED) (SERVICE_NAME = dev.compiere.org)))
OK (70 msec)

D:\Compiere>tnsping dev.compiere.org

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-2002 16:41:05

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
D:\Oracle\Ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dev)(PORT = 1521))) (CONNECT_DATA = (SERVER
= DEDICATED) (SERVICE_NAME = dev.compiere.org)))
OK (80 msec)

D:\Compiere2>

もし問題があれば、出力されているパラメータ・ファイルを確認してください!

RUN_Env の実行

RUN_Env Output
D:\Compiere2\utils>RUN_Env
Setting myEnvironment ....
The system cannot find the file specified.
General ...
PATH = D:\j2sdk1.4.1\bin;....
CLASSPTH = D:\Compiere2\lib\CClient.jar;D:\Compiere2\lib\CTools.jar;
D:\Compiere2\lib\CServer.jar;D:\Compiere2\lib\oracle.jar;
.
Homes ...
COMPIERE_HOME = D:\Compiere2
JAVA_HOME = D:\j2sdk1.4.1
COMPIERE_DB_HOME = D:\Compiere2\utils\oracle
.
Database ...
COMPIERE_DB_USER = compiere
COMPIERE_DB_PASSWORD = compiere
COMPIERE_DB_PATH = oracle
.. Oracle specifics
COMPIERE_DB_TNS = dev.compiere.org
COMPIERE_DB_SYSTEM = manager
.
D:\Compiere2\utils>D:\j2sdk1.4.1\bin\java -version
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
.
Java Version should be "1.4.1"
---------------------------------------------------------------
Press any key to continue . . .
.
---------------------------------------------------------------
Database Connection Test (1) ... dev.compiere.org
If this fails, verify the COMPIERE_DB_TNS setting with Oracle Net Manager
You should see an OK at the end
Press any key to continue . . .

D:\Compiere2\utils>tnsping dev.compiere.org

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 09-OCT-2002 16:50:35

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
D:\Oracle\Ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dev)(PORT = 1521))) (CONNECT_DATA = (SERVER
= DEDICATED) (SERVICE_NAME = dev.compiere.org)))
OK (80 msec)
.
---------------------------------------------------------------
Database Connection Test (3) ... system/manager in D:\Compiere2\utils\oracle
If this test fails, verify the system password in COMPIERE_DB_SYSTEM
Press any key to continue . . .

D:\Compiere2\utils>sqlplus system/devmanager@dev.compiere.org @D:\Compiere2\utils\oracle\Test.sql

SQL*Plus: Release 9.2.0.1.0 - Production on Wed Oct 9 16:50:36 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production


CONNECTION
-----------
Success

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
.
---------------------------------------------------------------
Checking Database Size
Press any key to continue . . .

D:\Compiere2\utils>sqlplus "system/manager@dev.compiere.org AS SYSDBA" @D:\Compiere2\utils\oracle\CheckDB.sql

SQL*Plus: Release 9.2.0.1.0 - Production on Wed Oct 9 16:50:38 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

DOC> * The contents of this file are subject to the Compiere License. You may
DOC> * obtain a copy of the License at http://www.compiere.org/license.html
DOC> * Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
DOC> * express or implied. See the License for details. Code: Compiere ERP&CRM
DOC> * Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
DOC> *****************************************************
DOC> * $Id: installDatabase.html,v 1.27 2004/05/11 04:11:52 jjanke Exp $
DOC> ***
DOC> * Title: TabeSpace Sizing
DOC> * Description:
DOC> * Make sure, that Tablespace
DOC> * USERS is 150 MB, 10 MB Autoextend
DOC> * INDX is 100 MB, 10 MB Autoextend
DOC> * TEMP is 100 MB, 10 MB Autoextend
DOC> * Set SGA Size (optional)
DOC> *****************************************************/

no rows selected


no rows selected


no rows selected

DOC> * Changing System Parameters
DOC> * directly - (e.g. 400 MB for 10 Users)
DOC>
DOC> ALTER SYSTEM SET SGA_MAX_SIZE=400M
COMMENT='400MB' SCOPE=SPFILE;
DOC> ALTER SYSTEM SET SHARED_POOL_SIZE=100M SCOPE=SPFILE;
DOC> ALTER SYSTEM SET DB_CACHE_SIZE=200M SCOPE=SPFILE;
DOC> ALTER SYSTEM SET JAVA_POOL_SIZE=40M SCOPE=SPFILE;
DOC> ALTER SYSTEM SET LARGE_POOL_SIZE=10M SCOPE=SPFILE;
DOC>
DOC> ** indirectly - sqlplus "system/manager@compiere AS SYSDBA"
DOC>
DOC> CREATE PFile='pfileCompiere.ora' FROM SPFile;
DOC> * creates file in $ORACLE_HOME\database or $ORACLE_HOME/dbs
DOC> * edit file and then overwrite the fila via
DOC> CREATE SPFile FROM PFile='pfileCompiere.ora';
DOC> *****/
Resize:

PL/SQL procedure successfully completed.

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
.
---------------------------------------------------------------
Database Connection Test (4) ... compiere/compiere
This may fail, if you have not imported the Compiere database yet - Just enter EXIT and run this script again after the import
Press any key to continue . . .

D:\Compiere2\utils>sqlplus compiere/compiere@dev.compiere.org @D:\Compiere2\utils\oracle\Test.sql

SQL*Plus: Release 9.2.0.1.0 - Production on Wed Oct 9 16:50:48 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production


CONNECTION
-----------
Success

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
.
Done
Press any key to continue . . .

もし以下のようなエラーが出たら、

ERROR: ORA-01017: invalid username/password; logon denied
Enter user-name:

Control-C を入力- Compiereデータベースがインポートされていないため、接続することができません。データベースのインポート後に実行すれば、エラーは出ないはずです。

 

RUN_ImportCompiere の実行

RUN_Import 出力
D:\Compiere2\utils>RUN_ImportCompiere
Setting myEnvironment ....
Re-Create Compiere User and import D:\Compiere2\data\compiere.dmp - (dev.compiere.org)
Volume in drive D is Dev
Volume Serial Number is 1096-FA3C

Directory of D:\Compiere2\data

09/16/2002 22:25 8,808,448 Compiere.dmp
1 File(s) 8,808,448 bytes
0 Dir(s) 2,628,481,024 bytes free
== The import will show warnings. This is OK ==
Press any key to continue . . .
Compiere Database Import $Revision: 1.27 $
Importing Compiere DB from D:\Compiere2\data\compiere.dmp (dev.compiere.org)
-------------------------------------
Re-Create DB user
-------------------------------------

SQL*Plus: Release 9.2.0.1.0 - Production on Wed Oct 9 17:02:17 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> /******************************************************
DOC> * The contents of this file are subject to the Compiere License. You may
DOC> * obtain a copy of the License at http://www.compiere.org/license.html
DOC> * Software is on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either
DOC> * express or implied. See the License for details. Code: Compiere ERP&CRM
DOC> * Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
DOC> ******************************************************
DOC> * $Id: installDatabase.html,v 1.27 2004/05/11 04:11:52 jjanke Exp $
DOC> ***
DOC> * Title: Drop User and re-create new
DOC> * Description:
DOC> * Parameter: UserID UserPwd
DOC> * Run as system
DOC> *****************************************************/
SQL> DROP USER &1 CASCADE
2 /
old 1: DROP USER &1 CASCADE
new 1: DROP USER compiere CASCADE

User dropped.

SQL> CREATE USER &1 IDENTIFIED BY &2
2 DEFAULT TABLESPACE USERS
3 TEMPORARY TABLESPACE TEMP
4 PROFILE DEFAULT
5 ACCOUNT UNLOCK
6 /
old 1: CREATE USER &1 IDENTIFIED BY &2
new 1: CREATE USER compiere IDENTIFIED BY compiere

User created.

SQL> GRANT CONNECT TO &1
2 /
old 1: GRANT CONNECT TO &1
new 1: GRANT CONNECT TO compiere

Grant succeeded.

SQL> GRANT DBA TO &1
2 /
old 1: GRANT DBA TO &1
new 1: GRANT DBA TO compiere

Grant succeeded.

SQL> GRANT RESOURCE TO &1
2 /
old 1: GRANT RESOURCE TO &1
new 1: GRANT RESOURCE TO compiere

Grant succeeded.

SQL> GRANT AQ_ADMINISTRATOR_ROLE TO &1
2 /
old 1: GRANT AQ_ADMINISTRATOR_ROLE TO &1
new 1: GRANT AQ_ADMINISTRATOR_ROLE TO compiere

Grant succeeded.

SQL> GRANT JAVAUSERPRIV TO &1
2 /
old 1: GRANT JAVAUSERPRIV TO &1
new 1: GRANT JAVAUSERPRIV TO compiere

Grant succeeded.

SQL> GRANT JAVASYSPRIV TO &1
2 /
old 1: GRANT JAVASYSPRIV TO &1
new 1: GRANT JAVASYSPRIV TO compiere

Grant succeeded.

SQL> GRANT EXECUTE ON DBMS_AQ TO &1
2 /
old 1: GRANT EXECUTE ON DBMS_AQ TO &1
new 1: GRANT EXECUTE ON DBMS_AQ TO compiere

Grant succeeded.

SQL> GRANT EXECUTE ON DBMS_AQADM TO &1
2 /
old 1: GRANT EXECUTE ON DBMS_AQADM TO &1
new 1: GRANT EXECUTE ON DBMS_AQADM TO compiere

Grant succeeded.

SQL> GRANT UNLIMITED TABLESPACE TO &1
2 /
old 1: GRANT UNLIMITED TABLESPACE TO &1
new 1: GRANT UNLIMITED TABLESPACE TO compiere

Grant succeeded.

SQL> ALTER USER &1 DEFAULT ROLE AQ_ADMINISTRATOR_ROLE,
CONNECT, RESOURCE, DBA, JAVAUSERPRIV, JAVASYSPRIV
2 /
old 1: ALTER USER &1 DEFAULT ROLE AQ_ADMINISTRATOR_ROLE,
CONNECT, RESOURCE, DBA, JAVAUSERPRIV, JAVASYSPRIV
new 1: ALTER USER compiere DEFAULT ROLE AQ_ADMINISTRATOR_ROLE,
CONNECT, RESOURCE, DBA, JAVAUSERPRIV, JAVASYSPRIV

User altered.

SQL> EXIT
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
-------------------------------------
Import Compiere.dmp
-------------------------------------

Import: Release 9.2.0.1.0 - Production on Wed Oct 9 17:05:51 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

Export file created by EXPORT:V09.02.00 via conventional path

Warning: the objects were exported by COMPIERE, not by you

import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing COMPIERE's objects into COMPIERE
. . importing table "AD_ATTACHMENT" 0 rows imported
. . importing table "AD_ATTRIBUTE" 0 rows imported
. . importing table "AD_ATTRIBUTE_VALUE" 0 rows imported
. . importing table "AD_CLIENT" 2 rows imported
. . importing table "AD_CLIENTINFO" 2 rows imported
:

:

. . importing table "T_REPLENISH" 0 rows imported
. . importing table "T_SPOOL" 0 rows imported
. . importing table "W_BASKET" 0 rows imported
. . importing table "W_COUNTER" 0 rows imported
. . importing table "W_REQUEST" 0 rows imported
IMP-00041: Warning: object created with compilation warnings
"CREATE FORCE VIEW "COMPIERE"."RV_CASH_DETAIL" ("C_CA"
"SH_ID","C_CASHLINE_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CRE..:

About to enable constraints...
Import terminated successfully with warnings.
-------------------------------------
Check System
Import may show some warnings.
This is OK as long as the following does not show errors
-------------------------------------

SQL*Plus: Release 9.2.0.1.0 - Production on Wed Oct 9 17:14:16 2002

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

DOC> * The contents of this file are subject to the Compiere License. You may
DOC> * obtain a copy of the License at http://www.compiere.org/license.html
DOC> * Software is on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either
DOC> * express or implied. See the License for details. Code: Compiere ERP&CRM
DOC> * Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
DOC> ***************************************************************
DOC> * $Id: installDatabase.html,v 1.27 2004/05/11 04:11:52 jjanke Exp $
DOC> ***
DOC> * Title: After Import
DOC> * Description:
DOC> * Check Imported User
DOC> * You can ignore import warnings as long as this does not
DOC> * return error messages or records.
DOC> ***************************************************************/

Context created.


DBInfo
--------------------------------------------------------------------------------
DB_Name=dev, Language=AMERICAN_AMERICA.AL32UTF8,
Host=COMPIERE\DEV , IP=192.168.
168.201, User=COMPIERE, ID=101, Session=7931


DBA_Cleanup
Invoices Paid=0
T_Spool=0
T_InventoryValue=0
T_Replenish=0
AD_PInstance=0
AD_Find0
AD_Error=0
AD_Trace=0
AD_Note=0
All valid
Statistics computed: 281
All valid

PL/SQL procedure successfully completed.


no rows selected

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Press any key to continue . . .

もし最終的に「All valid(すべて有効)」で「no rows selected(列選択なし)」であれば、インポートに成功したということになります。