Organize installers for OracleXE and postgresql

This commit is contained in:
Carlos Ruiz 2006-12-28 08:33:33 +00:00
parent 8fa05a58c9
commit df2baf74c6
24 changed files with 50 additions and 149181 deletions

View File

@ -170,6 +170,13 @@
<fileset dir="${dbStartup.dir}/oracle" includes="*.sql"/>
<fileset dir="../sqlj/oracle/"/>
</copy>
<copy todir="${build.dir}/Adempiere/utils/postgresql">
<fileset dir="${dbStartup.dir}/postgresql" includes="*.sql"/>
<fileset dir="../sqlj/postgresql/"/>
</copy>
<copy todir="${build.dir}/Adempiere/utils/oracleXE">
<fileset dir="${dbStartup.dir}/oracleXE" includes="*.sql"/>
</copy>
<!-- Data Directory -->

View File

@ -1,8 +0,0 @@
ALTER TABLE AD_Menu RENAME COLUMN Action to ActionRun;
ALTER TABLE AD_WF_Node RENAME COLUMN Action to ActionRun;
ALTER TABLE AD_WF_Node RENAME COLUMN Limit to DurationLimit;
--ALTER TABLE MPC_Order_Node RENAME COLUMN Action to ActionRun;
ALTER TABLE AD_Workflow RENAME COLUMN Limit to DurationLimit;
--select table_name,column_name,data_type,data_length,
-- data_precision,data_scale,nullable,column_id
-- from user_tab_columns WHERE COLUMN_NAME = 'Action';

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,357 +0,0 @@
/** Change Numeric for Integer */
CREATE OR REPLACE FUNCTION adempiere.ID (record NUMERIC)
RETURNS INTEGER AS $$
DECLARE
ID integer := 0;
BEGIN
ID := CAST(record AS INTEGER);
--RAISE NOTICE 'Quantity here is %', ID;
RETURN ID;
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.getdate()
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN now();
END;
$$ LANGUAGE plpgsql VOLATILE;
/**TIMESTAMP WITH TIME ZONE **/
CREATE OR REPLACE FUNCTION adempiere.addDays (day TIMESTAMP WITH TIME ZONE, days DECIMAL)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN adempiere.addDays(day,adempiere.ID(days));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.subtractdays (day TIMESTAMP WITH TIME ZONE, days DECIMAL)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN adempiere.addDays(day,adempiere.ID(days * -1));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.addDays (day TIMESTAMP WITH TIME ZONE, days INTEGER)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN adempiere.addDays(day,Idays);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.subtractdays (day TIMESTAMP WITH TIME ZONE, days INTEGER)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN adempiere.addDays(day,days * -1);
END;
$$ LANGUAGE plpgsql VOLATILE;
-- TIMESTAMP
/*
CREATE OR REPLACE FUNCTION addDays (day TIMESTAMP , days DECIMAL)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN addDays(CAST (day AS TIMESTAMP WITH TIME ZONE),ID(days));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION subtractdays (day TIMESTAMP , days DECIMAL)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN addDays(CAST (day AS TIMESTAMP WITH TIME ZONE),ID(days * -1));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION addDays (day TIMESTAMP , days INTEGER)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN addDays(CAST (day AS TIMESTAMP WITH TIME ZONE),ID(days));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION subtractdays (day TIMESTAMP , days INTEGER)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN addDays(CAST (day AS TIMESTAMP WITH TIME ZONE),ID(days * -1));
END;
$$ LANGUAGE plpgsql VOLATILE;*/
/** Product **/
/*CREATE OR REPLACE FUNCTION adempiere.productAttribute (M_AttributeSetInstance_ID NUMERIC)
RETURNS VARCHAR AS $$
BEGIN
RETURN adempiere.productAttribute(adempiere.ID(M_AttributeSetInstance_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomPriceLimit(adempiere.ID(M_Product_ID),ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomPriceList(adempiere.ID(M_Product_ID),adempiere.ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomPriceStd(adempiere.ID(M_Product_ID),adempiere.ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomQtyAvailable (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomQtyAvailable(adempiere.ID(M_Product_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomQtyOnHand(adempiere.ID(M_Product_ID),ID(M_Warehouse_ID),ID(M_Locator_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomQtyOrdered (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomQtyOrdered(adempiere.ID(M_Product_ID),adempiere.ID(M_Warehouse_adempiere.ID),adempiere.ID(M_Locator_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomQtyReserved (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.bomQtyReserved(adempiere.ID(M_Product_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bomQtyAvailable(M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC,M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS
$BODY$
BEGIN
RETURN adempiere.bomQtyAvailable(adempiere.ID(M_Product_ID),adempiere.ID(M_AttributeSetInstance_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
--ALTER FUNCTION adempiere.bomqtyavailable("numeric", "numeric", "numeric", "numeric") OWNER TO adempiere;
CREATE OR REPLACE FUNCTION adempiere.bomQtyOnHand(M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC,M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS
$BODY$
BEGIN
RETURN adempiere.bomQtyOnHand(adempiere.ID(M_Product_ID), adempiere.ID(M_AttributeSetInstance_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
--ALTER FUNCTION adempiere.bomqtyonhand("numeric", "numeric", "numeric", "numeric") OWNER TO adempiere;
CREATE OR REPLACE FUNCTION adempiere.bomQtyOrdered(M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC,M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS
$BODY$
BEGIN
RETURN adempiere.bomQtyOrdered(adempiere.ID(M_Product_ID), adempiere.ID(M_AttributeSetInstance_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
--ALTER FUNCTION adempiere.bomqtyordered("numeric", "numeric", "numeric", "numeric") OWNER TO adempiere;
CREATE OR REPLACE FUNCTION adempiere.bomQtyReserved(M_Product_ID NUMERIC, M_AttributeSetInstance_ID INTEGER,M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC AS
$BODY$
BEGIN
RETURN adempiere.bomQtyReserved(adempiere.ID(M_Product_ID), adempiere.ID(M_AttributeSetInstance_ID),adempiere.ID(M_Warehouse_ID),adempiere.ID(M_Locator_ID));
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
--ALTER FUNCTION adempiere.bomqtyreserved("numeric", "numeric", "numeric", "numeric") OWNER TO adempiere;
*
CREATE OR REPLACE FUNCTION adempiere.currencyBase (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.currencyBase (Amount,adempiere.ID(C_CurrencyFrom_ID),ConversionDate,adempiere.ID(AD_Client_ID),adempiere.ID(AD_Org_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.currencyConvert (Amount NUMERIC, C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.currencyConvert (Amount ,adempiere.ID(C_CurrencyFrom_ID),adempiere.ID(C_CurrencyTo_ID),ConversionDate,adempiere.ID(C_ConversionType_ID),adempiere.ID(AD_Client_ID),adempiere.ID(AD_Org_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.currencyRate (C_CurrencyFrom_ID NUMERIC, C_CurrencyTo_ID NUMERIC,
ConversionDate TIMESTAMP WITH TIME ZONE, C_ConversionType_ID NUMERIC, AD_Client_ID NUMERIC, AD_Org_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.currencyRate (adempiere.ID(C_CurrencyFrom_ID), adempiere.ID(C_CurrencyTo_ID),ConversionDate,adempiere.ID(C_ConversionType_ID),adempiere.ID(AD_Client_ID),adempiere.ID(AD_Org_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.bpartnerRemitLocation (p_C_BPartner_ID NUMERIC)
RETURNS INTEGER AS $$
BEGIN
RETURN adempiere.partnerRemitLocation (adempiere.ID(p_C_BPartner_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.invoiceOpen (p_C_Invoice_ID NUMERIC, p_C_InvoicePaySchedule_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.invoiceOpen (adempiere.ID(p_C_Invoice_ID),adempiere.ID(p_C_InvoicePaySchedule_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.invoicePaid (p_C_Invoice_ID NUMERIC, p_C_Currency_ID NUMERIC, p_MultiplierAP NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.invoicePaid (adempiere.ID(p_C_Invoice_ID),adempiere.ID(p_C_Currency_ID),adempiere.ID(p_MultiplierAP));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.invoiceDiscount (p_C_Invoice_ID NUMERIC, p_PayDate TIMESTAMP WITH TIME ZONE, p_C_InvoicePaySchedule_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.invoiceDiscount (adempiere.ID(p_C_Invoice_ID), p_PayDate , adempiere.ID(p_C_InvoicePaySchedule_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.paymentTermDueDays (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE)
RETURNS INTEGER AS $$
BEGIN
RETURN adempiere.paymentTermDueDays (adempiere.ID(p_C_PaymentTerm_ID), p_DocDate , p_PayDate);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.paymentTermDueDate (p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE)
RETURNS TIMESTAMP WITH TIME ZONE AS $$
BEGIN
RETURN adempiere.paymentTermDueDays (adempiere.ID(p_C_PaymentTerm_ID), p_DocDate );
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.paymentTermDiscount (p_Amount NUMERIC, p_C_PaymentTerm_ID NUMERIC, p_DocDate TIMESTAMP WITH TIME ZONE, p_PayDate TIMESTAMP WITH TIME ZONE)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.paymentTermDiscount (p_Amount, adempiere.ID(p_C_PaymentTerm_ID), p_DocDate , p_PayDate );
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.paymentAllocated (p_C_Payment_ID NUMERIC, p_C_Currency_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.paymentAllocated (adempiere.ID(p_C_Payment_ID),adempiere.ID(p_C_Currency_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.paymentAvailable (p_C_Payment_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.paymentAvailable (adempiere.ID(p_C_Payment_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.acctBalance (p_Account_ID NUMERIC, p_AmtDr NUMERIC, p_AmtCr NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN adempiere.acctBalance (adempiere.ID(p_Account_ID), p_AmtDr , p_AmtCr);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION adempiere.documentNo (p_MPC_MRP_ID NUMERIC)
RETURNS VARCHAR AS $$
BEGIN
RETURN adempiere.documentNo(adempiere.ID(p_MPC_MRP_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
*/
DROP OPERATOR adempiere.+ (timestamptz, INTEGER);
CREATE OPERATOR adempiere.+ ( PROCEDURE = adempiere.adddays,
LEFTARG = TIMESTAMPTZ, RIGHTARG = INTEGER,
COMMUTATOR = +);
DROP OPERATOR adempiere.- (timestamptz, INTEGER);
CREATE OPERATOR adempiere.- ( PROCEDURE = adempiere. subtractdays,
LEFTARG = TIMESTAMPTZ, RIGHTARG = INTEGER,
COMMUTATOR = -);
/*DROP OPERATOR adempiere.+ (interval, numeric);
CREATE OPERATOR adempiere.+ ( PROCEDURE = adempiere.adddays,
LEFTARG = INTERVAL, RIGHTARG = NUMERIC,
COMMUTATOR = +);
DROP OPERATOR adempiere.- (interval, numeric);
CREATE OPERATOR adempiere.- ( PROCEDURE = adempiere.subtractdays,
LEFTARG = INTERVAL, RIGHTARG = NUMERIC,
COMMUTATOR = -);
*/
/*
DROP OPERATOR adempiere.+ (interval, integer);
CREATE OPERATOR adempiere.+ ( PROCEDURE = adempiere.adddays,
LEFTARG = INTERVAL, RIGHTARG = INTEGER,
COMMUTATOR = +);
DROP OPERATOR adempiere.- (interval, integer);
CREATE OPERATOR adempiere.- ( PROCEDURE = adempiere.subtractdays,
LEFTARG = INTERVAL, RIGHTARG = INTEGER,
COMMUTATOR = -);
*/
/*CREATE OR REPLACE FUNCTION nextID ( p_AD_Sequence_ID NUMERIC, p_System CHAR)
RETURNS NUMERIC AS $$
DECLARE
o_NextID INTEGER := -1;
BEGIN
IF (p_System = 'Y') THEN
LOCK TABLE AD_Sequence IN ACCESS EXCLUSIVE MODE;
--LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
SELECT CurrentNextSys
INTO o_NextID
FROM AD_Sequence
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
--FOR UPDATE OF CurrentNextSys;
--
UPDATE AD_Sequence
SET CurrentNextSys = CurrentNextSys + IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
--COMMIT;
RETURN o_NextID;
ELSE
LOCK TABLE AD_Sequence IN ACCESS EXCLUSIVE MODE;
--LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
SELECT CurrentNext
INTO o_NextID
FROM AD_Sequence
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
--FOR UPDATE OF CurrentNext;
--
UPDATE AD_Sequence
SET CurrentNext = CurrentNext + IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
--COMMIT;
RETURN o_NextID;
END IF;
--
RAICE EXCEPTION 'Failed to update' ;
RETURN null;
END;
$$ LANGUAGE plpgsql;
*/

