Hi All
I was setting up handle server for my University, and everything went well in such a way that changes apply only for new submissions, if we submit or import a file the file will take a new prefix not default like 123456789,
What we really need is to change the default handle prefix e.g 123456789 to all our previous stored digital files and even to the new imported or submited file.
Regards
Lewatle
|
Hi Lewatle,
In your [dspace]/bin directory, there is a script called “update-handle-prefix”
If, for example, your new handle is 858585:
[dspace]/bin/update-handle-prefix 123456789 858585
This will update the old handles with a default handle prefix without bothering your new, correct items/collections/communities.
Cheers,
Kim
Hi Kim
This is what i did :
root@dspace-desktop:/usr/local/dspace1.5.2/dspace/bin# bash update-handle-prefix 123456789 36547
If you continue, all handles in your repository with prefix 123456789 will be updated to have handle prefix 1900
2357 items will be updated.
Have you taken a backup, and are you ready to continue? [y/n]: y
Updating handle table... 2357 items updated
Updating metadatavalues table... Exception in thread "main" org.postgresql.util.PSQLException: ERROR: more than one row returned by a subquery used as an expression
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.dspace.storage.rdbms.DatabaseManager.updateQuery(DatabaseManager.java:390)
at org.dspace.handle.UpdateHandlePrefix.main(UpdateHandlePrefix.java:97)
How can I fix that error.
Thanks
Hi
As my [dspace]/dspace/bin/update-handle-prefix gives error, I also come with an idea of modifying the handle table and change 123456789/ handle prefix
I tried on one collection it worked, but I need an SQL statement that will update only 123456789 and leave other value, If you can check the values in handle table and specifically handle column start with prefix and followed by id like
123456789/7135
SQL statement that can alter our prefix (123456789) only in that column and leaves the id (/7135)
I was using the statement :
Table name is handle
Column name is also handle
dspace=> UPDATE handle SET handle = '85642/7178' WHERE handle = '123456789/7178';
that worked for updating single item,
we need to update them simultaneously.
Regards
Lewatle
-----Original Message-----
From: Kim Shepherd [mailto:ki...@waikato.ac.nz]
Sent: Thu 8/27/2009 10:22 PM
To: Lewatle Phaladi; dspac...@lists.sourceforge.net
Subject: RE: [Dspace-tech] handle-server setup