SQL 2005 and Database Refreshes

We have 2 NW2004S systems both with ABAP+Java. When we copy one database over from one system (A) to another (B), we've noticed that the schema attached to all of the tables in on the B system are now A.
Using the SQL Tools application from SAP, we were able to fix the ABAP tables, but are unsure as to how to convert Java Tables from A back to B. As a result of this database copy, the Java instance (including configtool) won't start.
Re-installing the Java DB instance did correct the DB schema error, and configtool did run as a result, although the Java CI failed to load.
Any suggestions?

Try to use the script below.
The last line is the script is what you need to change with appropriate database IDs. Look for <tags> to replace appropriately.
Also ensure you create the user SAP<NEWDB>DB already in the database. (specifically in Management->Security ... you know what I mean !!??)
++++++++++++++++++++++++++++++++++++
use <NEWDB_SID>
go
if object_id('sp_change_sapuser') is not null
     drop procedure sp_change_sapuser
go
create procedure sp_change_sapuser @oldid sysname, @newid sysname
as begin
declare @oldid_uid     smallint
declare @newid_uid     smallint   
declare @object      sysname
declare @object_full     nvarchar(999)
set @oldid_uid = user_id(@oldid)
set @newid_uid = user_id(@newid)
if @oldid_uid is not null and @newid_uid is not null
     begin
     declare object_cursor cursor local for
          select name
                from sysobjects
                where
                (  (xtype='U' and name <> 'dtproperties')
                or (xtype='V' and name not in ('syssegments','sysconstraints'))
                or (xtype='P' and name not like 'dt_%')
                or (xtype='D' and name not like 'DF__dtpropert%')
                or (xtype in ('FN','TF','IF'))
                ) and @oldid_uid = uid
     open object_cursor
     fetch next from object_cursor into @object
     while @@fetch_status=0
     begin
          set @object_full = user_name(@oldid_uid) + '.' + @object
          exec sp_changeobjectowner @object_full, @newid
          fetch next from object_cursor into @object
     end
     end
else
     if @oldid_uid is null
          begin
          print '*** old database user does not exist ***'
          end
     if @newid_uid is null
          begin
          print '*** new database user does not exist ***'
          end
end
go
exec sp_change_sapuser 'SAP<OLDSID>DB', 'SAP<NEWDB>DB'
go
++++++++++++++++++++++++++++++++++++

