IDEMPIERE-114 Server installer broken

This commit is contained in:
Carlos Ruiz 2013-04-10 09:17:56 -05:00
parent 07551b1ebe
commit 814ecd6c9e
19 changed files with 515 additions and 30 deletions

View File

@ -10,6 +10,6 @@ target.os=*
target.ws=* target.ws=*
target.arch=* target.arch=*
product.features=org.idempiere.eclipse.platform.feature.group product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.profile=DefaultProfile product.profile=DefaultProfile
product.id=org.adempiere.server.product product.id=org.adempiere.server.product

View File

@ -10,6 +10,6 @@ target.os=solaris
target.ws=gtk target.ws=gtk
target.arch=x86 target.arch=x86
product.features=org.idempiere.eclipse.platform.feature.group product.features=org.idempiere.eclipse.platform.feature.group, org.idempiere.fitnesse.feature.group
product.profile=DefaultProfile product.profile=DefaultProfile
product.id=org.adempiere.server.product product.id=org.adempiere.server.product

View File

@ -30,11 +30,6 @@ echo Import ExpDat
echo ------------------------------------- echo -------------------------------------
imp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/ExpDat.dmp FROMUSER=\($2\) TOUSER=$2 imp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/ExpDat.dmp FROMUSER=\($2\) TOUSER=$2
echo -------------------------------------
echo Create SQLJ
echo -------------------------------------
$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/create.sh $ADEMPIERE_DB_USER/$ADEMPIERE_DB_PASSWORD
echo ------------------------------------- echo -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors echo Import may show some warnings. This is OK as long as the following does not show errors

View File

@ -37,11 +37,6 @@ echo Import ExpDat
echo ------------------------------------- echo -------------------------------------
impdp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS=$2 impdp $1@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS=$2
echo -------------------------------------
echo Create SQLJ
echo -------------------------------------
$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/create.sh $ADEMPIERE_DB_USER/$ADEMPIERE_DB_PASSWORD
echo ------------------------------------- echo -------------------------------------
echo Check System echo Check System
echo Import may show some warnings. This is OK as long as the following does not show errors echo Import may show some warnings. This is OK as long as the following does not show errors

View File

@ -65,3 +65,5 @@ BEGIN
DBMS_OUTPUT.PUT_LINE ('End'); DBMS_OUTPUT.PUT_LINE ('End');
COMMIT; COMMIT;
END; END;
/

View File

