Moving data

  • Hi. I have a question. How do I move data from one server to another, without having to do a restore??

    I want to load all the data on hard drive and then build a new server in another location and populate the database with the data on the drive.

    Does anybody know how to do this????

    Thanks in advance....!!

    Anchelin

  • Table a database offline;

    Copy the database files to your target server;

    Attach the copied files on the target server.

  • You can use DTS to copy the data after you've created the new database.  Try the Import/Export wizard and choose "Copy objects and data between SQL Server databases".

    Greg

    Greg

  • Hi thanks for your response...

    But the servers are not on the same network... server on network A and server on network B...so I can't do the Import\Export wizard...

    Or can I do a Export to a file on server on network A and then on other server , network B and Import the file into the db???

    Another question... if I work remotely.... how can I see my removable harddrive ... because I need to copy it to there?

    Am I asking the wrong questions? I'm new to this and have been thrown into the deep end...

    Thanks

     

  • Yes, you can export to files then import the files to the new database.  You'll just have to be able to either see the files from the new server or move the files to the network where the new server resides.

    You'll need to use Remote Desktop connection or similar to be able to see the drives of the remote server.

    Greg

    Greg

  • If you are using SQL 2000 you can use the Detach/Attach options. First detatch your DB and then copy to your new Server and attach once again.

    Catherine


    Kindest Regards,

    Catherine Eibner
    cybner.com.au

  • Hi

    Thank you all for your responses. Much appreciated...

    Anchelin

  • Hi, me again...

    Is there a script that shows you how long a job has been running?

    Thanks

    A

  • sysjobhistory will show you where you are. sysjobs I believe shows the start time, so you can calculate the time elapsed.

  • Sysjobhistory doesn't get written to until the job completes.  You have to look at sysprocesses to see what's currently executing.

    Try this:

    select RTrim(J.Name),last_batch

        from msdb..sysjobs J with (nolock)

        inner join  master..sysprocesses RP with (nolock)

         on RP.program_name like 'SQLAgent - TSQL JobStep (Job ' + master.dbo.fn_varbintohexstr(convert(binary(16),J.job_id )) + '%'

    Greg

    Greg

  • Hi All

    Thanks for ALL your responses, REALLY helped alot...

    I get the following error:

    Procedure prc_Performance_proc has no parameters and arguments were supplied...

    The Code for prc_Performance_proc:

    USE [SystemCenterReporting]

    GO

    /****** Object:  StoredProcedure [dbo].[prc_Performance_proc]    Script Date: 04/05/2007 13:52:50 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE PROCEDURE [dbo].[prc_Performance_proc]

    AS

    SELECT    CD.DNSName AS ComputerDNSName, CD.ComputerName_PK AS ComputerName, CDD.InstanceName_PK AS PerformanceInstanceName,

                  CDD.ObjectName_PK AS PerformanceObjectName, CDD.CounterName_PK AS PerformanceCounterName,

                  max(SNDF.SampleValue)AS MaxValue, min(SNDF.SampleValue)AS MinValue,sum(SNDF.SampleValue),

                  avg(SNDF.SampleValue) AS Average, stdev(SNDF.SampleValue),

                  datepart(year, SNDF.DateTimeSampled) AS YR,datepart(month, SNDF.DateTimeSampled) AS MNTH,

                  datepart(day, SNDF.DateTimeSampled) AS DDay

    --           Count(SNDF.SampleValue)

    --from dbo.SC_SampledNumericDataFact_View) As [SampleValCount]

    --SELECT DATEPART(m, 0), DATEPART(d, 0), DATEPART(yy, 0)

    FROM     dbo.SC_SampledNumericDataFact_View SNDF INNER JOIN

             dbo.SC_ComputerDimension_View CD ON SNDF.Computer_FK = CD.SMC_InstanceID INNER JOIN

             dbo.SC_CounterDetailDimension_View CDD ON SNDF.CounterDetail_FK = CDD.SMC_InstanceID

    ----where SNDF.DateTimeSampled = @BASEDATE

    GROUP BY CD.DNSName,CD.ComputerName_PK,CDD.InstanceName_PK ,CDD.ObjectName_PK,CDD.CounterName_PK,

    datepart(year, SNDF.DateTimeSampled), datepart(month, SNDF.DateTimeSampled),datepart(day, SNDF.DateTimeSampled)

    do any of you perhaps know where to look for the error??

     

    Below is the code that gives me the error:

    CREATE PROCEDURE [dbo].[prc_Performance_Daily]

    AS

     

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ SC_Performance_table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

    --drop table [dbo].[SC_Performance_table]

     

    Create table SC_Performance_table(

        [DNSName] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [ComputerName] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [InstanceName] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [ObjectName] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [CounterName] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [MaxValue] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [MinValue] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [SUM] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [AvgValue] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [STDev] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [COUNT] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [Year] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [Month] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

        [Day] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY]

     

    --

    SET NOCOUNT ON

    --

    Exec prc_Performance_proc

    'insert [dbo].[SC_Performance_table]'

     --SELECT DNSName, ComputerName, InstanceName, ObjectName, CounterName, Maxvalue, Minvalue

     

     

     

     


     

  • This bit

    Exec prc_Performance_proc

    'insert [dbo].[SC_Performance_table]'

    looks like you're supplying a value for a parameter in prc_Performance_proc when, in fact, it isn't expecting a parameter.

    Greg

     

    Greg

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply