Elxis CMS Forum

Support => Database => Topic started by: Ahmad Said on October 29, 2008, 14:30:15

Title: Oracle Problem on adding new module
Post by: Ahmad Said on October 29, 2008, 14:30:15
hi all i have aproblem in adding new module -----> uniqe constrain , the problem is get new id from the seq of module
i solve the one for adding componnet by adding id as select max(nvl(id,0))+ 1 from #__component, but with module untill now i cant
Title: Re: Oracle Problem on adding new module
Post by: datahell on October 29, 2008, 14:47:33
Marked for fix.
Title: Re: Oracle Problem on adding new module
Post by: muharihar on October 30, 2008, 06:10:06
try this....

execute this sql script from your oracle sql query/script tool:
-------------------------------------------------------------

DECLARE
   --SEQ_ELX_MODULES   
   --Replace ELX_ with your Elxis Table Prefix
   max_seq_elx_modules   NUMBER (12);
   id_elx_modules        NUMBER (12);
BEGIN
-- SEQ_ELX_MODULES = elx_MODULES
   SELECT NVL (MAX (a.ID), 1)
     INTO id_elx_modules
     FROM elx_modules a;

   SELECT seq_elx_modules.NEXTVAL
     INTO max_seq_elx_modules
     FROM DUAL;

   /*
   DBMS_OUTPUT.put_line (   'Tabel elx_MODULES, id = '
                         || id_elx_modules
                         || ', seq = '
                         || max_seq_elx_modules
                        );
   */
   IF id_elx_modules > max_seq_elx_modules
   THEN
       /*
      DBMS_OUTPUT.put_line ('Looping...');
      */
      WHILE max_seq_elx_modules < id_elx_modules
      LOOP
           /*
         DBMS_OUTPUT.put_line (   ' - increment id = '
                                 || id_elx_modules
                                 || ', seq = '
                                 || max_seq_elx_modules
                                );
           */
         IF max_seq_elx_modules > id_elx_modules
         THEN
            EXIT;
         END IF;

         SELECT seq_elx_modules.NEXTVAL
           INTO max_seq_elx_modules
           FROM DUAL;
      END LOOP;
   END IF;
END;


------------------------------------------
if you want to use this query (srcipt) for another sequence problem, replace "ELX_" with your Elxis Table Prefix.... ;D

thank....
sorry for my english....
Title: Re: Oracle Problem on adding new module
Post by: Ahmad Said on November 02, 2008, 12:34:00
grat muharihar
am try it and its work 100%
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 20, 2008, 11:26:20
How can I install Elxis with oracle 10g, windows. Pls help me.
Title: Re: Oracle Problem on adding new module
Post by: datahell on November 20, 2008, 12:35:16
Elxis installation procedure is the same for any database type.
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 20, 2008, 12:49:39
Elxis installation procedure is the same for any database type.
can you help me? step by step installation. Then, where I write some configuration?
I stopped in the step3. (http://202.131.226.190/install.jpg)
Title: Re: Oracle Problem on adding new module
Post by: datahell on November 20, 2008, 13:28:22
The Oracle default port is 1521 so you dont have to enter the port in the host.
If Oracle resides on the same machine as Elxis you can enter localhost instead of the ip address.

Host name: localhost (or 172.15.0.10)
Database type: oci8 (the database type is the adodb's driver used to connect to your database, use oci8 for oracle)
Database name: The database name (your oracle user name)
Database path: leave this empty
Database table prefix: elx_
Database username: your oracle user name
Database password: your oracle password
Database verify password: your oracle password (again)
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 20, 2008, 15:34:43
Database type: oci8 (the database type is the adodb's driver used to connect to your database, use oci8 for oracle)

but there has not oci8.
there has oracle 7, oracle 8.0.5 , oracle 8/9, oracle (odbc)

I have this error
"
Warning: ocilogon() [function.ocilogon]: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in C:\AppServ\www\elxis\includes\adodb\drivers\adodb-oci8.inc.php on line 228

Warning: ocilogon() [function.ocilogon]: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in C:\AppServ\www\elxis\includes\adodb\drivers\adodb-oci8.inc.php on line 228
"

My listener file is
"
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = batorgil)(PORT = 1521))
    )
  )

