Changes for page Oracle Installation

Last modified by Vincent Massol on 2023/12/07

From version 25.2
edited by Vincent Massol
on 2021/05/18
Change comment: There is no comment for this version
To version 26.1
edited by Eduard Moraru
on 2021/07/07
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.enygma
Content
... ... @@ -10,7 +10,7 @@
10 10  * Download the corresponding [[Oracle JDBC Drivers>>https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html]] and copy the JAR (e.g. ##ojdbc8.jar## in ##WEB-INF/lib/##)
11 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 12  * Create the user for the main wiki:(((
13 -{{code language='sql'}}
13 +{{code language="sql"}}
14 14  create user xwiki
15 15  identified by xwiki;
16 16  {{/code}}
... ... @@ -17,13 +17,13 @@
17 17  )))
18 18  * (Optional) Create a tablespace (files to hold database data). This is optional as Oracle provides a default ##USERS## tablespace which is used when you create a user as above without specifying a tablespace:(((
19 19  * List existing tablespaces:(((
20 -{{code language='sql'}}
20 +{{code language="sql"}}
21 21  select * from dba_data_files;
22 22  {{/code}}
23 23  )))
24 24  * Create an ##xwiki## tablespace (adjust the `datafile` path by checking from the listed existing tablespaces), giving it enough space, and then make sure that the ##XWIKI## user uses it:(((
25 25  * Create the custom tablespace:(((
26 -{{code language='sql'}}
26 +{{code language="sql"}}
27 27  create tablespace xwiki
28 28  datafile '/opt/<SOMETHING>/oracle/oradata/<SID>/<PDB>/xwiki01.dbf'
29 29  size 1m
... ... @@ -33,7 +33,7 @@
33 33  {{/code}}
34 34  )))
35 35  * Modify the ##XWIKI## user to use it, and make sure it has quotas on it (by default it doesn't):(((
36 -{{code language='sql'}}
36 +{{code language="sql"}}
37 37  alter user xwiki
38 38  default tablespace xwiki
39 39  temporary tablespace temp
... ... @@ -44,13 +44,13 @@
44 44  )))
45 45  )))
46 46  * If you use the default ##USERS## tablespace you may still want to make it large enough. For example:(((
47 -{{code language='sql'}}
47 +{{code language="sql"}}
48 48  alter database datafile '/opt/<SOMETHING>/oradata/<SID>/<PDB>/users01.dbf' resize 100M;
49 49  {{/code}}
50 50  )))
51 51  )))
52 52  * Give sufficient privileges to the ##xwiki## user:(((
53 -{{code language='sql'}}
53 +{{code language="sql"}}
54 54  grant create session to xwiki;
55 55  grant create table to xwiki;
56 56  grant create sequence to xwiki;
... ... @@ -73,7 +73,7 @@
73 73  * Note that IP address printed in the shell that opens up, for example: 192.168.0.49
74 74  * In the shell, starts the manager: ##emctl start dbconsole##
75 75  * 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/oracle@orcl{{/code}}:(((
76 -{{code language='sql'}}
76 +{{code language="sql"}}
77 77  drop user xwiki cascade;
78 78  create user xwiki identified by xwiki;
79 79  select * from dba_data_files;
... ... @@ -87,7 +87,7 @@
87 87  )))
88 88  * From your host machine, point your browser on http:~/~/192.168.0.49:1158/em and connect as ##system/oracle##
89 89  * In your XWiki's ##hibernate.cfg.xml##, use:(((
90 -{{code language='xml'}}
90 +{{code language="xml"}}
91 91  <property name="connection.url">jdbc:oracle:thin:@192.168.0.49:1521:orcl</property>
92 92  {{/code}}
93 93  )))
... ... @@ -97,10 +97,11 @@
97 97  == Using Docker ==
98 98  
99 99  Follow these steps:
100 -* Start Oracle: {{code language='none'}}docker run --name oracle-xwiki -d -p 1521:1521 -v [<host mount point>:]/opt/oracle/oradata xwiki/oracle-database:19.3.0-se2{{/code}}
100 +
101 +* Start Oracle: {{code language="none"}}docker run --name oracle-xwiki -d -p 1521:1521 -v [<host mount point>:]/opt/oracle/oradata xwiki/oracle-database:19.3.0-se2{{/code}}
101 101  * Download the corresponding [[JDBC driver>>https://repo1.maven.org/maven2/com/oracle/ojdbc/ojdbc8/]] and put it in XWiki's ##WEB-INF/lib## directory
102 102  * Edit XWiki's ##hibernate.cfg.xml## file, comment out the Oracle section and make sure you use the following settings:(((
103 -{{code language='xml'}}
104 +{{code language="xml"}}
104 104  <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521/xwiki</property>
105 105  <property name="hibernate.connection.username">xwiki</property>
106 106  <property name="hibernate.connection.password">xwiki</property>
... ... @@ -108,10 +108,11 @@
108 108  )))
109 109  
110 110  And if you need to execute some SQL command you can do the following:
111 -* Connect inside the docker container with: {{code language='shell'}}docker -it exec <container id> bash -l{{/code}}
112 +
113 +* Connect inside the docker container with: {{code language="shell"}}docker -it exec <container id> bash -l{{/code}}
112 112  * Run ##sqplplus## with one of:
113 -** {{code language='sql'}}sqlplus system/xwiki@//localhost:1521/XWIKI{{/code}} to execute commands in the XWiki PDB
114 -** {{code language='sql'}}sqlplus sys/xwiki@//localhost:1521/XWIKICDB as sysdba{{/code}} if you need to execute commands in the CDB
115 +** {{code language="sql"}}sqlplus system/xwiki@//localhost:1521/XWIKI{{/code}} to execute commands in the XWiki PDB
116 +** {{code language="sql"}}sqlplus sys/xwiki@//localhost:1521/XWIKICDB as sysdba{{/code}} if you need to execute commands in the CDB
115 115  
116 116  {{info}}
117 117  You can check [[how the XWiki Oracle docker image is built>>https://github.com/xwiki/xwiki-docker-build/tree/master/build-oracle]].
... ... @@ -119,7 +119,7 @@
119 119  
120 120  = Multi wiki support =
121 121  
122 -{{version since='12.8RC1'}}
124 +{{version since="12.8RC1"}}
123 123  When creating a (sub)wiki, XWiki will create a new Oracle user using the equivalent of:
124 124  
125 125  {{code language='sql'}}
... ... @@ -150,6 +150,7 @@
150 150  create index ase_param3 on activitystream_events (ase_param3) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('SYNC (ON COMMIT)');
151 151  create index ase_param4 on activitystream_events (ase_param4) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('SYNC (ON COMMIT)');
152 152  create index ase_param5 on activitystream_events (ase_param5) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('SYNC (ON COMMIT)');
155 +create index solr_iterate_all_documents on xwikidoc (XWD_WEB, XWD_NAME, XWD_LANGUAGE, XWD_VERSION) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('SYNC (ON COMMIT)');
153 153  {{/code}}
154 154  
155 155  = Troubleshooting =
... ... @@ -189,7 +189,7 @@
189 189  
190 190  If you see one of the following errors in the XWiki logs, it may simply be that you don't allocate enough RAM to Oracle. This is especially true if you're running it in a VM or in a Docker Container. For example we know that 2GB is not enough for Oracle and 2.5GB+ is ok.
191 191  
192 -{{code language='none'}}
195 +{{code language="none"}}
193 193  SQL Error: 0, SQLState: null
194 194  Cannot get a connection, pool error Timeout waiting for idle object
195 195  ORA-12519, TNS:no appropriate service handler found
... ... @@ -197,4 +197,3 @@
197 197  {{/code}}
198 198  
199 199  Note that it's possible to have these errors for other reasons too but you should at least check that the RAM is enough.
200 -

Get Connected