Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 = Installation steps =
6
7 Steps:
8
9 * Download and install a version of Oracle Database. For example [[Oracle Express>>http://www.oracle.com/technetwork/products/express-edition/downloads/index.html]].
10 * Download the corresponding [[Oracle JDBC Drivers>>http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html]] and copy the JAR (e.g. ##ojdbc6.jar## in ##WEB-INF/lib/##)
11 * Start Oracle and connect to it with a DBA or system user. For example use the Oracle SQL*Plus command-line tool: {{code}}connect system;{{/code}}
12 * Create the wiki user and schema:(((
13 {{code}}
14 create user xwiki
15 identified by xwiki;
16 {{/code}}
17 )))
18 * Create a tablespace (which is the Oracle term for what you know as a "database" on Microsoft SQL Server):(((
19 {{code}}
20 select *
21 from dba_data_files
22 ;
23 --
24 -- Pick an adequate name from the list above.
25 --
26 create tablespace xwiki
27 datafile '/opt/SOMETHING/oracle/oradata/SID/xwiki01.dbf'
28 size 1m
29 autoextend on
30 maxsize 1g
31 ;
32 {{/code}}
33 )))
34 * Create tables of the ##xwiki## user by default in the new tablespace:(((
35 {{code}}
36 alter user xwiki
37 default tablespace xwiki
38 temporary tablespace temp
39 ;
40 alter user xwiki quota unlimited on xwiki
41 ;
42 {{/code}}
43 )))
44 * Give sufficient privileges to the ##xwiki## user:(((
45 {{code}}
46 grant connect to xwiki;
47 grant resource to xwiki;
48 grant dba to xwiki;
49 {{/code}}
50 )))
51 * Tell XWiki to use Oracle. To do this, edit the ##WEB-INF/hibernate.cfg.xml## file where you have expanded the XWiki WAR file and uncommented the Oracle part. Make sure to review the ##connection.url## property. For example a typical Oracle Express would be:{{code}}<property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>{{/code}}(((
52 {{info}}
53 **XE** is the default name of the ORACLE SID created by default by the installation for Oracle Express. If it is another you should change it. You can find the correct SID in ##app/oracle/product/10.2.0/server/NETWORK/ADMIN/tnsnames.ora## in the Oracle installation directory (for Windows).
54 {{/info}}
55 )))
56
57 = Troubleshooting =
58
59 == ORA-01400: cannot insert NULL into ("XWIKI"."XWIKILARGESTRINGS"."XWL_ID") ==
60
61 This error can appear if you're using Oracle JDBC driver 10.2.0.1.0. The solution is to use version 10.2.0.2 or greater of the driver.
62
63 == SetString can only process strings of less than 32766 chararacters ==
64
65 If you see an error that says something like this:
66
67 {{code}}
68 Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
69 Wrapped Exception: could not update: [com.xpn.xwiki.doc.XWikiDocumentArchive#104408758]
70 com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
71 Wrapped Exception: could not update: [com.xpn.xwiki.doc.XWikiDocumentArchive#104408758]
72 ...
73 Wrapped Exception:
74
75 java.sql.SQLException: setString can only process strings of less than 32766 chararacters
76 ...
77 {{/code}}
78
79 Then that's because Oracle has a limitation of 32K for CLOBs. To overcome it you need to add the following 2 properties in the ##hibernate.cfg.xml## file, as specified in the installation steps section above:
80
81 {{code}}
82 <property name="hibernate.connection.SetBigStringTryClob">true</property>
83 <property name="hibernate.jdbc.batch_size">0</property>
84 {{/code}}
85
86 == NullPointerException at HqlSqlWalker ==
87
88 This is actually caused by a wrong Oracle ##ojdbc## JAR being used. There are different JARs for every different minor version of Oracle. For example if you use the JDBC connector for Oracle 11g version 11.2.0.4.0 and your Oracle db version is 11.2.0.1.0 then you'll have the problem.
89
90 = Installing Oracle from a VM =
91
92 An easy to test Oracle is to use a VM. Here are some easy steps:
93
94 * [[Download the VM from the Oracle web site>>http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html]]
95 * Install [[VirtualBox>>https://www.virtualbox.org/]] and import the VM in it
96 * Note: I had to configure the VM network settings to use the "Bridged Adapter" instead of "NAT" in order to be able see it from my host machine
97 * Start the VM and log in as ##oracle##/##oracle##
98 * Note that IP address printed in the shell that opens up, for example: 192.168.0.49
99 * In the shell, starts the manager: ##emctl start dbconsole##
100 * Execute all the instructions above in the shell to create the ##xwiki## database (don't forget to download the JDBC driver and put it in ##WEB-INF/lib##). Tip: Put the following in a file (for example ##xwiki.sql## located on the Desktop) and execute {{code}}echo @Desktop/xwiki.sql | sqlplus system/[email protected]{{/code}}:(((
101 {{code}}
102 drop user xwiki cascade;
103 create user xwiki identified by xwiki;
104 select * from dba_data_files;
105 create tablespace xwiki datafile '/home/oracle/app/oracle/oradata/orcl/xwiki01.dbf' size 1m autoextend on maxsize 1g;
106 alter user xwiki default tablespace xwiki temporary tablespace temp;
107 alter user xwiki quota unlimited on xwiki;
108 grant create session to xwiki;
109 grant create table to xwiki;
110 grant create sequence to xwiki;
111 {{/code}}
112 )))
113 * From your host machine, point your browser on http:~/~/192.168.0.49:1158/em and connect as ##system/oracle##
114 * In your XWiki's ##hibernate.cfg.xml##, use:(((
115 {{code}}
116 <property name="connection.url">jdbc:oracle:thin:@192.168.0.49:1521:orcl</property>
117 {{/code}}
118 )))
119 * Don't forget to drop the Oracle JDBC driver in your ##WEB-INF/lib## directory!
120 * Enjoy ;)

Get Connected