Similar Messages

  • SQL 2005 and Database Restores

    We have 2 NW2004S systems both with ABAP+Java. When we copy one database over from one system (A) to another (B), we've noticed that the schema attached to all of the tables in on the B system are now A.
    Using the SQL Tools application from SAP, we were able to fix the ABAP tables, but are unsure as to how to convert Java Tables from A back to B.  As a result of this database copy, the Java instance (including configtool) won't start.  Re-installing the Java DB instance did correct the DB schema error, and configtool did run as a result, although the Java CI failed to load.
    Any suggestions?

    Hi, Michael!
    I think your post will be better answered in "SAP on SQL Server"-Forum.
    Regards,
    Thomas

  • SQL 2005 and CF 5.0

    I think I created a table without the field 'System_ID' when
    first migrating from SQL 2000 to SQL 2005 and now I can not get CF
    5.0 to refresh its view of SQL 2005.
    I get the following error when running SQL 2005 and CF 5.0,
    but have no problems when running SQL 2000 and CF 5.0 nor when
    running SQL 2005 and CF 2008 trial version. If I delete the
    'system_id' from the SELECT statement it works too.
    I get the same error if I delete the table, or if I delete
    the entire database. The only thing that causes other errors is
    when I shut down the server or delete ODBC connection. I have
    rebooted the entire server (Server 2003), shut down the SQL 2005 -
    anything I could think of to clear buffers. The other thousand
    lines of CF code and about 100 tables works fine and interfaces
    nicely with a .NET application and Crystal Reports.
    Short of spending $1200 to upgrade or renaming tables or
    databases, does anyone an idea of how to get around this.
    Thank you in advance,
    Bill
    Error Diagnostic Information
    ODBC Error Code = S0022 (Column not found)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column
    name 'system_id'.
    SQL = "select segment_id, segment_name, system_id from
    Segment"
    Data Source = "GIS_CABLE_FAULT_2005"
    The error occurred while processing an element with a general
    identifier of (CFQUERY), occupying document position (13:1) to
    (13:62) in the template file F:\TYSIMSCF\FAULTS.CFM.
    Date/Time: 09/02/08 11:26:49
    Browser: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
    .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR
    3.0.04506.648; .NET CLR 3.5.21022)
    Remote Address: 163.241.120.106
    HTTP Referrer:
    http://usy45ap0n/tysimscf/default.cfm

    FYI -- typically, forward looking statements are discouraged on these forums...and authoritative future information is definitely not encouraged...anyone who knows the answer would be barred from revealing it as it would be proprietary information, not for disclosure.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Difference between r/3 refresh and database refresh

    Dear guru's
                   what is the difference between system refresh and database refresh.........And what is the process of both....... please give me end to end nogotiate............
    Regard's
    rajkumar

    Hi Raj,
    Database refresh, I believe is one of the ways you could refresh your SAP systems.
    E.g Oracle database specific refresh is one of the ways. In this, I think you would export, move and then import cold backup of the database.
    Easiest way to get more information is to search for the System refresh (or System copy) master guide from Market place or help.sap.com.
    Regards,
    N.

  • What is the exact difference between Database Cloning and Database Refresh?

    Hi,
    Can anybody tel me the exact difference between Database Cloning and Database Refresh?
    I Have some conflicts in these topics.
    Thanks
    Rajesh

    Refresh is what it says, "refresh" . You have a main site which would always have the data being inserted into it. There would be another site which would remain some where else . This site needs to be refreshed with the primary site. So you need to do export from the primary, push it to the secondary site and done!
    HTH
    Aman....

  • Sql Service and Databases won't start on two of my databases SQl 2005

    getting the errors below
    In Event viewer I have Event ID 17120 SQL Server Could not Spawn FRuncm thread check the sql server error log and the windows event logs for information about possible related problems.
    Event id 17826 Could not start the Network Library because of an internal error in the netwpork library. To determine the cause review the errors immediately preceding this one in the error log.
    Also Event id 17182 TDSSN1 Client initialization failed with error 0x2,
    status code 0x1
    I think this post could help me but I do not know
    what is the domain login account for the SQL service is in sql 2005.
    Please see the post below
    1. added our domain login account for the SQL service to the local group SQLServer2005MSSQLUser$HSPCSVR03$MSSQLSERVER
    2. added the domain login account for the Agent service to SQLServer2005SQLAgentUser$HSPCSVR03$MSSQLSERVER
    3. added both accounts to the local computer Administrators group.
    4. deleted C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat.I hope someone can help me with this. this broken Backup exec Database
    has become a nightmare. Two of the sql databases, both the bkup exec one and one called MS SQlserver will not start under services and the local system account or the Administrator account.
    Droid Hacker

    Hello,
    Did you refer to the folloing blog to troubleshooting this issue?
    Error Messages of SQL Server 2005 Start Up Failure
    According to the blog above, "TDSSNIClient initialization failed with error 0x2" , 0x2 is the OS error. Typing "net helpmsg 2" in command prompt return:The system cannot find the file sepcify. Status code 0x1 is general status code. You can review error
    log which start from error:17182 in SQL Server error log and mapping status code to specific problem.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • SQL 2005 with database compatibiltiy level set to 80

    I am working with a new client transferred to us and they have been having performance issues, particularly with an add-on solution.  I have been looking as some of the database settings and noticed that the database compatibility level was set to 80 - SQL 2000 when they are running on SQL 2005 with SAP B1 2007, PL 44.   Would having this set to 80 have any impact on performance?  Is it suggested to absolutely set the compatibility level to 90?.
    Thanks to all

    Hi,
    As per the SQL Administration guide, you have to choose collation setting of: SQL_Latin1_General_CP1_CI_AS when installing MSSQL 2005 Server.
    In order to check what the collation is set to in your server, please run the following query:
    select SERVERPROPERTY ('collation')
    (This query gets the collation settings of MSSQL Server's System Database "Master")
    Expected answer : SQL_Latin1_General_CP1_CI_AS
    As  MSSQL 2005 Server is already installed with  collation  SQL_Latin1_General_CP850_CI_AS, kindly follow the steps below:
    Change your server collation to SQL_Latin1_General_CP1_CI_AS
    You can find Microsoft's instructions for changing an SQL server collation here:
    http://msdn2.microsoft.com/en-us/library/ms179254.aspx
    Note: The collation settings of Database "Master" needs to be changed only. All SAP Business One Databases must not be changed! They must remain on SQL_Latin1_General_CP850_CI_AS.
    If you need any clarifications with this process please refer to an Expert Empowerment Session "SQL 2005 Server Collation settings" at https://websmp203.sap-ag.de/~sapidb/011000358700000050892007E/ or http://service.sap.com/smb/sbo/support -> Archive: Empowerment Sessions.
    If you have any Service pack for MSSQL Server installed, but the Service pack is not included into your DVD MSSQL Server, do as follows:
    1. Uninstall Service pack
    2. Change Collation Settings as per Expert Empowerment Session
    3. Install Service pack again
    Hope this is helpful!

  • MS SQL 2005 clustered database instance.

    Short Text 
    MS SQL cluster database instance - ONLY! 
    Long Text 
    Hi,
    If possible could you please confirm that our planned landscape
    migration is supported by SAP.
    At present our PRD SAP system is a standalone instance that consists of
    the database & central instance running on the same "HOST".
    <u>Current SAP PRD version:</u>
    ERP 2004 ECC 5.0 32 bit
    MS SQL 2000 32 bit
    both running on same host with OS Windows 2003 32 bit
    We plan to upgrade/migrate our PRD SAP system to new 64 bit hardware
    AND to move to a "Distributed" landscape installation i.e. database
    instance & central instance installed on different HOSTS. Also, the
    database instance WILL be clustered but the central instance will NOT
    be clustered. There are also multiple NON-SAP MS SQL databases that
    will run in the same cluster as the PRD SAP database instance.
    <u>SAP PRD version after migration:</u>
    SAP ERP 2004 ECC 5.0 64bit (running on X86_64 AMD64 hardware) on HOST'X'
    MS SQL 2005 64 bit (running on IA64 hardware) on clustered HOST'Y'
    Both running on Windows 2003 64 bit
    <u>My questions are:</u>
    1) Does SAP support a clustered MS SQL 2005 database instance that is
    running on a clustered HOST along with NON-SAP MS SQL databases?
    2)During the migration our PRD SAP MS SQL database will be upgraded
    from MS SQL 2000 32 bit to MS SQL 2005 64 bit IA64, is this also
    supported in a clustered istallation (database instance ONLY)?
    3) The central PRD SAP instance will be running on x86_64 AMD64
    hardware & the database instance will be running on 64 bit IA64
    hardware. Is this configuration supported?
    Thanking you inadvance.

    Hi Greg,
    Have you figured out the answer? We are trying do the exactly the same thing -- Move our SAP WAS 6.40 clustered central instance to a 64-bit hardware/SQL 2005/Clustered system. And this system has several non-SAP database on there. The biggest concern we have is whether SAP support this architecture. I posted a message here last year and several experts like Clas Hortien, N. P. C, in this form suggest NOT go to this architecture because SAP will not support it. One example, is that SAP/SQL requires server collation setting to SQL_Latin1_General_CP850_BIN2 and other databases may work on different collations.
    Migrate SAP SQL Server database to co-exist with others
    Anyway, if you or anyone in this form have some more information please share here.
    Thanks,
    Yujun Ran

  • SQL 2005 and ODI

    Dear all,
    I've tried to reserved tables from my SQL 2005 from my designer..But there some strange problem which is the tables can not be reserved. Is there any setting that i was missed..??
    Thanks.
    Rgds,
    Vien

    Thanks guys for trying to help
    Previously, I used to see this error
    com.sunopsis.sql.c: com.microsoft.sqlserver.jdbc.SQLServerDriver
    and so I downloaded the driver and installed it on /orahome_1/oracledi/drivers directory.
    Once I installed the driver, I am getting
    7000 : null : com.sunopsis.sql.l: Oracle Data Integrator Timeout: connection with URL
    So, I am thinking the agent is recognizing the driver but still not able to connect.
    CTS, If you are saying whether I tested the connection using the agent. Yes, I did and it is resulting in the same error.
    Can you please elaborate if you suggest trying something else.

  • How to migrate SharePoint 2013 Content and Configuration DataBases to a new SQL Server and DataBases in it?

    Hi,
    We need to migrate Our current 1 clustered SQL Server, Many Configurations DataBases and Many Content DataBases to a brand new clustered SQL server and brand new databases in it.
    How can I do this?
    Can someone list the steps involved?
    Thanks.  

    Hi,
    According to your description, you want to move Content databases  and Configuration databases to a new SQL Server,  refer to this article:
    https://technet.microsoft.com/en-us/library/cc512725.aspx?f=255&MSPPError=-2147217396
    Besides, here is a similar post, you can use as a reference:
    https://social.technet.microsoft.com/Forums/office/en-US/2cd46f7a-d583-41b2-82c2-ddc6d7c43fb8/how-to-move-sharepoint-databases-to-new-sql-server?forum=sharepointadminprevious
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Version of MS SQL 2005  and # of processors

    I'm trying to put together a complete package in order to get manager buyin to purchase the Discovery system.  I see that it comes with a temporary license for Microsoft SQL 2005.  When I approached our procurement agents to get a price for a permanant license, they had two questions. 1. Developer, Enterprise or Standard Edition?  2. How many processors?  Can someone please provide these answers.
    Thanks,

    Teresa,
    Discovery server using MS SQL 2005 Enterprise ed. and it has 2 - Dual cores Xeons...

  • System copy and database refresh

    Can any one nagotiate me about system refresh and databaswe refresh.

    Hi,
    System Copy means copying the contents of the system into another including data i,.e Table Data. It comprises entire user settings, data will be copied.
    In the database refresh, table contents (data) are refreshed.
    Good thread discussion:
    http://www.sap-img.com/bc049.htm
    Re: client refresh procedure
    Thanks,
    Moorthy

  • SQL 2005 and Weblogic :  JDBC configuration error

    All.
    What files do I need to modify with classpath, to use SQL 2005 drive. Is this the only I need to modify with classpath: startWebLogic.sh or do I need to modify other files?
    Thanks for you help.
    I am getting following error :
    <Oct 29, 2008 10:34:37 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <Oct 29, 2008 10:34:37 AM EDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    <Oct 29, 2008 10:45:02 AM EDT> <Error> <Console> <BEA-240003> <Console encountered the following error java.lang.ClassNotFoundException: Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    at com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:500)
    at com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:369)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
    at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
    at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
    at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
    at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
    at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
    at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
    at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java
    Thank you
    Sayef

    In old release, you should update CLASSPATH variable in setWLSEnv.sh or setWLSEnv.cmd.
    In 9.x or 10.x, you should update setDomainEnv.sh or setDomainEnv.cmd.
    Simon

  • Installation of Golf Program requires uninstalling Microsoft SQL 2005 and installing SQL 2000

    I am running Win 7 and about to purchased a new computer with Win 8.1. 
    The USGA wrote a Tournament Program which is used nationwide called TPP (Tournament Pairing Program).  It was developed prior to XP but it is updated every time you run the update.  It runs on XP without any adjustments.  To load the program
    on Win 7 or Win 8 you are instructed to remove Microsoft SQL Server 2005, which I did.  The program loads SQL 2000 when it is installed.  I am concerned when I uninstall the TPP program that it will also uninstall SQL 2000 (which it installed) and
    then there will be no SQL server on my Win 7.
    I was going to make sure that I could install the TPP program on Win 8 (before buying another computer) by installing it on a friends new Win 8.1 computer.  But I am concerned about removing the preinstalled SQL Server program.
    1) How does one get the original Microsoft SQL Server back once it has been removed and the recycle bin has been emptied?  Does the SQL program even get sent to the recycle bin when it is removed?
    2)  Is there any harm done by removing the original SQL program be it 2005 or a new one?

    SQL 2000 is not supported on Windows 7.
    http://support.microsoft.com/kb/2028963/en-us
    whenever you uninstall SQL Server, databases files are not deleted. So you can move them to safe location. if they are delete by you then you have very less chances to recover the data.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • SQL Server and Database Sequence

    I am trying to use the Database Adapter to insert rows into a SQL Server table and have followed the directions in the other post on this topic. Those directions are specific to inserting into an Oracle Database.
    If I don't insert the
    <sequence-number-field></sequence-number-field>
    <sequence-number-name></sequence-number-name>
    fields I get an error that you can't insert into an Identity column.
    When I add both of the fields in the toplink_mappings.xml file (which having the sequence-number-name for a SQL Server database which doesn't have a separate sequence object) I get this error:
    [SQLServer]Invalid object name 'SEQUENCE'. Internal Exception: java.sql.SQLException: [oias][SQLServer JDBC Driver][SQLServer]Invalid object name 'SEQUENCE'. Error Code: 208
    Stating that Sequence is not a valid object which makes sense.
    So when I remove the sequence-number-name element I get an error when I deploy the process stating that "if you have one of the sequence elements you have to have both".
    I must be doing something wrong. Any help is greatly appreciated.

    Hi
    In a SQL Server database, you can just use an "identity" column. An identity column is automatically populated and incremented. You don't need to put any mapping in the ODI interface. Just keep it blank.
    You cannot use the ODI Sequence, because ODI Sequence will be called only 1 time for all you rows (during the "insert rows" step of the IKM), and you'll have the same number for all your rows. Not exactly what you expect for a surrogate key. Actually, it will only work if you're doing a "row by row" loading.
    Otherwise, here's a workaround :
    - create an ODI variable that get the max ID of your dimension table (select max(row_id) from table_dim_X)
    - in your interface mapping, populate the target column with "VARIABLE + ROWNUM"
    ROWNUM gives you the number of the row, in oracle database.
    In SQL Server, you can use the function ROW_NUMBER()

Maybe you are looking for

  • How do I get my old iPod to update on my new MacPro?

    I transferred all of my songs to iTunes from my old Mac to my brand new MacPro, plugged in the iPod, but it says it can't update because it is in use from another application. How do I get it to recognize the new Mac as the new home AND how do I get

  • Upload Of Transaction Data Using E-CATT

    Dear All,       I am trying to upload purchase order Data for transaction ME21 through E-catt. But I am not able to upload multiple line item data as the Test Script allows only one item data to be uploaded because I have uploaded only one item data

  • IOS7 Final, will not restore to ipad mini.

    IOS7 Final, will not restore to ipad mini.

  • Cash payment method

    want that no pmnt should be made except cash for a specific vendor. where can this be configured. vendor master vendor account group or through FSG

  • Java Error Sample Code

    I get the following error when I try to complie the hotel.java class in the travel schema. internal error: unanticipated exception: java.lang.NoClassDefFoundError: oracle/aurora/sqljdecl/sqldec1 What classes is it looking for? What do I need in my pa