"
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 20, 2008, 17:50:42
I have some error
"At least one fatal error occured during the previous step. You cannot continue. Please go back and correct the database settings. The Elxis installer error messages follows:

  • Could not connect to the database.
"

my configuration :

database type : ADO(generic) and oracle 7 but I have not good result. :)  ;D

Pls help me pls pls
Title: Re: Oracle Problem on adding new module
Post by: datahell on November 20, 2008, 18:21:46
Use oci8 or oci805 driver:
Oracle 8.0.5: this is oci805
Oracle 8/9: this is oci8

Both drivers work fine for Oracle 10/11g

Check also that in the Elxis installer's first page Oracle database is highlighted in green (supported). If not you must enable the corresponding dll file in php.ini (php_oci8.dll).
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 21, 2008, 05:18:26
Dear datahell.
I have one more problem. this is
"
Warning: ocilogon() [function.ocilogon]: Invalid character set name: utf8 in C:\AppServ\www\j&o\includes\adodb\drivers\adodb-oci8.inc.php on line 231
Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\AppServ\www\j&o\includes\adodb\drivers\adodb-oci8.inc.php on line 231
Warning: ocilogon() [function.ocilogon]: Invalid character set name: utf8 in C:\AppServ\www\j&o\includes\adodb\drivers\adodb-oci8.inc.php on line 231
Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\AppServ\www\j&o\includes\adodb\drivers\adodb-oci8.inc.php on line 231

"

What do I do?
Title: Re: Oracle Problem on adding new module
Post by: datahell on November 21, 2008, 08:09:38
I think this is because you might have not set up Oracle to support international characters. I am not an oracle expert and I can not see your database from here to help you more with this. Why dont you try with MySQL or ProstgreSQL as you face too many problems with Oracle?
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 21, 2008, 08:33:12
I think this is because you might have not set up Oracle to support international characters. I am not an oracle expert and I can not see your database from here to help you more with this. Why dont you try with MySQL or ProstgreSQL as you face too many problems with Oracle?
Thanks your for support.
Our database's character set is RU8PC866. theh, Can I change elxis's character set. how can I change elxis character set?

thank you your for support.
Title: Re: Oracle Problem on adding new module
Post by: datahell on November 21, 2008, 11:35:38
Elxis uses UTF-8 encoding in everything. You should set your database's charset to AL32UTF8.

Some related adodb settings/commands for Oracle.

Before connection:
$database->_resource->NLS_DATE_FORMAT = 'RRRR-MM-DD HH24:MI:SS';
$database->_resource->charSet = 'AL32UTF8';
After connection:
$database->_resource->Execute("ALTER SESSION SET NLS_DATE_FORMAT='RRRR-MM-DD HH24:MI:SS'");

You can also try these (not recommended):
$database->_resource->Execute("ALTER SESSION SET NLS_LANGUAGE=RUSSIAN");
$database->_resource->Execute("ALTER SESSION SET NLS_TERRITORY=RUSSIA");
Title: Re: Oracle Problem on adding new module
Post by: muharihar on November 22, 2008, 00:46:32
Tips Installing Elxis with Oracle as your Database:
1. Install Oracle
2. If your Database Server not in one server with your Web Server (you need install oracle instant client on you web server)
3. Make sure Oracle Path as Your First Path Queue (on Windows)
   set oracle path on you windows Environment Variables.
