<
From version < 14.3 >
edited by Sergiu Dumitriu
on 2011/06/07
To version < 14.4 >
edited by Manuel Smeria
on 2012/12/11
>
Change comment: Rewording, updated links

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -MSSQL Installation
1 +Microsoft SQL Server Installation
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Sergiu
1 +XWiki.ManuelSmeria
Content
... ... @@ -1,35 +3,33 @@
1 -= Microsoft SQL Server Installation =
2 -
3 3  {{info}}
4 -This has been tested on MSSQL 2000 and MSSQL 2005 (text types are only deprecated in MSSQL 2005, this tutorial won't work when they'll be dropped)
2 +This has been tested on MSSQL 2000 and MSSQL 2005 (text types are only deprecated in MSSQL 2005; this tutorial won't work when they'll be dropped).
5 5  {{/info}}
6 6  
7 7  {{warning}}
8 -Case-insensitive search does not work with this database; see below for more info. You may want to use the the [[Lucene search>>extensions:Extension.Search Application]]
6 +Case-insensitive search does not work with this database; see below for more info. You may want to use the the [[Lucene search application>>extensions:Extension.Search Application]].
9 9  {{/warning}}
10 10  
11 -== Create the xwiki user and database ==
9 += Create the xwiki user and database =
12 12  
13 -* Use the Enterprise Manager to create a database named 'XWiki' and a user named 'xwiki'.
14 -* Set xwiki's password to 'xwiki'.
15 -* Give database ownership of the database XWiki to the user xwiki.
11 +* Use the Enterprise Manager to create a database named "XWiki" and a user named "xwiki"
12 +* Set xwiki's password to //xwiki//
13 +* Give database ownership of the XWiki database to the "xwiki" user
16 16  
17 -== Install the JDBC driver ==
15 += Install the JDBC driver =
18 18  
19 -* Download the [[jtds jdbc driver>>http://jtds.sourceforge.net/]] and install the jar file into your servers lib directory (for JBoss this could be //server\default\lib\//, for Tomcat this might be //common\lib\//)
20 -
17 +* Download the [[jtds jdbc driver>>http://sourceforge.net/projects/jtds/]] and install the jar file into your server's lib directory (for JBoss this could be ##server\default\lib\##, for Tomcat this might be ##common\lib\##)
18 +(((
21 21  {{info}}
22 -The connection was successfully tested with version 1.2.1 of the driver and version 1.5 of XWiki. Some problems occurred when using drivers > 1.2.1 so it might be better to use the old one.
20 +The connection was successfully tested with version 1.2.1 of the driver and version 1.5 of XWiki. Some problems occurred when using drivers > 1.2.1 so it might be better to use the old one.
23 23  {{/info}}
22 +)))
23 +* Alternatively, you can use the [[JDBC driver provided by Microsoft>>http://www.microsoft.com/en-us/download/details.aspx?id=21599]], however this has not been thoroughly tested
24 24  
25 -* Alternatively, you can use the [[JDBC driver provided by Microsoft>>http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en]], however this has not been thoroughly tested.
25 += XWiki configuration =
26 26  
27 -== XWiki configuration ==
27 +* Configure XWiki to use MSSQL. To do this, edit the ##WEB-INF/hibernate.cfg.xml## file. Replace the matching properties with the following ones (or uncomment them if they are present):
28 28  
29 -* Tell XWiki to use MSSQL. To do this, edit the //WEB-INF/hibernate.cfg.xml// file. Replace the matching properties with the following ones (or uncomment them if they are present):
29 +== JTDS ==
30 30  
31 -=== JTDS ===
32 -
33 33  {{code language="xml"}}
34 34  <property name="connection.url">jdbc:jtds:sqlserver://<server-url>:1433/XWiki;tds=8.0;lastupdatecount=true</property>
35 35  <property name="connection.username">xwiki</property>
... ... @@ -44,10 +44,10 @@
44 44  <mapping resource="activitystream.hbm.xml"/>
45 45  {{/code}}
46 46  
47 -=== MS JDBC driver ===
45 +== MS JDBC driver ==
48 48  
49 49  {{info}}
50 -Copy sqljdbc.jar from the downloaded package into //\webapps\xwiki\WEB-INF\lib\//. If you have installed Sun JRE 1.6 (or above) you need to copy **sqljdbc4.jar** instead!
48 +Copy //sqljdbc.jar// from the downloaded package into ##\webapps\xwiki\WEB-INF\lib\##. If you have installed Sun JRE 1.6 (or above) you need to copy //**sqljdbc4.jar**// instead!
51 51  {{/info}}
52 52  
53 53  {{code language="xml"}}
... ... @@ -64,20 +64,21 @@
64 64  <mapping resource="activitystream.hbm.xml"/>
65 65  {{/code}}
66 66  
67 -== Troubleshooting ==
65 += Troubleshooting =
68 68  
69 -=== Fix search function ===
67 +== Fix search function ==
70 70  
71 -If you try to do a search, via [[Main.WebSearch]], you will get an error. This is because the UPPER() function doesn not work on TEXT or NTEXT as used by MSSQL 2000 for blobs. The only solution I have found is to remove all the calls to upper() in [[Main.WebSearch]]. This is however not very practical, because it makes search case-sensitive.
69 +If you try to do a search, via [[Main.WebSearch]], you will get an error. This is because the UPPER() function doesn't work on TEXT or NTEXT as used by MSSQL 2000 for blobs. The only solution I have found is to remove all the calls to UPPER() in [[Main.WebSearch]]. This is however not very practical, because it makes search case-sensitive.
72 72  
73 -Alternatively, you may want to use the [[Lucene search>>extensions:Extension.Search Application]] instead of the default search.
71 +Alternatively, you may want to use the [[Lucene search application>>extensions:Extension.Search Application]] instead of the default search.
74 74  
75 -=== Hints for upgrading to MS SQL 2005 ===
73 +== Hints for upgrading to MS SQL 2005 ==
76 76  
77 -In MS SQL 2005 the standard schema in all databases is dbo by default. However, if you upgrade your server with the standard Microsoft software, all tables in your xwiki database will be configured to use a schema whichs name is equivalent to the database name. (If your database name is "xwiki", the schema name will also be "xwiki" and the full qualified tablenames will be "xwiki.xwikidoc", and so on)
75 +In MS SQL 2005 the standard schema in all databases is dbo by default. However, if you upgrade your server with the standard Microsoft software, all tables in your xwiki database will be configured to use a schema whichs name is equivalent to the database name. (If your database name is "xwiki", the schema name will also be "xwiki" and the full qualified tablenames will be "xwiki.xwikidoc", and so on).
78 78  
79 -Since the standard schema in is configured to be "dbo", xwiki will not find any tables (since it searches for "dbo.xwikidoc", ...). This will result in an exception when calling the xwiki webapp (in the logfiles you will see an "object not found" - exception for xwikidoc, because xwikidoc is the first table to be mapped via hibernate)
77 +Since the standard schema is configured to be "dbo", xwiki will not find any tables (since it searches for "dbo.xwikidoc", ...). This will result in an exception when calling the xwiki webapp (in the logfiles you will see an "object not found" - exception for xwikidoc, because xwikidoc is the first table to be mapped via hibernate).
78 +
80 80  There are 2 possible solutions to this problem:
81 81  
82 -* Reconfigure your server to use "xwiki" as standard scheme inside the xwiki-database.
83 -* Adopt the hibernate file (xwiki.mssql.hbm.xml). Look for the table definitions, eg. //table="xwikidoc"// and set it to //table="xwiki.xwikidoc"//, or to whatever your schema/database is called. Do this for all tables you can find in the file.
81 +* Reconfigure your server to use "xwiki" as the standard scheme inside the xwiki-database
82 +* Adopt the hibernate file (//xwiki.mssql.hbm.xml//). Look for the table definitions, eg. //table="xwikidoc"// and set it to //table="xwiki.xwikidoc"// or to whatever your schema/database is called. Do this for all the tables you can find in the file.
XWiki.XWikiComments[8]
Date
... ... @@ -1,1 +1,1 @@
1 -2011-06-07 10:04:52.621
1 +2011-06-07 10:04:52.0

Get Connected