[GeoNetwork-users] Configure GeoNetwork against SQL Server

Does anyone have any sample of how the database configuration shall look to work with SQL Server 2008? See below for sample using mySQL.

<resource enabled="false">
                      <name>main-db</name>
                      <provider>jeeves.resources.dbms.DbmsPool</provider>
                      <config>
                                            <user>admin</user>
                                            <password>admin</password>
                                            <driver>com.mysql.jdbc.Driver</driver>
                                            <url>jdbc:mysql://$WEBSERVER_HOST/geonetwork</url>
                                            <poolSize>10</poolSize>
                                            <reconnectTime>3600</reconnectTime>
                      </config>
</resource>

Regards,
Mikael

________________________________
Mikael Elmquist
Regionchef
Göteborg
Telefon direkt 031-62 76 63
Mobil 070-605 01 61
Telefax 031-62 77 22
mikael.elmquist@anonymised.com

Sweco Position AB
Gullbergs Strandgata 3
Box 2203
403 14 Göteborg
Telefon 031-62 75 00
www.sweco.se<http://www.sweco.se>

[cid:image001.png@anonymised.com]

[cid:image002.png@anonymised.com]Please consider the environment before printing my e-mail.

(attachments)

image001.png
image002.png

Hi

Never tried GeoNetwork with SqlServer, but in
http://msdn.microsoft.com/en-us/library/ms378428.aspx there's some useful
information about the connection url format. Should be similar to:

<resource enabled="true">

<name>main-db</name>
<provider>jeeves.resources.dbms.DbmsPool</provider>
<config>
<user>USER</user>
<password>PASSWORD</password>
<*driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
<url>jdbc:sqlserver://SERVER;database=DBNAME;integratedSecurity=true;</url>*
<poolSize>10</poolSize>
<reconnectTime>3600</reconnectTime>
</config>

</resource>

You'll need to add sqlserver jdbc driver in lib folder of GeoNetwork as not
provided by GeoNetwork.

Also if using 2.4.X you'll need to adapt one of the create db scripts in
gast/setup/sql for SQLServer and execute it manually to setup the database.

If using 2.6, you have to check the setup db scripts in
web/geonetwork/WEB-INF/classes/setup/sql/create and the data files in
web/geonetwork/WEB-INF/classes/setup/data

Hope you success in the configuration. Should be nice if you provide later
the custom sql scripts, so we can include in next versions of GeoNetwork to
support SqlServer.

Regards,
Jose Garcia

On Wed, Sep 29, 2010 at 6:36 PM, Elmquist Mikael
<Mikael.Elmquist@anonymised.com>wrote:

Does anyone have any sample of how the database configuration shall look to
work with SQL Server 2008? See below for sample using mySQL.

<resource enabled="false">
                     <name>main-db</name>
                     <provider>jeeves.resources.dbms.DbmsPool</provider>
                     <config>
                                           <user>admin</user>
                                           <password>admin</password>

<driver>com.mysql.jdbc.Driver</driver>

<url>jdbc:mysql://$WEBSERVER_HOST/geonetwork</url>
                                           <poolSize>10</poolSize>

<reconnectTime>3600</reconnectTime>
                     </config>
</resource>

Regards,
Mikael

________________________________
Mikael Elmquist
Regionchef
Göteborg
Telefon direkt 031-62 76 63
Mobil 070-605 01 61
Telefax 031-62 77 22
mikael.elmquist@anonymised.com

Sweco Position AB
Gullbergs Strandgata 3
Box 2203
403 14 Göteborg
Telefon 031-62 75 00
www.sweco.se<http://www.sweco.se>

[cid:image001.png@anonymised.com]

[cid:image002.png@anonymised.com]Please consider the environment before
printing my e-mail.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

Hi,

I managed to get things working on SQL Server 2008. The database part of config.xml looks like below and I have attached two SQL scripts to create and fill the database.

main-db

jeeves.resources.dbms.DbmsPool

geonetworkuser

geonetworkpwd!

com.microsoft.sqlserver.jdbc.SQLServerDriver

jdbc:sqlserver://WIN-KF3T7TL0B3S;database=GeoNetwork;integratedSecurity=false;

10

WIN-KF3T7TL0B3S is the name of my server/instance and GeoNetwork an empty database I created for this purpose.

I simply took the MySQL scripts and changed three things:

  1. Change datatype longtext to text

  2. Change TUNCATE to DELETE FROM (TRUNCATE TABLE worked poorly with relationships)

  3. Change the three inserts below to use apostrophe around the last value, thereby inserting as a text, not a number

INSERT INTO Settings VALUES (701,700,‘mdmode’,‘1’);

INSERT INTO Settings VALUES (702,700,‘tokentimeout’,‘3600’);

INSERT INTO Settings VALUES (703,700,‘cachesize’,‘60’);

Please, also note information from Jose below. You need to download Microsoft SQL Server JDBC Driver 3.0 and copy the files sqljdbc.jar and sqljdbc4.jar to the lib directory.