View File

@ -1,247 +0,0 @@
------------------
-- Created by: Andre Whittick Nasser, OCP
-- Email: andre_nasser@yahoo.com.br
-- Website: www.geocities.com/andre_nasser
-- Date: Oct 24, 2001
-- Description: Reverse Engineer your existing schema objects
------------------
set termout off
set feedback off
set serveroutput on size 1000000
spool table.sql
begin
dbms_output.put_line('--');
dbms_output.put_line('-- DROP TABLES --');
dbms_output.put_line('--');
for rt in (select tname from tab order by tname) loop
dbms_output.put_line('DROP TABLE '||rt.tname||' CASCADE CONSTRAINTS;');
end loop;
end;
/
declare
v_tname varchar2(30);
v_cname char(32);
v_type char(20);
v_null varchar2(10);
v_maxcol number;
v_virg varchar2(1);
begin
dbms_output.put_line('--');
dbms_output.put_line('-- CREATE TABLES --');
dbms_output.put_line('--');
for rt in (select table_name from user_tables order by 1) loop
v_tname:=rt.table_name;
v_virg:=',';
dbms_output.put_line('CREATE TABLE '||v_tname||' (');
for rc in (select table_name,column_name,data_type,data_length,
data_precision,data_scale,nullable,column_id
from user_tab_columns tc
where tc.table_name=rt.table_name
order by table_name,column_id) loop
v_cname:=rc.column_name;
if rc.data_type='VARCHAR2' then
v_type:='VARCHAR2('||rc.data_length||')';
elsif rc.data_type='NUMBER' and rc.data_precision is null
and
rc.data_scale=0 then
v_type:='INTEGER';
elsif rc.data_type='NUMBER' and rc.data_precision is null
and
rc.data_scale is null then
v_type:='NUMBER';
elsif rc.data_type='NUMBER' and rc.data_scale='0' then
v_type:='NUMBER('||rc.data_precision||')';
elsif rc.data_type='NUMBER' and rc.data_scale<>'0' then
v_type:='NUMBER('||rc.data_precision||','||rc.data_scale||')';
elsif rc.data_type='CHAR' then
v_type:='CHAR('||rc.data_length||')';
else v_type:=rc.data_type;
end if;
if rc.nullable='Y' then
v_null:='NULL';
else
v_null:='NOT NULL';
end if;
select max(column_id)
into v_maxcol
from user_tab_columns c
where c.table_name=rt.table_name;
if rc.column_id=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (v_cname||v_type||v_null||v_virg);
end loop;
dbms_output.put_line(');');
end loop;
end;
/
spool off
spool index.sql
declare
v_virg varchar2(1);
v_maxcol number;
begin
dbms_output.put_line('--');
dbms_output.put_line('-- PRIMARY KEYS --');
dbms_output.put_line('--');
for rcn in (select table_name,constraint_name
from user_constraints
where constraint_type='P'
order by table_name) loop
dbms_output.put_line ('ALTER TABLE '||rcn.table_name||' ADD ');
dbms_output.put_line ('CONSTRAINT '||rcn.constraint_name);
dbms_output.put_line ('PRIMARY KEY (');
v_virg:=',';
for rcl in (select column_name,position
from user_cons_columns cl
where cl.constraint_name=rcn.constraint_name
order by position) loop
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.constraint_name;
if rcl.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
dbms_output.put_line(');');
--dbms_output.put_line('USING INDEX );');
end loop;
end;
/
declare
v_virg varchar2(1);
v_maxcol number;
v_tname varchar2(30);
begin
dbms_output.put_line('--');
dbms_output.put_line('-- FOREIGN KEYS --');
dbms_output.put_line('--');
for rcn in (select table_name,constraint_name,delete_rule,r_constraint_name
from dba_constraints
where constraint_type='R' AND OWNER = 'COMPIERE'
order by table_name) loop
--dbms_output.put_line ('ALTER TABLE '||rcn.table_name||' ADD (');
dbms_output.put_line ('ALTER TABLE '||rcn.table_name||' ADD ');
dbms_output.put_line ('CONSTRAINT '||rcn.constraint_name);
dbms_output.put_line ('FOREIGN KEY (');
v_virg:=',';
for rcl in (select column_name,position
from user_cons_columns cl
where cl.constraint_name=rcn.constraint_name
order by position) loop
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.constraint_name;
if rcl.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
select table_name
into v_tname
from user_constraints c
where c.constraint_name=rcn.r_constraint_name;
dbms_output.put_line(') REFERENCES '||v_tname||' (');
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.r_constraint_name;
v_virg:=',';
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.r_constraint_name;
for rcr in (select column_name,position
from user_cons_columns cl
where rcn.r_constraint_name=cl.constraint_name
order by position) loop
if rcr.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcr.column_name||v_virg);
end loop;
dbms_output.put_line(' ) ');
if rcn.delete_rule='CASCADE' then
dbms_output.put_line(' ON DELETE CASCADE ; ');
else
dbms_output.put_line('; ');
end if;
end loop;
end;
/
begin
dbms_output.put_line('--');
dbms_output.put_line('-- DROP SEQUENCES --');
dbms_output.put_line('--');
for rs in (select sequence_name
from user_sequences
where sequence_name like 'SQ%'
order by sequence_name) loop
dbms_output.put_line('DROP SEQUENCE '||rs.sequence_name||';');
end loop;
dbms_output.put_line('--');
dbms_output.put_line('-- CREATE SEQUENCES --');
dbms_output.put_line('--');
for rs in (select sequence_name
from user_sequences
where sequence_name like 'SQ%'
order by sequence_name) loop
dbms_output.put_line('CREATE SEQUENCE '||rs.sequence_name||' NOCYCLE;');
end loop;
end;
/
declare
v_virg varchar2(1);
v_maxcol number;
begin
dbms_output.put_line('--');
dbms_output.put_line('-- INDEXES --');
dbms_output.put_line('--');
for rid in (select index_name, table_name
from user_indexes
where index_name not in (select constraint_name from
user_constraints)
and index_type<>'LOB'
order by index_name) loop
v_virg:=',';
dbms_output.put_line('CREATE INDEX '||rid.index_name||' ON
'||rid.table_name||' (');
for rcl in (select column_name,column_position
from user_ind_columns cl
where cl.index_name=rid.index_name
order by column_position) loop
select max(column_position)
into v_maxcol
from user_ind_columns c
where c.index_name=rid.index_name;
if rcl.column_position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
dbms_output.put_line(');');
end loop;
end;
/
spool off
set feedback on
set termout on
-- End of script

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +0,0 @@
CREATE TABLE compiere.MPC_Order_Node_Trl
(
ad_language varchar(6) NOT NULL,
mpc_order_node_id int4 NOT NULL,
mpc_order_id int4 NOT NULL,
ad_client_id int4 NOT NULL,
ad_org_id int4 NOT NULL,
isactive char(1) NOT NULL DEFAULT 'Y'::bpchar,
created timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) with time zone,
createdby int4 NOT NULL,
updated timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) with time zone,
updatedby int4 NOT NULL,
name varchar(60) NOT NULL,
description varchar(255),
help varchar(2000),
istranslated char(1) NOT NULL DEFAULT 'N'::bpchar,
CONSTRAINT mpc_order_node_trl_key PRIMARY KEY (ad_language, mpc_order_node_id),
CONSTRAINT ad_language_ordernodetrl FOREIGN KEY (ad_language) REFERENCES compiere.ad_language (ad_language) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT mpc_ordernodetrl FOREIGN KEY (mpc_order_node_id, mpc_order_id) REFERENCES compiere.mpc_order_node (mpc_order_node_id, mpc_order_id) ON UPDATE NO ACTION ON DELETE CASCADE
)
WITH OIDS;
CREATE TABLE compiere.mpc_order_workflow_trl
(
mpc_order_workflow_id int4 NOT NULL,
mpc_order_id int4 NOT NULL,
ad_language varchar(6) NOT NULL,
ad_client_id int4 NOT NULL,
ad_org_id int4 NOT NULL,
isactive char(1) NOT NULL DEFAULT 'Y'::bpchar,
created timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) with time zone,
createdby int4 NOT NULL,
updated timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) with time zone,
updatedby int4 NOT NULL,
name varchar(60) NOT NULL,
description varchar(255),
help varchar(2000),
istranslated char(1) NOT NULL DEFAULT 'N'::bpchar,
CONSTRAINT mpc_order_workflow_trl_key PRIMARY KEY (ad_language, mpc_order_workflow_id),
CONSTRAINT ad_language_workflowtrl FOREIGN KEY (ad_language) REFERENCES compiere.ad_language (ad_language) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT mpc_order_workflowtrl FOREIGN KEY (mpc_order_workflow_id, mpc_order_id) REFERENCES compiere.mpc_order_workflow (mpc_order_workflow_id, mpc_order_id) ON UPDATE NO ACTION ON DELETE CASCADE
)
WITH OIDS;
CREATE OR REPLACE VIEW RV_MPC_Order AS
SELECT o.AD_Client_ID, o.AD_Org_ID,o.IsActive,o.Created, o.CreatedBy, o.Updated, o.UpdatedBy,
o.MPC_Order_ID, o.DocumentNo,o.DocStatus,o.M_Warehouse_ID,o.M_Product_ID,o.QtyEntered,
o.QtyReject,o.QtyScrap,o.QtyBatchs, o.QtyBatchSize,o.DateOrdered, o.DatePromised,o.DateStart,
o.DateStartSchedule,o.DateFinish,o.DateFinishSchedule,o.DateConfirm,o.DateDelivered,o.Lot,
o.MPC_Product_BOM_ID,o.AD_Workflow_ID, (select p.Weight from M_Product p where p.M_Product_ID=o.M_Product_ID) as Weight
FROM MPC_Order o;
CREATE OR REPLACE VIEW RV_MPC_Order_BOMLine AS
SELECT
obl.AD_Client_ID ,
obl.AD_Org_ID ,
obl.CreatedBy ,
obl.UpdatedBY ,
obl.Updated ,
obl.Created ,
obl.IsActive ,
obl.MPC_Order_BOM_ID,
obl.MPC_Order_BOMLine_ID ,
obl.MPC_Order_ID ,
obl.IsCritical ,
obl.ComponentType,
obl.M_Product_ID ,
obl.C_UOM_ID ,
ROUND(obl.QtyRequiered ,4) AS QtyRequiered ,
ROUND(BOMQtyReserved(obl.M_Product_ID,obl.M_Warehouse_ID,0), 4) AS QtyReserved ,
ROUND(BOMQtyAvailable(obl.M_Product_ID,obl.M_Warehouse_ID,0),4) AS QtyAvailable ,
ROUND(BOMQtyOnHand(obl.M_Product_ID,obl.M_Warehouse_ID,0),4) AS QtyOnHand ,
obl.M_Warehouse_ID ,
ROUND(obl.QtyBom,4) AS QtyBom,
obl.isQtyPercentage ,
ROUND(obl.QtyBatch,4) AS QtyBatch,
CASE WHEN o.QtyBatchs = 0 THEN 1 ELSE ROUND( obl.QtyRequiered / o.QtyBatchs, 4) END AS QtyBatchSize
--DECODE(o.QtyBatchs , 0 , 0 , ROUND( obl.QtyRequiered / o.QtyBatchs, 4) ) AS QtyBatchSize
FROM MPC_Order_BOMLine obl INNER JOIN MPC_Order o ON (o.MPC_Order_ID = obl.MPC_Order_ID);
--DROP VIEW RV_MPC_Order_Storage;
CREATE OR REPLACE VIEW RV_MPC_Order_Storage AS
SELECT
obl.AD_Client_ID ,
obl.AD_Org_ID ,
obl.CreatedBy ,
obl.UpdatedBY ,
obl.Updated ,
obl.Created ,
obl.IsActive ,
obl.MPC_Order_BOM_ID,
obl.MPC_Order_BOMLine_ID ,
obl.MPC_Order_ID ,
obl.IsCritical ,
obl.M_Product_ID ,
(Select p.Name FROM M_Product p Where p.M_Product_ID=o.M_Product_ID) as Name,
obl.C_UOM_ID ,
s.QtyOnhand ,
ROUND(obl.QtyRequiered ,4) AS QtyRequiered ,
CASE WHEN o.QtyBatchs = 0 THEN 1 ELSE ROUND( obl.QtyRequiered / o.QtyBatchs, 4) END AS QtyBatchSize,
--DECODE(o.QtyBatchs , 0 , 0 , ROUND( obl.QtyRequiered / o.QtyBatchs, 4) ) AS QtyBatchSize,
ROUND(BOMQtyReserved(obl.M_Product_ID,obl.M_Warehouse_ID,0), 4) AS QtyReserved ,
ROUND(BOMQtyAvailable(obl.M_Product_ID,obl.M_Warehouse_ID,0),4) AS QtyAvailable ,
obl.M_Warehouse_ID ,
obl.QtyBom ,
obl.isQtyPercentage ,
ROUND(obl.QtyBatch,4) AS QtyBatch ,
l.M_Locator_ID ,
s.m_attributesetinstance_id,
l.x ,
l.y ,
l.z
FROM MPC_Order_BOMLine obl INNER JOIN MPC_Order o ON (o.MPC_Order_ID = obl.MPC_Order_ID) LEFT OUTER JOIN M_Storage s ON ( s.M_Product_ID = obl.M_Product_ID AND s.QtyOnHand <> 0 AND obl.M_Warehouse_ID = (SELECT ld.M_Warehouse_ID FROM M_Locator ld WHERE s.M_Locator_ID=ld.M_Locator_ID)) LEFT OUTER JOIN M_Locator l ON (l.M_Locator_ID = s.M_Locator_ID) ORDER BY obl.M_Product_ID
;
CREATE OR REPLACE VIEW RV_MPC_Order_Transactions AS
SELECT DISTINCT o.AD_Client_ID,o.AD_Org_ID, o.IsActive, o.Created, o.CreatedBy, o.UpdatedBy, o.Updated,o.DocumentNo,ol.M_Product_ID, mt.M_Locator_ID,mt.MovementDate,o.MPC_Order_ID,
o.QtyDelivered, o.QtyScrap ,ol.QtyDelivered AS QtyDeliveredLine , (o.QtyDelivered * ol.QtyBatch)/100 AS QtyIssueShouldbe,
ol.QtyScrap AS QtyScrapLine , (o.QtyScrap * ol.QtyBatch)/100 AS QtyIssueScrapShouldBe , mt.CreatedBy AS CreatedByIssue, mt.UpdatedBy AS UpdatedByIssue,
(SELECT SUM(t.MovementQty) FROM M_Transaction t WHERE t.MPC_Order_BOMLine_ID=ol.MPC_Order_BOMLine_ID) AS QtyToDeliver,
((((o.QtyDelivered + o.QtyScrap) * ol.QtyBatch)/100) + (SELECT SUM(t.MovementQty) FROM M_Transaction t WHERE t.MPC_Order_BOMLine_ID = ol.MPC_Order_BOMLine_ID)) AS DifferenceQty
FROM MPC_Order o INNER JOIN MPC_Order_BOMLine ol ON (ol.MPC_Order_ID=o.MPC_Order_ID) LEFT JOIN M_Transaction mt ON( mt.MPC_Order_BOMLine_ID = ol.MPC_Order_BOMLine_ID)
;
--DROP VIEW RV_MPC_PRODUCT_BOMLINE ;
--DROP VIEW RV_MPC_PRODUCT_BOMLINE ;
CREATE OR REPLACE VIEW RV_MPC_PRODUCT_BOMLINE AS
SELECT
t.SeqNo,
t.LevelNo,
t.Levels,
t.AD_Client_ID ,
t.AD_Org_ID ,
t.CreatedBy ,
t.UpdatedBy ,
t.Updated ,
t.Created ,
t.AD_PInstance_ID,
bl.IsActive ,
bl.MPC_Product_BOM_ID,
bl.MPC_Product_BOMLine_ID ,
bl.Description,
bl.IsCritical ,
bl.ComponentType,
t.M_Product_ID ,
bl.C_UOM_ID ,
bl.IssueMethod,
bl.Line,
bl.M_AttributeSetInstance_ID,
bl.Scrap,
bl.ValidFrom,
bl.ValidTo,
bl.QtyBom,
bl.QtyBatch,
bl.isQtyPercentage
FROM MPC_Product_BOMLine bl RIGHT JOIN T_BOMLine t ON (t.MPC_Product_BOMLine_ID = bl.MPC_Product_BOMLine_ID) ORDER BY SeqNo ;
create view compiere.mpc_order_receipt_issue as
select
obl.mpc_order_bomline_id,
obl.iscritical,
p.value,
obl.m_product_id,
mos.name as productname,
mos.m_attributesetinstance_id,
asi.description as instancename,
mos.c_uom_id,
u.name as uomname,
obl.qtyrequiered,
obl.qtyreserved as qtyreserved_order,
mos.qtyonhand,
mos.qtyreserved as qtyreserved_storage,
mos.qtyavailable,
mos.m_locator_id,
mos.m_warehouse_id,
w.name as warehousename,
mos.qtybom,
mos.isqtypercentage,
mos.qtybatch,
obl.ComponentType,
mos.QtyRequiered - obl.QtyDelivered AS QtyOpen,
obl.mpc_order_id
from compiere.rv_mpc_order_storage mos
inner join compiere.mpc_order_bomline obl on mos.mpc_order_bomline_id = obl.mpc_order_bomline_id
inner join compiere.m_attributesetinstance asi on mos.m_attributesetinstance_id = asi.m_attributesetinstance_id
inner join compiere.c_uom u on mos.c_uom_id = u.c_uom_id
inner join compiere.m_product p on mos.m_product_id = p.m_product_id
inner join compiere.m_warehouse w on mos.m_warehouse_id = w.m_warehouse_id;