4. Install Apache + PHP (You can use xampp for windows ->http://www.apachefriends.org/en/xampp-windows.html)
5. Check you php.ini (on xampp you can found this file on : xampp/apache/bin ) configuration for supporting oracle:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

...
;extension=php_ntuser.dll
extension=php_oracle.dll
extension=php_oci8.dll

;extension=php_oggvorbis.dll
...

6. Before installing elxis, make sure you oracle TNS Listener Service and Oracle service is running (check via windows service)

happy try....

Sorry for my bad english....
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 22, 2008, 14:26:37
I have 2 problem.

I have installed apache2.2, php5, oracle 10g.
then I get some error in the installation step.

1. "URI: index.php
Message: ORA-00911: invalid character
INSERT INTO aaaa_banner VALUES (1, 1, 'banner', 'Multi lingual Interface', 0, 0, 0, 'elxismultilingual.jpg', 'http://www.elxis.org', TO_DATE('1979-12-19 00:00:00','RRRR-MM-DD HH24:MI:SS'), 1, 0, TO_DATE('1979-12-19 00:00:00','RRRR-MM-DD HH24:MI:SS'), NULL, NULL, 1)"


2. then I ignore error 1. then My web site menu is unsuccessful.
this picture 'http://rapidshare.com/files/166252840/untitled.JPG.html' I have upload.

can you help me?

how Can I successful?

sorry my english is bad. ;D
Title: Re: Oracle Problem on adding new module
Post by: muharihar on November 22, 2008, 16:18:22
yah... it's also happen  to me...

and i'm try to fixed it by replacing character "\n" with chr(10) (in every field values contain "\n").

try this query/script to fixed it:

UPDATE web2_categories
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_components
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_contact_details
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_content
   SET attribs = REPLACE (attribs, '\n', CHR (10));
UPDATE web2_mambots
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_menu
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_modules
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_sections
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_users
   SET params = REPLACE (params, '\n', CHR (10));
UPDATE web2_weblinks
   SET params = REPLACE (params, '\n', CHR (10));

replace web2_ with your elxis prefix table....

note:
it's work for me on windows....

happy try.....

 ;D
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 24, 2008, 04:26:56
hello dear all.
thank you muharihar .

I have problem again. I create new link in the main menu. then I get error msg "mosmenu::store failed <br />ORA-00001: unique constraint (A4M.SYS_C00156566) violated"

How can I do it?
Title: Re: Oracle Problem on adding new module
Post by: batorgil on November 24, 2008, 04:29:08
this CONSTRAINT  is "
ALTER TABLE A4M.NEW_MENU
  DROP CONSTRAINT SYS_C00156566;

ALTER TABLE A4M.NEW_MENU ADD (
  PRIMARY KEY
 (ID));
"
Title: Re: Oracle Problem on adding new module
Post by: muharihar on November 24, 2008, 12:21:03
it's happen because last value of sequence (from dependent table) is not updated to the last id from table (primary key)

try this query/script to fix it:

DECLARE
   --seq_web2_menu (sequence name)
   --web2_menu (table name)
   --Replace web2_ with your Elxis Table Prefix
   max_seq   NUMBER (12);
   id_web2   NUMBER (12);
BEGIN
-- SEQ_web2_menu = web2_menu
-- a.ID = primary key

   SELECT NVL (MAX (a.ID), 1)
     INTO id_web2
     FROM web2_menu a;

   SELECT seq_web2_menu.NEXTVAL
     INTO max_seq
     FROM DUAL;

   DBMS_OUTPUT.put_line ('Tabel web2_menu, id = ' || id_web2 || ', seq = ' || max_seq);

   IF id_web2 > max_seq
   THEN
      DBMS_OUTPUT.put_line ('Looping...');

      WHILE max_seq < id_web2
      LOOP
         DBMS_OUTPUT.put_line (' - increment id = ' || id_web2 || ', seq = ' || max_seq);

         IF max_seq > id_web2
         THEN
            EXIT;
         END IF;

         SELECT seq_web2_menu.NEXTVAL
           INTO max_seq
           FROM DUAL;
      END LOOP;
   END IF;
END;



replace "web2_" with your elxis prefix table....

you can do this solution for any sequence problem (by replace related sequence and related table)...

happy try...... ;D

thanks.....