@ -0,0 +1,112 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: AfterImport.sql,v 1.2 2006/05/28 22:52:07 jjanke Exp $
***
* Title: After Import
* Description:
* - General Info
* - Create Context
* - Check Imported User and list ivalid objects
* You can ignore import warnings as long as this does not
* return error messages or records.
************************************************************************/
SELECT 'DB_Name=' || SYS_CONTEXT('USERENV', 'DB_NAME')
|| ', Language=' || SYS_CONTEXT('USERENV', 'LANGUAGE')
|| ', Host=' || SYS_CONTEXT('USERENV', 'HOST')
|| ', IP=' || SYS_CONTEXT('USERENV', 'IP_ADDRESS')
|| ', User=' || SYS_CONTEXT('USERENV', 'CURRENT_USER')
|| ', ID=' || SYS_CONTEXT('USERENV', 'CURRENT_USERID')
|| ', Session=' || SYS_CONTEXT('USERENV', 'SESSIONID')
AS "DBInfo"
FROM DUAL
/
SET serveroutput ON
-- Recompile invalids
BEGIN
DBA_Cleanup();
DBA_AfterImport;
-- DBA_Recompile(NULL); -- called in DBA_AfterImport
END;
/
-- Correct DataFile sizing
DECLARE
CURSOR Cur_TS IS
SELECT FILE_NAME, Tablespace_Name, Bytes/1024/1024 as MB
FROM DBA_DATA_FILES
WHERE (TABLESPACE_NAME='USERS' AND BYTES < 100*1024*1024)
OR (TABLESPACE_NAME='INDX' AND BYTES < 100*1024*1024)
OR (TABLESPACE_NAME='TEMP' AND BYTES < 100*1024*1024);
v_CMD VARCHAR2(300);
BEGIN
FOR ts IN Cur_TS LOOP
DBMS_OUTPUT.PUT_LINE('Resize:');
v_CMD := 'ALTER DATABASE DATAFILE ''' || ts.FILE_NAME
|| ''' RESIZE 100M';
DBMS_OUTPUT.PUT_LINE(' executing: ' || v_CMD);
EXECUTE IMMEDIATE v_CMD;
v_CMD := 'ALTER DATABASE DATAFILE ''' || ts.FILE_NAME
|| ''' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED';
DBMS_OUTPUT.PUT_LINE(' executing: ' || v_CMD);
EXECUTE IMMEDIATE v_CMD;
END LOOP;
END;
/
/** Database Sizing
** Oracle 10g should use Automatic Shared Memory Management -
** Example 300MB
*
* ALTER SYSTEM documentation
http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_2013.htm#SQLRF00902
*
SELECT Name, Value, Description, IsDefault FROM v$parameter
WHERE Name LIKE '%cursor%' OR Name LIKE '%process%' OR NAME LIKE '%servers%' ORDER BY 1
/
SELECT Name, Value/1024/1024 "MB", Description, IsDefault, Update_Comment FROM v$parameter
WHERE Name LIKE '%_pool_size' OR Name LIKE 'sga%'
/
ALTER SYSTEM SET statistics_level = TYPICAL Comment='Adempiere' SCOPE=BOTH
/
ALTER SYSTEM SET sga_target = 314572800 Comment='Adempiere' SCOPE=BOTH
/
ALTER SYSTEM SET open_cursors = 900 Comment='Adempiere' SCOPE=BOTH
/
/** Oracle 9i needs to set explicitly (and restart)
** Example 300MB
ALTER SYSTEM SET sga_max_size=314572800 SCOPE=SPFILE
/
ALTER SYSTEM SET large_pool_size=33554432 SCOPE=SPFILE
/
ALTER SYSTEM SET java_pool_size=67108864 SCOPE=SPFILE
/
/** SELECT 32*1024*1024 FROM DUAL **/
-- Any invalids
SELECT Object_Type "Type", Object_Name "Invalid", Status
FROM User_Objects
WHERE Status <> 'VALID'
/
-- Trigger Info
SELECT Trigger_Name AS Trigger_NotEnabled, Status
FROM User_Triggers
WHERE Status != 'ENABLED'
/
-- Constraint Info
SELECT Constraint_Name AS Constraint_Problem, Status, Validated, Table_Name, Search_Condition, R_Constraint_Name
FROM User_Constraints
WHERE Status <> 'ENABLED' OR Validated <> 'VALIDATED'
/
SELECT *
FROM USER_ERRORS
/
COMMIT
/
EXIT

View File

@ -0,0 +1,94 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BackupCold.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Cold Backup
* Description:
* Generate OS cold Backup script
* Change the parameter variables p_ as required
* Run as system
************************************************************************/
SPOOL BackupCold.bat
DECLARE
p_backupLocation VARCHAR2(255) := 'D:\Backup';
p_unix BOOLEAN := FALSE;
p_useZip BOOLEAN := TRUE;
p_zipCmd VARCHAR(60) := 'wzzip ';
--
v_delimiter VARCHAR(10);
v_remark VARCHAR(10);
v_copy VARCHAR(60);
v_sid VARCHAR(30);
v_cmd VARCHAR2(2000);
--
CURSOR CUR_DataFiles IS
SELECT Name
FROM v$datafile;
CURSOR CUR_CtlFiles IS
SELECT Name
FROM v$controlfile;
BEGIN
-- OS Specifics
IF (p_unix) THEN
v_delimiter := '/';
v_remark := '# ';
v_copy := 'cp ';
ELSE
v_delimiter := '\';
v_remark := 'Rem ';
v_copy := 'copy ';
END IF;
--
SELECT Value
INTO v_sid
FROM v$parameter
WHERE Name ='instance_name';
p_backupLocation := p_backupLocation || v_delimiter || v_sid;
--
DBMS_OUTPUT.PUT_LINE(v_remark || 'Backup script for "' || v_sid || '" to ' || p_backupLocation);
DBMS_OUTPUT.PUT_LINE(v_remark || 'This script is automatically created by ColdBackup.sql and may need to be edited';
DBMS_OUTPUT.NEW_LINE;
--
DBMS_OUTPUT.PUT_LINE(v_remark || 'mkdir ' || p_backupLocation);
DBMS_OUTPUT.NEW_LINE;
DBMS_OUTPUT.PUT_LINE('sqlplus "system/manager@%AccortoDBService% AS SYSDBA" @%AccortoHome%\util\orastop.sql');
DBMS_OUTPUT.NEW_LINE;
IF (p_useZip) THEN
DBMS_OUTPUT.PUT_LINE(p_zipCmd || p_backupLocation || v_delimiter || v_sid || '.zip ');
DBMS_OUTPUT.PUT(' ');
END IF;
FOR f IN CUR_DataFiles LOOP
IF (p_useZip) THEN
DBMS_OUTPUT.PUT(' ' || f.Name);
ELSE
DBMS_OUTPUT.PUT_LINE(v_copy || f.Name || ' ' || p_backupLocation);
END IF;
END LOOP;
IF (p_useZip) THEN
DBMS_OUTPUT.NEW_LINE;
DBMS_OUTPUT.PUT(' ');
END IF;
FOR f IN CUR_CtlFiles LOOP
IF (p_useZip) THEN
DBMS_OUTPUT.PUT(' ' || f.Name);
ELSE
DBMS_OUTPUT.PUT_LINE(v_copy || f.Name || ' ' || p_backupLocation);
END IF;
END LOOP;
IF (p_useZip) THEN
DBMS_OUTPUT.NEW_LINE;
END IF;
DBMS_OUTPUT.NEW_LINE;
DBMS_OUTPUT.PUT_LINE('sqlplus "system/manager@%AccortoDBService% AS SYSDBA" @%AccortoHome%\util\orastart.sql');
END;
/
SPOOL OFF
EXIT

View File

@ -0,0 +1,21 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BeforeExport.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Before Export
* Description:
* - Delete Temporary Data
************************************************************************/
DELETE T_Report
/
DELETE T_Replenish
/
DELETE T_Spool
/
EXIT

View File

@ -0,0 +1,93 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2003 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: CheckDB.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: TabeSpace Sizing
* Description:
* Make sure, that Tablespace
* USERS is 150 MB, 10 MB Autoextend
* INDX is 100 MB, 10 MB Autoextend
* TEMP is 100 MB, 10 MB Autoextend
* Set SGA Size (optional)
* Executed with System user and parameter %ADEMPIERE_DB_USER% from RUN_Env
************************************************************************/
-- Check existance
SELECT 'Tablespace USERS does not exist - You need to create it first' AS Missing FROM DUAL
WHERE NOT EXISTS (SELECT * FROM DBA_TABLESPACES WHERE TABLESPACE_NAME='USERS');
SELECT 'Tablespace INDX does not exist - You need to create it first' AS Missing FROM DUAL
WHERE NOT EXISTS (SELECT * FROM DBA_TABLESPACES WHERE TABLESPACE_NAME='INDX');
SELECT 'Tablespace TEMP does not exist - You need to create it first' AS Missing FROM DUAL
WHERE NOT EXISTS (SELECT * FROM DBA_TABLESPACES WHERE TABLESPACE_NAME='TEMP');
/*****
* Changing System Parameters
* directly - (e.g. 400 MB for 10 Users)
ALTER SYSTEM SET SGA_MAX_SIZE=400M COMMENT='400MB' SCOPE=SPFILE;
ALTER SYSTEM SET SHARED_POOL_SIZE=100M SCOPE=SPFILE;
ALTER SYSTEM SET DB_CACHE_SIZE=200M SCOPE=SPFILE;
ALTER SYSTEM SET JAVA_POOL_SIZE=40M SCOPE=SPFILE;
ALTER SYSTEM SET LARGE_POOL_SIZE=10M SCOPE=SPFILE;
** indirectly - sqlplus "system/manager@adempiere AS SYSDBA"
CREATE PFile='pfileAdempiere.ora' FROM SPFile;
* creates file in $ORACLE_HOME\database or $ORACLE_HOME/dbs
* edit file and then overwrite the fila via
CREATE SPFile FROM PFile='pfileAdempiere.ora';
*****/
-- Create System Record - OK, if it fails
-- Schema is parameter.
INSERT INTO &1..AD_System
(AD_System_ID,AD_Client_ID,AD_Org_ID,
IsActive,Created,CreatedBy,Updated,UpdatedBy,
Name, UserName, Info)
SELECT 0,0,0,'Y', SysDate,0,SysDate,0, '?','?','?'
FROM Dual
WHERE NOT EXISTS
(SELECT * FROM &1..AD_System WHERE AD_System_ID=0);
-- Add Info - OK, if fails
UPDATE &1..AD_System
SET Info = (SELECT SYS_CONTEXT('USERENV', 'DB_DOMAIN')
|| ',' || SYS_CONTEXT('USERENV', 'DB_NAME')
|| ',IP=' || SYS_CONTEXT('USERENV', 'IP_ADDRESS')
|| ',' || SYS_CONTEXT('USERENV', 'HOST')
|| ',' || SYS_CONTEXT('USERENV', 'INSTANCE')
|| ',UID=' || SYS_CONTEXT('USERENV', 'CURRENT_USER')
|| ',' || SYS_CONTEXT('USERENV', 'CURRENT_USERID')
|| ',C#=' || (SELECT COUNT(*) FROM &1..AD_Client)
FROM DUAL),
Updated=SysDate;
COMMIT;
set serveroutput on
-- Correct sizing
DECLARE
CURSOR Cur_TS IS
SELECT FILE_NAME, Tablespace_Name, Bytes/1024/1024 as MB
FROM DBA_DATA_FILES
WHERE (TABLESPACE_NAME='USERS' AND BYTES < 100*1024*1024)
OR (TABLESPACE_NAME='INDX' AND BYTES < 100*1024*1024)
OR (TABLESPACE_NAME='TEMP' AND BYTES < 100*1024*1024);
v_CMD VARCHAR2(300);
BEGIN
DBMS_OUTPUT.PUT_LINE('Resize:');
FOR ts IN Cur_TS LOOP
v_CMD := 'ALTER DATABASE DATAFILE ''' || ts.FILE_NAME
|| ''' RESIZE 100M';
DBMS_OUTPUT.PUT_LINE(' executing: ' || v_CMD);
EXECUTE IMMEDIATE v_CMD;
v_CMD := 'ALTER DATABASE DATAFILE ''' || ts.FILE_NAME
|| ''' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED';
DBMS_OUTPUT.PUT_LINE(' executing: ' || v_CMD);
EXECUTE IMMEDIATE v_CMD;
END LOOP;
END;
/
EXIT

View File

@ -0,0 +1,18 @@
SET ECHO ON
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: CreateUser.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Create or replace directory for data pump
* Description:
* Parameter: Directory
* Run as system
************************************************************************/
CREATE OR REPLACE DIRECTORY ADEMPIERE_DATA_PUMP_DIR AS '&1'
/
EXIT

View File

@ -0,0 +1,36 @@
SET ECHO ON
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: CreateUser.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Drop User and re-create new
* Description:
* Parameter: UserID UserPwd
* Run as system
************************************************************************/
DROP USER &1 CASCADE
/
CREATE USER &1 IDENTIFIED BY &2
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK
/
GRANT CONNECT TO &1
/
GRANT DBA TO &1
/
GRANT RESOURCE TO &1
/
GRANT UNLIMITED TABLESPACE TO &1
/
ALTER USER &1 DEFAULT ROLE CONNECT, RESOURCE, DBA
/
GRANT CREATE TABLE TO &1
/
EXIT

View File

@ -23,11 +23,6 @@
@echo ------------------------------------- @echo -------------------------------------
@imp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% FILE=%IDEMPIERE_HOME%\data\ExpDat.dmp FROMUSER=(%2) TOUSER=%2 STATISTICS=RECALCULATE @imp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% FILE=%IDEMPIERE_HOME%\data\ExpDat.dmp FROMUSER=(%2) TOUSER=%2 STATISTICS=RECALCULATE
@echo -------------------------------------
@echo Create SQLJ
@echo -------------------------------------
@call %IDEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\create %ADEMPIERE_DB_USER%/%ADEMPIERE_DB_PASSWORD%
@echo ------------------------------------- @echo -------------------------------------
@echo Check System @echo Check System
@echo Import may show some warnings. This is OK as long as the following does not show errors @echo Import may show some warnings. This is OK as long as the following does not show errors

View File

@ -28,11 +28,6 @@
@echo ------------------------------------- @echo -------------------------------------
@impdp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS=%2 @impdp %1@%ADEMPIERE_DB_SERVER%:%ADEMPIERE_DB_PORT%/%ADEMPIERE_DB_NAME% DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=ExpDat.dmp SCHEMAS=%2
@echo -------------------------------------
@echo Create SQLJ
@echo -------------------------------------
@call %IDEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\create %ADEMPIERE_DB_USER%/%ADEMPIERE_DB_PASSWORD%
@echo ------------------------------------- @echo -------------------------------------
@echo Check System @echo Check System
@echo Import may show some warnings. This is OK as long as the following does not show errors @echo Import may show some warnings. This is OK as long as the following does not show errors

View File

@ -0,0 +1,23 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: Daily.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Daily Tasks
* Description:
* - Recompile
* - Cleanup
************************************************************************/
DECLARE
Result VARCHAR2(2000);
BEGIN
DBA_Recompile(Result);
DBMS_OUTPUT.PUT_LINE(Result);
DBA_Cleanup();
END;
/
EXIT

View File

@ -0,0 +1,18 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2003 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: Start.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Start Database
* Description:
* Start the script via
* sqlplus "system/$ADEMPIERE_DB_SYSTEM AS SYSDBA" @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Start.sql
************************************************************************/
set pause off
set echo on
startup
exit

View File

@ -0,0 +1,19 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2003 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: Stop.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Stop Database and save configuration in trace
* Description:
* Start the script via
* sqlplus "system/$ADEMPIERE_DB_SYSTEM AS SYSDBA" @$IDEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Stop.sql
************************************************************************/
set pause off
set echo on
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
shutdown transactional
exit

View File

@ -0,0 +1,17 @@
/*************************************************************************
* $Id: CreateUser.sql,v 1.1 2006/12/27 17:51:58 globalqss Exp $
***
* Title: Drop User and re-create new
* Description:
* Parameter: UserID UserPwd
* Run as postgres
************************************************************************/
DROP DATABASE &1;
DROP USER &1;
CREATE USER &1 WITH CREATEDB CREATEUSER PASSWORD '&2'
CREATE DATABASE &1
WITH ENCODING='UNICODE'
OWNER=&1;

View File

@ -0,0 +1,49 @@
/*************************************************************************
* The contents of this file are subject to the Adempiere License. You may
* obtain a copy of the License at http://www.adempiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Adempiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: Daily.sql,v 1.1 2006/12/27 globalqss Exp $
***
* Title: Daily Tasks
* Description:
* - Cleanup
************************************************************************/
-- Temporary Tables
DELETE FROM T_Aging;
DELETE FROM T_DistributionRunDetail;
DELETE FROM T_InventoryValue;
DELETE FROM T_Replenish;
DELETE FROM T_Report;
DELETE FROM T_ReportStatement;
DELETE FROM T_TrialBalance;
DELETE FROM T_Selection;
DELETE FROM T_Selection2;
DELETE FROM T_Spool;
-- Search Info
DELETE FROM AD_Find;
-- Processes older than a week
DELETE FROM AD_PInstance WHERE Created < now()-7;
-- Errors older than 1 week
DELETE FROM AD_Error WHERE Created < now()-7;
-- Acknowledged Notes older than a day
DELETE FROM AD_Note WHERE Processed='Y' AND Updated < now()-1;
--
COMMIT;

View File

@ -403,16 +403,19 @@ public class ConfigOracle implements IDatabaseConfig
data.setProperty(ConfigurationData.ADEMPIERE_DB_USER, databaseUser); data.setProperty(ConfigurationData.ADEMPIERE_DB_USER, databaseUser);
data.setProperty(ConfigurationData.ADEMPIERE_DB_PASSWORD, databasePassword); data.setProperty(ConfigurationData.ADEMPIERE_DB_PASSWORD, databasePassword);
data.setProperty(ConfigurationData.ADEMPIERE_DB_EXISTS, (isDBExists ? "Y" : "N")); data.setProperty(ConfigurationData.ADEMPIERE_DB_EXISTS, (isDBExists ? "Y" : "N"));
String ospath; String testFile = "utils/oracle/Test.sql";
if (System.getProperty("os.name").startsWith("Windows"))
ospath = "windows";
else
ospath = "unix";
String testFile = "utils." + ospath + "/oracle/Test.sql";
if (! new File(testFile).isFile()) { if (! new File(testFile).isFile()) {
testFile = "org.adempiere.server-feature/" + testFile; String ospath;
if (System.getProperty("os.name").startsWith("Windows"))
ospath = "windows";
else
ospath = "unix";
testFile = "utils." + ospath + "/oracle/Test.sql";
if (! new File(testFile).isFile()) { if (! new File(testFile).isFile()) {
testFile = null; testFile = "org.adempiere.server-feature/" + testFile;
if (! new File(testFile).isFile()) {
testFile = null;
}
} }
} }
if (testFile != null) { if (testFile != null) {