View File

@ -8,12 +8,19 @@ fi
. ./myEnvironment.sh Server
echo Import Adempiere - $ADEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
SUFFIX=""
SYSUSER=system
if [ $ADEMPIERE_DB_PATH = "postgresql" ]
then
SUFFIX="_pg"
SYSUSER=postgres
fi
echo Re-Create Adempiere User and import $ADEMPIERE_HOME/data/Adempiere.dmp - \($ADEMPIERE_DB_NAME\)
echo Re-Create Adempiere User and import $ADEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp - \($ADEMPIERE_DB_NAME\)
echo == The import will show warnings. This is OK ==
ls -lsa $ADEMPIERE_HOME/data/Adempiere.dmp
ls -lsa $ADEMPIERE_HOME/data/Adempiere${SUFFIX}.dmp
echo Press enter to continue ...
read in
# Parameter: <systemAccount> <AdempiereID> <AdempierePwd>
sh $ADEMPIERE_DB_PATH/ImportAdempiere.sh system/$ADEMPIERE_DB_SYSTEM $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD
sh $ADEMPIERE_DB_PATH/ImportAdempiere.sh $SYSUSER/$ADEMPIERE_DB_SYSTEM $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD

View File

@ -1,28 +0,0 @@
@Echo Adempiere Database Export $Revision: 1.2 $
@Rem $Id: DBExport.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
@Echo Saving database %1@%ADEMPIERE_DB_NAME% to %ADEMPIERE_HOME%\data\ExpDat.dmp
@if (%ADEMPIERE_HOME%) == () goto environment
@if (%ADEMPIERE_DB_NAME%) == () goto environment
@Rem Must have parameter: userAccount
@if (%1) == () goto usage
@exp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp Log=%ADEMPIERE_HOME%\data\ExpDat.log CONSISTENT=Y OWNER=Adempiere
@cd %ADEMPIERE_HOME%\Data
@jar cvfM ExpDat.jar ExpDat.dmp
@goto end
:environment
@Echo Please make sure that the enviroment variables are set correctly:
@Echo ADEMPIERE_HOME e.g. D:\Adempiere
@Echo ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org
:usage
@echo Usage: %0 <userAccount>
@echo Examples: %0 adempiere/adempiere
:end