Question: Are there any form of automated tests I can run to verify that everything really works okay now?

Regards,

Mikael





Mikael Elmquist




Regionchef
Göteborg
Telefon direkt 031-62 76 63
Mobil 070-605 01 61
Telefax 031-62 77 22
mikael.elmquist@anonymised.com





Sweco Position AB




Gullbergs Strandgata 3
Box 2203
403 14 Göteborg
Telefon 031-62 75 00
www.sweco.se














Please consider the environment before printing my e-mail.

Från: jose garcia [mailto:josegar74@anonymised.com]
Skickat: den 29 september 2010 22:54
Till: Elmquist Mikael
Kopia: geonetwork-users@lists.sourceforge.net
Ämne: Re: [GeoNetwork-users] Configure GeoNetwork against SQL Server

Hi

Never tried GeoNetwork with SqlServer, but in http://msdn.microsoft.com/en-us/library/ms378428.aspx there’s some useful information about the connection url format. Should be similar to:

main-db
jeeves.resources.dbms.DbmsPool

USER
PASSWORD
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:sqlserver://SERVER;database=DBNAME;integratedSecurity=true;
10

3600

</resource>




You’ll need to add sqlserver jdbc driver in lib folder of GeoNetwork as not provided by GeoNetwork.

Also if using 2.4.X you’ll need to adapt one of the create db scripts in gast/setup/sql for SQLServer and execute it manually to setup the database.

If using 2.6, you have to check the setup db scripts in web/geonetwork/WEB-INF/classes/setup/sql/create and the data files in web/geonetwork/WEB-INF/classes/setup/data

Hope you success in the configuration. Should be nice if you provide later the custom sql scripts, so we can include in next versions of GeoNetwork to support SqlServer.

Regards,
Jose Garcia

On Wed, Sep 29, 2010 at 6:36 PM, Elmquist Mikael <Mikael.Elmquist@anonymised.com> wrote:

Does anyone have any sample of how the database configuration shall look to work with SQL Server 2008? See below for sample using mySQL.

main-db jeeves.resources.dbms.DbmsPool admin admin com.mysql.jdbc.Driver jdbc:mysql://$WEBSERVER_HOST/geonetwork 10 3600

Regards,
Mikael


Mikael Elmquist
Regionchef
Göteborg
Telefon direkt 031-62 76 63
Mobil 070-605 01 61
Telefax 031-62 77 22
mikael.elmquist@anonymised.com

Sweco Position AB
Gullbergs Strandgata 3
Box 2203
403 14 Göteborg
Telefon 031-62 75 00
www.sweco.se<http://www.sweco.se>

[cid:image001.png@anonymised.com]

[cid:image002.png@anonymised.com]Please consider the environment before printing my e-mail.


Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev


GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

(attachments)

create-db-sqlserver.sql (6.7 KB)
data-db-sqlserver.sql (417 KB)

Hi,

The data-db-sqlserver.sql script refers to version 2.5.

Will this script work with 2.4.3? What's the best way to get a 2.4.3
script?

Thanks,

Annette

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Configure-GeoNetwork-against-SQL-Server-tp5584754p5815383.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Annette

I think you can get the script working for a 2.4.X database removing from
the file sql/data/data-db-sqlserver.sql the insert commands into settings
table that appear in the script sql/migrate/2.4.3-to-2.6.1/sqlserver.sql

Also you´ll need to set correct version in settings table changing this line
in sql/data/data-db-sqlserver.sql:

INSERT INTO Settings VALUES (15,14,'version','2.6.1');

to

INSERT INTO Settings VALUES (15,14,'version','2.4.3');

Regards,
Jose García

On Wed, Dec 8, 2010 at 3:24 PM, afarrell <afarrell@anonymised.com> wrote:

Hi,

The data-db-sqlserver.sql script refers to version 2.5.

Will this script work with 2.4.3? What's the best way to get a 2.4.3
script?

Thanks,

Annette

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Configure-GeoNetwork-against-SQL-Server-tp5584754p5815383.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to
build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

Thank you Jose. This worked for me.

Here are the steps:

Script to create the tables:

I used the supplied 2.4.3 mysql.sql script to create the tables in the
database, changing longtext to text.
I didn't use Mikael's script as there's no Displayorder field in the
Metadata table for 2.4.3. Also the Value field of the Settings table is
varchar instead of text. These differences are of course noted in the 2.4.3
to 2.6.0 migration script.

Script to populate the tables:

I modified Mikael's data script removing the insert commands found in:
geonetwork\WEB-INF\classes\setup\sql\migrate\2.4.3-to-2.6.0\mysql.sql

I verified the insert commands I was removing using a 2.4.3 Postgres
database populated using GAST.

I also changed the version as you mentioned.

Thanks for your assistance,

Annette
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Configure-GeoNetwork-against-SQL-Server-tp5584754p5818936.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.