View File

@ -2,7 +2,23 @@ echo Adempiere PostgreSQL Database Export $Revision: 1.3 $
# $Id: DBExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
echo Saving database $1@$ADEMPIERE_DB_NAME to $ADEMPIERE_HOME/data/ExpDat.dump.tar.gz
echo Saving database $1@$ADEMPIERE_DB_NAME to $ADEMPIERE_HOME/data/ExpDat.dmp
pg_dump -F c -f $ADEMPIERE_HOME/data/ExpDat.dump.tar.gz adempiere
if [ $# -eq 0 ]
then
echo "Usage: $0 <userAccount>"
echo "Example: $0 adempiere adempiere"
exit 1
fi
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
then
echo "Please make sure that the environment variables are set correctly:"
echo " ADEMPIERE_HOME e.g. /Adempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
exit 1
fi
pg_dump $ADEMPIERE_DB_NAME > $ADEMPIERE_HOME/data/ExpDat.dmp
cd $ADEMPIERE_HOME/data
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log

View File

@ -1,28 +0,0 @@
@Echo Adempiere Full Database Export $Revision: 1.2 $
@Rem $Id: DBExportFull.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
@Echo Saving database %1@%ADEMPIERE_DB_NAME% to %ADEMPIERE_HOME%\data\ExpDatFull.dmp
@if (%ADEMPIERE_HOME%) == () goto environment
@if (%ADEMPIERE_DB_NAME%) == () goto environment
@Rem Must have parameter: systemAccount
@if (%1) == () goto usage
@exp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDatFull.dmp Log=%ADEMPIERE_HOME%\data\ExpDat.log CONSISTENT=Y FULL=Y
@cd %ADEMPIERE_HOME%\data
@jar cvfM data\ExpDatFull.jar ExpDatFull.dmp
@goto end
:environment
@Echo Please make sure that the enviroment variables are set correctly:
@Echo ADEMPIERE_HOME e.g. D:\Adempiere
@Echo ADEMPIERE_DB_NAME e.g. dev1.adempiere.org
:usage
@echo Usage: %0 <systemAccount>
@echo Examples: %0 system/manager
:end

View File

@ -1,25 +0,0 @@
echo Adempiere Full Database Export $Revision: 1.2 $
# $Id: DBExportFull.sh,v 1.2 2005/01/22 21:59:15 jjanke Exp $
echo Saving database $1@$ADEMPIERE_DB_NAME to $ADEMPIERE_HOME/data/ExpDatFull.dmp
if [ $# -eq 0 ]
then
echo "Usage: $0 <systemAccount>"
echo "Example: $0 system/manager"
exit 1
fi
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
then
echo "Please make sure that the environment variables are set correctly:"
echo " ADEMPIERE_HOME e.g. /Adempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
exit 1
fi
exp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDatFull.dmp Log=$ADEMPIERE_HOME/data/ExpDat.log CONSISTENT=Y FULL=Y
cd $ADEMPIERE_HOME/data
jar cvfM ExpDatFull.jar ExpDatFull.dmp

View File

@ -1,41 +0,0 @@
@Echo Adempiere Database Restore $Revision: 1.2 $
@Rem $Id: DBRestore.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
@Echo Restoring Adempiere DB from %ADEMPIERE_HOME%\data\ExpDat.dmp
@if (%ADEMPIERE_HOME%) == () goto environment
@if (%ADEMPIERE_DB_NAME%) == () goto environment
@Rem Must have parameter: systemAccount adempiereID AdempierePwd
@if (%1) == () goto usage
@if (%2) == () goto usage
@if (%3) == () goto usage
@echo -------------------------------------
@echo Re-Create DB user
@echo -------------------------------------
@sqlplus %1@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\CreateUser.sql %2 %3
@echo -------------------------------------
@echo Import ExpDat
@echo -------------------------------------
@imp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp FROMUSER=(%2) TOUSER=%2
@echo -------------------------------------
@echo Check System
@echo Import may show some warnings. This is OK as long as the following does not show errors
@echo -------------------------------------
@sqlplus %2/%3@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\AfterImport.sql
@goto end
:environment
@Echo Please make sure that the enviroment variables are set correctly:
@Echo ADEMPIERE_HOME e.g. D:\Adempiere
@Echo ADEMPIERE_DB_NAME e.g. dev1.adempiere.org
:usage
@echo Usage: %0% <systemAccount> <AdempiereID> <AdempierePwd>
@echo Example: %0% system/manager adempiere adempiere
:end

View File

@ -1,37 +0,0 @@
echo Adempiere Database Restore $Revision: 1.2 $
# $Id: DBRestore.sh,v 1.2 2005/01/22 21:59:15 jjanke Exp $
echo Restoring Adempiere DB from $ADEMPIERE_HOME/data/ExpDat.dmp
if [ $# -le 2 ]
then
echo "Usage: $0 <systemAccount> <AdempiereID> <AdempierePWD>"
echo "Example: $0 system/manager adempiere adempiere"
exit 1
fi
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
then
echo "Please make sure that the environment variables are set correctly:"
echo " ADEMPIERE_HOME e.g. /Adempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
exit 1
fi
echo -------------------------------------
echo Re-Create DB user
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/CreateUser.sql $2 $3
echo -------------------------------------
echo Import ExpDat
echo -------------------------------------
imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp FROMUSER=($2) TOUSER=$2
echo -------------------------------------
echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors
echo -------------------------------------
sqlplus $2/$3@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/AfterImport.sql

View File

@ -1,6 +1,5 @@
echo Adempiere Database Import $Revision: 1.2 $
# $Id: ImportAdempiere.sh,v 1.2 2005/01/22 21:59:15 jjanke Exp $
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
echo Adempiere Database Import $Revision: 1.10 $
echo Importing Adempiere DB from $ADEMPIERE_HOME/data/Adempiere.dmp
@ -20,17 +19,22 @@ fi
echo -------------------------------------
echo Re-Create DB user
echo Recreate user and database
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/CreateUser.sql $2 $3
dropdb -U postgres $ADEMPIERE_DB_NAME
dropuser -U postgres $ADEMPIERE_DB_USER
createuser -U postgres -a -d $ADEMPIERE_DB_USER
createdb $ADEMPIERE_DB_NAME -E UNICODE -O $ADEMPIERE_DB_USER -U $ADEMPIERE_DB_USER
echo -------------------------------------
echo Import Adempiere.dmp
echo Import Adempiere_pg.dmp
echo -------------------------------------
imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Adempiere.dmp FROMUSER=($2) TOUSER=$2
psql -d $ADEMPIERE_DB_NAME -U $ADEMPIERE_DB_USER -f $ADEMPIERE_HOME/data/Adempiere_pg.dmp
echo -------------------------------------
echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors
echo Create SQLJ
echo -------------------------------------
sqlplus $2/$3@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/AfterImport.sql
# $ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/create.sh $ADEMPIERE_DB_USER/$ADEMPIERE_DB_PASSWORD

View File

@ -1,39 +0,0 @@
@Echo Adempiere Reference Database Import $Revision: 1.2 $
@Rem $Id: ImportReference.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
@Echo Importing Reference DB from %ADEMPIERE_HOME%\data\Reference.dmp
@if (%ADEMPIERE_HOME%) == () goto environment
@if (%ADEMPIERE_DB_NAME%) == () goto environment
@Rem Must have parameter: systemAccount
@if (%1) == () goto usage
@echo -------------------------------------
@echo Re-Create new user
@echo -------------------------------------
@sqlplus %1@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\CreateUser.sql Reference Adempiere
@echo -------------------------------------
@echo Import Reference
@echo -------------------------------------
@imp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\Reference.dmp FROMUSER=(reference) TOUSER=reference
@echo -------------------------------------
@echo Check System
@echo Import may show some warnings. This is OK as long as the following does not show errors
@echo -------------------------------------
@sqlplus reference/adempiere@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\AfterImport.sql
@goto end
:environment
@Echo Please make sure that the enviroment variables are set correctly:
@Echo ADEMPIERE_HOME e.g. D:\Adempiere
@Echo ADEMPIERE_DB_NAME e.g. dev1.adempiere.org
:usage
@echo Usage: %0 <systemAccount>
@echo Examples: %0 system/manager
:end

View File

@ -1,37 +0,0 @@
echo Adempiere Reference Database Import $Revision: 1.2 $
# $Id: ImportReference.sh,v 1.2 2005/01/22 21:59:15 jjanke Exp $
echo Importing Reference DB from $ADEMPIERE_HOME/data/Reference.dmp
if [ $# -eq 2 ]
then
echo "Usage: $0 <systemAccount>"
echo "Example: $0 system/manager"
exit 1
fi
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
then
echo "Please make sure that the environment variables are set correctly:"
echo " ADEMPIERE_HOME e.g. /Adempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
exit 1
fi
echo -------------------------------------
echo Re-Create new user
echo -------------------------------------
sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/CreateUser.sql Reference Adempiere
echo -------------------------------------
echo Import Reference
echo -------------------------------------
imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Reference.dmp FROMUSER=(reference) TOUSER=reference
echo -------------------------------------
echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors
echo -------------------------------------
sqlplus reference/adempiere@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/AfterImport.sql

View File

@ -1,5 +1,2 @@
-- Connection Test
SELECT 'Success ' AS Connection FROM DUAL
/
EXIT
SELECT 'Success ' AS Connection;