Sunday, March 25, 2012
copying tables in SQL SERVER
The bulkcopy feature in DTS is nice -- however is there a stored procedure or external software that will be able to do this outside of DTS.
Right now I am doing a
SELECT *
INTO
(table name)
FROM (table name)
and on a 100m row table it is taking around 52 hours. Not acceptable.Is it on the same server?
bcp out in native format and bcp in is probably the fastest
But the SELECT * INTO is a minimally logged operation...and if it's on the same server...
I'm not so sure bcp would beat it since it's 1 operation as compared to 2.|||Yes it is on the same server.|||For 100 million rows, I think I'd partition it up anyway...
What's the DDL of the table...is it a heap or does it have a pk?
If it's got something unique, I'd split it up in to 10 tables and thread out the SELECT Collist INTO Table1
SELECT Collist INTO Table2
SELECT Collist INTO Table3
SELECT Collist INTO Table4
ect
And run all 10 at the same time from 10 separate osql bat files...
thats 1 select per file....
How long does a backup take?|||Hello Everyone,
If you would like to copy records within the same database between the different databases the you can use this query,
insert into <table Name> select * from <Destination Table>|||insert into <table Name> select * from <Destination Table>The only problem is that this syntax is fully logged, while the SELECT INTO syntax is only minimally logged. Since the SELECT INTO appears to be too slow and I'd expect this to be even slower, I don't think it would be a good solution.
-PatP|||Damn...I wonder if that belongs here...
http://thedailywtf.com/archive/2004/09/01/1511.aspx
copying tables DTS vs SSIS - speed!!!
I'm trying to create a package with SSIS to replace the DTS process that we have in place already.
DTS package copy four table content from one server to another. I have created a simple SSIS to do the same processes but the process it alot slower than DTS!!
I did ran the SSIS package using ctrl+F5 and also from command prompt but still it's quite slow.
SSIS uses SMO to access to server and both are running on 2005
ThanksUse the "Table or view - fast load" option in your OLE DB Destinations.|||sorry for my ignorance, but is this an SSIS property? and if yes where can I find it
Thanks|||In the OLE DB Destination, it is a drop down option titled "data access mode". Double click on the OLE DB destination and it's on the main page.|||the problem is that I am using the transfer SQL server object task which it uses SMO by default not OLEDB. unless there is another way to copy the content of a table.
p.s. the tables do not exist on the remote server the transfer SQk server objects task, creates the table as well as copying the content.
cheers|||
Kolf wrote:
the problem is that I am using the transfer SQL server object task which it uses SMO by default not OLEDB. unless there is another way to copy the content of a table.
p.s. the tables do not exist on the remote server the transfer SQk server objects task, creates the table as well as copying the content.
cheers
Remember that SSIS is a data manipulation tool - not a schema manipulation tool. Hence, there isn't THAT much support for moving schema objects about.
If I were you I would create the tables using conventional methods (i.e. CREATE TABLE scripts run from the Execute SQL Task) and then use data-flows to pump data between them. This will not be slower than DTS. It will be alot more maintainable as well.
-Jamie
|||Thanks for your advise,
the problem is the table schema changes each time as the selected tables will be different. Is there a task to be able to extract the schema of the source table, so I can apply it to the destination server.
and then maybe use the data flow to push the data across.
Thanks again|||Data flows don't handle changing metadata, unless you are building them dynamically.|||Thanks , but even if I build the metadata for the tables in the destination in the control flow (which is not a problem) then I should be able to feed the data with the dataflow.
The problem is I have different tables and they change each time so I should be able to write one generic dataflow and change the parameter with a script each time I'm running.
cheers|||
Kolf wrote:
Thanks , but even if I build the metadata for the tables in the destination in the control flow (which is not a problem) then I should be able to feed the data with the dataflow. The problem is I have different tables and they change each time so I should be able to write one generic dataflow and change the parameter with a script each time I'm running.
cheers
As I think we have discussed on other threads - you can do this.
Apologies if I've missed any of your replies. The alerting functionality of these forums is broken (for me anyway).
-Jamie
Thursday, March 22, 2012
copying stored procedures in SQL Server 2005?
from one database engine to another, as quickly as using DTS in SQL Server
2000? Other than restoring from a backup.
Thanks,
Dean S
Dean
In objects explorer details select stored procedures you want to copy to,
then right click and Script Stored Procedure as -- CREATE TO -- new
query, make sure that you under scope a target database and press F5
"Dean Slindee" <slindee@.charter.net> wrote in message
news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
> Is there a quick way to copy a set of stored procedures in SQL Server 2005
> from one database engine to another, as quickly as using DTS in SQL Server
> 2000? Other than restoring from a backup.
> Thanks,
> Dean S
|||On Mar 4, 11:23 pm, "Dean Slindee" <slin...@.charter.net> wrote:
> Is there a quick way to copy a set of stored procedures in SQL Server 2005
> from one database engine to another, as quickly as using DTS in SQL Server
> 2000? Other than restoring from a backup.
> Thanks,
> Dean S
I suggest that you can find a stored procedure named
dbo.sp_generate_script.
Using dbo.sp_generate_script, you can get all stored procedures in a
database.
GOOD LUCK.
|||Does this procedure copy one stored procedure at a time, or multiple stored
procedures?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OwmbByffIHA.1900@.TK2MSFTNGP02.phx.gbl...
> Dean
> In objects explorer details select stored procedures you want to copy
> to, then right click and Script Stored Procedure as -- CREATE TO -- new
> query, make sure that you under scope a target database and press F5
>
>
>
> "Dean Slindee" <slindee@.charter.net> wrote in message
> news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
>
|||Dean
multiple stored procedures
"Dean Slindee" <slindee@.charter.net> wrote in message
news:2B130575-80A1-40DA-A83C-C5A71D2AA39F@.microsoft.com...
> Does this procedure copy one stored procedure at a time, or multiple
> stored procedures?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OwmbByffIHA.1900@.TK2MSFTNGP02.phx.gbl...
>
|||Uri
One answer to my question could have been:
Create a new SSIS package using the "Transfer SQL Server Objects" tool.
In the tool, fill in the parameters and connections and execute the package.
This is conceptually similar to the former DTS process.
One just has to keep redefining a "temp" SSIS package, or create several
"work" packages, per database.
Your process would be more useful for a quick transfer; no package required.
However, I have been unable to accurately follow your brief instructions.
Would you please expand on the instructions with numbered bullet points?
Like:
1. In SQL Server 2005 Management Studio, click on the Source database table's
Stored Procedures folder.
2. Select the stored procedures to be copied (I can only select one at a
time).
3. Right click and select Script Stored Procedure as CREATE TO:
4. Now, click on the Destination database table's Stored Procedures folder
5. Press F5 at..
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uBLTdbofIHA.4140@.TK2MSFTNGP04.phx.gbl...
> Dean
> multiple stored procedures
>
> "Dean Slindee" <slindee@.charter.net> wrote in message
> news:2B130575-80A1-40DA-A83C-C5A71D2AA39F@.microsoft.com...
>
copying stored procedures in SQL Server 2005?
from one database engine to another, as quickly as using DTS in SQL Server
2000? Other than restoring from a backup.
Thanks,
Dean SDean
In objects explorer details select stored procedures you want to copy to,
then right click and Script Stored Procedure as -- CREATE TO -- new
query, make sure that you under scope a target database and press F5
"Dean Slindee" <slindee@.charter.net> wrote in message
news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
> Is there a quick way to copy a set of stored procedures in SQL Server 2005
> from one database engine to another, as quickly as using DTS in SQL Server
> 2000? Other than restoring from a backup.
> Thanks,
> Dean S|||On Mar 4, 11:23 pm, "Dean Slindee" <slin...@.charter.net> wrote:
> Is there a quick way to copy a set of stored procedures in SQL Server 2005
> from one database engine to another, as quickly as using DTS in SQL Server
> 2000? Other than restoring from a backup.
> Thanks,
> Dean S
I suggest that you can find a stored procedure named
dbo.sp_generate_script.
Using dbo.sp_generate_script, you can get all stored procedures in a
database.
GOOD LUCK.|||Does this procedure copy one stored procedure at a time, or multiple stored
procedures?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OwmbByffIHA.1900@.TK2MSFTNGP02.phx.gbl...
> Dean
> In objects explorer details select stored procedures you want to copy
> to, then right click and Script Stored Procedure as -- CREATE TO -- new
> query, make sure that you under scope a target database and press F5
>
>
>
> "Dean Slindee" <slindee@.charter.net> wrote in message
> news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
>> Is there a quick way to copy a set of stored procedures in SQL Server
>> 2005 from one database engine to another, as quickly as using DTS in SQL
>> Server 2000? Other than restoring from a backup.
>> Thanks,
>> Dean S
>|||Dean
multiple stored procedures
"Dean Slindee" <slindee@.charter.net> wrote in message
news:2B130575-80A1-40DA-A83C-C5A71D2AA39F@.microsoft.com...
> Does this procedure copy one stored procedure at a time, or multiple
> stored procedures?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OwmbByffIHA.1900@.TK2MSFTNGP02.phx.gbl...
>> Dean
>> In objects explorer details select stored procedures you want to copy
>> to, then right click and Script Stored Procedure as -- CREATE TO --
>> new query, make sure that you under scope a target database and press F5
>>
>>
>>
>> "Dean Slindee" <slindee@.charter.net> wrote in message
>> news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
>> Is there a quick way to copy a set of stored procedures in SQL Server
>> 2005 from one database engine to another, as quickly as using DTS in SQL
>> Server 2000? Other than restoring from a backup.
>> Thanks,
>> Dean S
>>
>|||Uri
One answer to my question could have been:
Create a new SSIS package using the "Transfer SQL Server Objects" tool.
In the tool, fill in the parameters and connections and execute the package.
This is conceptually similar to the former DTS process.
One just has to keep redefining a "temp" SSIS package, or create several
"work" packages, per database.
Your process would be more useful for a quick transfer; no package required.
However, I have been unable to accurately follow your brief instructions.
Would you please expand on the instructions with numbered bullet points?
Like:
1. In SQL Server 2005 Management Studio, click on the Source database table's
Stored Procedures folder.
2. Select the stored procedures to be copied (I can only select one at a
time).
3. Right click and select Script Stored Procedure as CREATE TO:
4. Now, click on the Destination database table's Stored Procedures folder
5. Press F5 at..
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uBLTdbofIHA.4140@.TK2MSFTNGP04.phx.gbl...
> Dean
> multiple stored procedures
>
> "Dean Slindee" <slindee@.charter.net> wrote in message
> news:2B130575-80A1-40DA-A83C-C5A71D2AA39F@.microsoft.com...
>> Does this procedure copy one stored procedure at a time, or multiple
>> stored procedures?
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:OwmbByffIHA.1900@.TK2MSFTNGP02.phx.gbl...
>> Dean
>> In objects explorer details select stored procedures you want to copy
>> to, then right click and Script Stored Procedure as -- CREATE TO --
>> new query, make sure that you under scope a target database and press F5
>>
>>
>>
>> "Dean Slindee" <slindee@.charter.net> wrote in message
>> news:7D625CC4-05B4-4BF6-87F1-BA670532B06B@.microsoft.com...
>> Is there a quick way to copy a set of stored procedures in SQL Server
>> 2005 from one database engine to another, as quickly as using DTS in
>> SQL Server 2000? Other than restoring from a backup.
>> Thanks,
>> Dean S
>>
>
Tuesday, March 20, 2012
copying server objects
how to do this but also want to copy a number of DTS packages, jobs and
alerts that relate to this database. Is there any way that I can copy
them or will I need to create them again on the new server.
Many Thanks
Laurence BreezeYou can copy DTS packages by opening up the current package and choosing
"Package/Save As..." from the menu bar. Be careful to make sure your
database references within the DTS package are still appropriate on the
new server.
Both jobs and alerts can be scripted and that script executed on the new
server - right click the jobs or alerts and choose "All Tasks/Generate
SQL Script...". More than one job or alert can be selected at a time if
you desire.
Good luck,
Tony Sebion
"Laurence Breeze" <i.l.breeze@.open.ac.uk> wrote in message
news:433D4E58.2050802@.open.ac.uk:
> I want to copy a database from one server to another. I'm happy about
> how to do this but also want to copy a number of DTS packages, jobs and
> alerts that relate to this database. Is there any way that I can copy
> them or will I need to create them again on the new server.
> Many Thanks
> Laurence Breeze|||Hi
You may want to read
http://support.microsoft.com/defaul...b;en-us;Q314546
John
"Laurence Breeze" <i.l.breeze@.open.ac.uk> wrote in message
news:433D4E58.2050802@.open.ac.uk...
>I want to copy a database from one server to another. I'm happy about how
>to do this but also want to copy a number of DTS packages, jobs and alerts
>that relate to this database. Is there any way that I can copy them or
>will I need to create them again on the new server.
> Many Thanks
> Laurence Breezesql
Monday, March 19, 2012
Copying DTS Packages to new server
Regards JimPackages are saved in msdb..sysdtspackages - you just need to copy the relevant rows from that table.
Note that sysdtspackages is undocumented so this may not work in the future.
If you prefer this is an SP to load all packages and save them to files - just change the save to save to a server. This will lose the graphics as there is no context for it and no way at present to load the stream.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_SavePackages]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_SavePackages]
GO
Create procedure s_SavePackages
@.Path varchar(128)
as
/*
*/
set nocount on
declare @.objPackage int
declare @.PackageName varchar(128)
declare @.rc int
declare @.ServerName varchar(128)
declare @.FileName varchar(128)
declare @.FilePath varchar(128)
declare @.cmd varchar(2000)
select @.ServerName = @.@.ServerName ,
@.FilePath = @.Path
if right(@.Path,1) <> '\'
begin
select @.Path = @.Path + '\'
end
-- create output directory - will fail if already exists but ...
select @.cmd = 'mkdir ' + @.FilePath
exec master..xp_cmdshell @.cmd
create table #packages (PackageName varchar(128))
insert #packages
(PackageName)
select distinct name
from msdb..sysdtspackages
select @.PackageName = ''
while @.PackageName < (select max(PackageName) from #packages)
begin
select @.PackageName = min(PackageName) from #packages where PackageName > @.PackageName
select @.FileName = @.FilePath + @.PackageName + '.dts'
exec @.rc = sp_OACreate 'DTS.Package', @.objPackage output
if @.rc <> 0
begin
raiserror('failed to create package rc = %d', 16, -1, @.rc)
return
end
exec @.rc = sp_OAMethod @.objPackage, 'LoadFromSQLServer' , null,
@.ServerName = @.ServerName, @.Flags = 256, @.PackageName = @.PackageName
if @.rc <> 0
begin
raiserror('failed to load package rc = %d, package = %s', 16, -1, @.rc, @.PackageName)
return
end
-- delete old file
select @.cmd = 'del ' + @.FileName
exec master..xp_cmdshell @.cmd, no_output
exec @.rc = sp_OAMethod @.objPackage, 'SaveToStorageFile', null, @.FileName
if @.rc <> 0
begin
raiserror('failed to save package rc = %d, package = %s', 16, -1, @.rc, @.PackageName)
return
end
exec @.rc = sp_OADestroy @.objPackage
end
go
Copying DTS Packages across Servers
Now my brain isn't quite where it should be right about now - so hopefully you will be able to put me at rest.
I have been building a new server with SQL2000 on it. Some of the stuff on our existing server is going to be migrated across - however I for the life of me cannot make any sense of how to move stuff (like DTS packages) from one server to another.
moving the Database's - no problems, but all the other guff in the tree (in Enterprise Manager) I cant seem to get.
Any assistance here is greatly appreciated.
Cheers
TroyHi Troy,
You can save the packages as a structure file and save them to disk and then transfer them to your new server...
Or,.. you could get cunning and write a quick app to do it. I have some asp pages that I have written that will do this and I can flick them your way if you want... they will probably need tweaking to suit your needs...
What's the weather like in Auckland today??|||Hey thanks for that.
I will go and have a play and see what I can do - I assume it is a pretty straight forward process dumping them to file? And then reimporting them?
As for the ASP page - ummm errr, would love to take you up on that offer, but sadly I am about as literate with that sort of stuff as Cinderalla with a grenade laucher. (unless it is blatantly obvious). What are your thoughts on this?
Hmmm as for the weather - well all in all okay, and it is meant to be good through the weekend. Which will make a nice change because our new pool should have a chance to dry up and return to what was our lawn :(
Hopefully better in Aust.|||It's a relatively simple asp page,... the key thing is the SQL that we use. You could probably write it up as another stored proc or something to carry out the same function... ASP is a piece of cake to understand assuming some general knowledge of scripting languages...
Have a think about it and let me know.
Weather in Sydney today is overcast and cool,... not raining yet though... I think my cousin who is visiting from Chch brought this cloud with him...
Sunday, March 11, 2012
Copying database using "Copy Database" - still failing after SP2
I am struggling with the "Copy Database Wizard" in SQL Server 2005. I am used to working with DTS to copy data from one server to another, but with the new tools, I am having serious problems (in fact, it's unusable)
1. When copying a database using the "SQL Management Object" method, I always get errors concerning logins. If I select not to copy logins, I get errors "sp_grantdbaccess failed". If I do select to copy logins, the logins can't be created because the machine names are different (one the source machine, the login is called MACHINE1/mylogin, but on the destination machine, such a login cannot be created)
2. For small databases, I ALWAYS get the error "CREATE DATABASE failed. Primary file must be at least 3 MB to accommodate a copy of the model database". There is no way to specify a larger size for the database in the wizard.
Note: copying databases using detach/attach is not an option (the servers cannot see eachother's shares)
I must say that in general I hate the new management tools. Enterprise Manager had its flaws too, but the quality of the "SQL Server Management Studio" seems very low IMHO.
Regards,
Philippe Leybaert
Blake05 wrote:
I can get the copy to work but it will not copy any of my stored procedures or functions.
This is actually very simple, but the error messages are of no help. The problem is that there is a bug in at least one stored procedure or function. Go through them all until you find the ones that you can't save/update, and repair or delete (if obsolete) them. Once they are all functioning, the copy will work without a hitch.
|||I notice that no one from Microsoft has answered this problem.It seems to me the Copy Database Wizard is completely ignoring the fact that I am always trying to deselect the logins. It just happily tries to copy them even though it's going to a development machine that will only see 4 of the 100 logins on the production server.
I struggled with this problem for days and was crossing my fingers that it would be solved in SP1, sadly it's not.
Detaching is not an option for production databases!!!
Fix this Microsoft!!!|||
We are aware of many issues in the Copy Database Wizard. We're doing a lot of work on the wizard in SP2 to address these.
If you have a specific scenario you would like to see addressed, please file a defect report here: http://lab.msdn.microsoft.com/productfeedback/Default.aspx. Defects reports entered at the feedback center are used to prioritize work for future versions and service packs.
Thanks,
Steve
Hi Philippe,
You can now install the latest version of the Copy Database Wizard from the following location:
http://www.microsoft.com/sql/ctp.mspx
This CTP version includes many improvements and hopefully they should address most of your current issues.
Thanks,
Oscar.
Hello Oscar
I have a problem with Copy Database Wizard to.
Have agent account as sysadmin in both source and target database
Target server has CTP Dec 2006 installed. Bat I can’t install it to the source “production” system
Managed to transfer five databases fixing the error found at the error log file
At the sixth database I have an error that I can not understand
The error appears when trying to create a view at the target system.
errorCode=-1073548784 description=Executing the query "create view [dbo].[VShift_Cost]
as
select sf.ShiftID, SFD.UnitID, sum(sfd.charge) as Shift_Charge
from shiftcostdetail sfd inner join shiftcost sf on sfd.shiftcostid = sf.shiftcostid
group by sf.shiftid, SFD.unitID
" failed with the following error: "Invalid object name 'shiftcostdetail'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The shiftcostdetail is an existing table and the view works fine at the source system.
Can you help?
Thanks
|||Hi Panzin,
Could you please tell me where are you launching CDW from? You should launch CDW from the target machine is this machine is the one that has the latest version installed. From here, you can select the source the database and perform the copy. Could you please confirm that this is what you are doing? You could also select the "Save Transfer Logs" option before clicking "Finish" and send me the corresponding TransferDump*.sql files generated in :
C:\Documents and Settings\<user-name>\Local Settings\Application Data\Microsoft\SQL Server\Smo
It would be useful too to select "Write log to a file" before performing the copy and check for any other errors.
I will investigate the error that you described above, but it seems that it could be a dependency issue. I will get back to you once I find more information.
Thanks,
Oscar.
Hi Oscar
Thank you for your reply
The CDW is running from the target system.
The target system is the one with the CTP installed
The posted error is from the log file
I can't find the "Save Transfer Logs" option
Thank's again
|||Hi Panzin,
Are you using the SMO Transfer method to copy the database or Detach/Attach? I believe you are using the SMO Transfer method...
The "Save transfer logs?" checkbox is in the "Configure the Package" page of the wizard.
By the way, are you also copying any extra objects apart from the database? If so, which ones? Are you referencing any objects that are outside this view that might require the selection of some particular extra objects?
Cheers,
Oscar.
Hello Oscar
Thank you for your help
I'm using the SMO transfer method and the related objects that i'm copying are the "logins"
At the configure the Pacage page I'm using
Logging options "Text File" and the posted error is from the text file ...
also show that
1. db created at target server is at compatibility level 90 (source level=80)
2. when I changed the view script and add "dbo." in front of table names the error move to next view creation.
!!! this does not work for all views
Cheers
Nick
|||Hi Nick,
I would really need to see the full log files (i.e. TransferDump*.sql and SMO Tranfer log) in order to be able to help more. You could send them directly to me at oscar.naim@.microsoft.com.
By the way, are you defining extended properties for this particular database?
Thanks,
Oscar.
Hello oscar
I do not have any extended properties at my database.
I realy can;t find any files named TransferDump*.* in my disk
I found a directory SMO but it is empty
the directory is created under the SQLAgent acount documents and settings...
I monitor the directory as the CDW is executed and a file was created
but when the execution stops with or with out an error the file is deleted
so I can;t postit to you
Thank you
Copying database using "Copy Database"
I am struggling with the "Copy Database Wizard" in SQL Server 2005. I am used to working with DTS to copy data from one server to another, but with the new tools, I am having serious problems (in fact, it's unusable)
1. When copying a database using the "SQL Management Object" method, I always get errors concerning logins. If I select not to copy logins, I get errors "sp_grantdbaccess failed". If I do select to copy logins, the logins can't be created because the machine names are different (one the source machine, the login is called MACHINE1/mylogin, but on the destination machine, such a login cannot be created)
2. For small databases, I ALWAYS get the error "CREATE DATABASE failed. Primary file must be at least 3 MB to accommodate a copy of the model database". There is no way to specify a larger size for the database in the wizard.
Note: copying databases using detach/attach is not an option (the servers cannot see eachother's shares)
I must say that in general I hate the new management tools. Enterprise Manager had its flaws too, but the quality of the "SQL Server Management Studio" seems very low IMHO.
Regards,
Philippe Leybaert
Blake05 wrote:
I can get the copy to work but it will not copy any of my stored procedures or functions.
This is actually very simple, but the error messages are of no help. The problem is that there is a bug in at least one stored procedure or function. Go through them all until you find the ones that you can't save/update, and repair or delete (if obsolete) them. Once they are all functioning, the copy will work without a hitch.
|||I notice that no one from Microsoft has answered this problem.It seems to me the Copy Database Wizard is completely ignoring the fact that I am always trying to deselect the logins. It just happily tries to copy them even though it's going to a development machine that will only see 4 of the 100 logins on the production server.
I struggled with this problem for days and was crossing my fingers that it would be solved in SP1, sadly it's not.
Detaching is not an option for production databases!!!
Fix this Microsoft!!!|||
We are aware of many issues in the Copy Database Wizard. We're doing a lot of work on the wizard in SP2 to address these.
If you have a specific scenario you would like to see addressed, please file a defect report here: http://lab.msdn.microsoft.com/productfeedback/Default.aspx. Defects reports entered at the feedback center are used to prioritize work for future versions and service packs.
Thanks,
Steve
Hi Philippe,
You can now install the latest version of the Copy Database Wizard from the following location:
http://www.microsoft.com/sql/ctp.mspx
This CTP version includes many improvements and hopefully they should address most of your current issues.
Thanks,
Oscar.
Hello Oscar
I have a problem with Copy Database Wizard to.
Have agent account as sysadmin in both source and target database
Target server has CTP Dec 2006 installed. Bat I can’t install it to the source “production” system
Managed to transfer five databases fixing the error found at the error log file
At the sixth database I have an error that I can not understand
The error appears when trying to create a view at the target system.
errorCode=-1073548784 description=Executing the query "create view [dbo].[VShift_Cost]
as
select sf.ShiftID, SFD.UnitID, sum(sfd.charge) as Shift_Charge
from shiftcostdetail sfd inner join shiftcost sf on sfd.shiftcostid = sf.shiftcostid
group by sf.shiftid, SFD.unitID
" failed with the following error: "Invalid object name 'shiftcostdetail'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The shiftcostdetail is an existing table and the view works fine at the source system.
Can you help?
Thanks
|||Hi Panzin,
Could you please tell me where are you launching CDW from? You should launch CDW from the target machine is this machine is the one that has the latest version installed. From here, you can select the source the database and perform the copy. Could you please confirm that this is what you are doing? You could also select the "Save Transfer Logs" option before clicking "Finish" and send me the corresponding TransferDump*.sql files generated in :
C:\Documents and Settings\<user-name>\Local Settings\Application Data\Microsoft\SQL Server\Smo
It would be useful too to select "Write log to a file" before performing the copy and check for any other errors.
I will investigate the error that you described above, but it seems that it could be a dependency issue. I will get back to you once I find more information.
Thanks,
Oscar.
Hi Oscar
Thank you for your reply
The CDW is running from the target system.
The target system is the one with the CTP installed
The posted error is from the log file
I can't find the "Save Transfer Logs" option
Thank's again
|||Hi Panzin,
Are you using the SMO Transfer method to copy the database or Detach/Attach? I believe you are using the SMO Transfer method...
The "Save transfer logs?" checkbox is in the "Configure the Package" page of the wizard.
By the way, are you also copying any extra objects apart from the database? If so, which ones? Are you referencing any objects that are outside this view that might require the selection of some particular extra objects?
Cheers,
Oscar.
Hello Oscar
Thank you for your help
I'm using the SMO transfer method and the related objects that i'm copying are the "logins"
At the configure the Pacage page I'm using
Logging options "Text File" and the posted error is from the text file ...
also show that
1. db created at target server is at compatibility level 90 (source level=80)
2. when I changed the view script and add "dbo." in front of table names the error move to next view creation.
!!! this does not work for all views
Cheers
Nick
|||Hi Nick,
I would really need to see the full log files (i.e. TransferDump*.sql and SMO Tranfer log) in order to be able to help more. You could send them directly to me at oscar.naim@.microsoft.com.
By the way, are you defining extended properties for this particular database?
Thanks,
Oscar.
Hello oscar
I do not have any extended properties at my database.
I realy can;t find any files named TransferDump*.* in my disk
I found a directory SMO but it is empty
the directory is created under the SQLAgent acount documents and settings...
I monitor the directory as the CDW is executed and a file was created
but when the execution stops with or with out an error the file is deleted
so I can;t postit to you
Thank you
Copying database using "Copy Database"
I am struggling with the "Copy Database Wizard" in SQL Server 2005. I am used to working with DTS to copy data from one server to another, but with the new tools, I am having serious problems (in fact, it's unusable)
1. When copying a database using the "SQL Management Object" method, I always get errors concerning logins. If I select not to copy logins, I get errors "sp_grantdbaccess failed". If I do select to copy logins, the logins can't be created because the machine names are different (one the source machine, the login is called MACHINE1/mylogin, but on the destination machine, such a login cannot be created)
2. For small databases, I ALWAYS get the error "CREATE DATABASE failed. Primary file must be at least 3 MB to accommodate a copy of the model database". There is no way to specify a larger size for the database in the wizard.
Note: copying databases using detach/attach is not an option (the servers cannot see eachother's shares)
I must say that in general I hate the new management tools. Enterprise Manager had its flaws too, but the quality of the "SQL Server Management Studio" seems very low IMHO.
Regards,
Philippe Leybaert
Blake05 wrote:
I can get the copy to work but it will not copy any of my stored procedures or functions.
This is actually very simple, but the error messages are of no help. The problem is that there is a bug in at least one stored procedure or function. Go through them all until you find the ones that you can't save/update, and repair or delete (if obsolete) them. Once they are all functioning, the copy will work without a hitch.
|||I notice that no one from Microsoft has answered this problem.It seems to me the Copy Database Wizard is completely ignoring the fact that I am always trying to deselect the logins. It just happily tries to copy them even though it's going to a development machine that will only see 4 of the 100 logins on the production server.
I struggled with this problem for days and was crossing my fingers that it would be solved in SP1, sadly it's not.
Detaching is not an option for production databases!!!
Fix this Microsoft!!!
|||
We are aware of many issues in the Copy Database Wizard. We're doing a lot of work on the wizard in SP2 to address these.
If you have a specific scenario you would like to see addressed, please file a defect report here: http://lab.msdn.microsoft.com/productfeedback/Default.aspx. Defects reports entered at the feedback center are used to prioritize work for future versions and service packs.
Thanks,
Steve
Hi Philippe,
You can now install the latest version of the Copy Database Wizard from the following location:
http://www.microsoft.com/sql/ctp.mspx
This CTP version includes many improvements and hopefully they should address most of your current issues.
Thanks,
Oscar.
Hello Oscar
I have a problem with Copy Database Wizard to.
Have agent account as sysadmin in both source and target database
Target server has CTP Dec 2006 installed. Bat I can’t install it to the source “production” system
Managed to transfer five databases fixing the error found at the error log file
At the sixth database I have an error that I can not understand
The error appears when trying to create a view at the target system.
errorCode=-1073548784 description=Executing the query "create view [dbo].[VShift_Cost]
as
select sf.ShiftID, SFD.UnitID, sum(sfd.charge) as Shift_Charge
from shiftcostdetail sfd inner join shiftcost sf on sfd.shiftcostid = sf.shiftcostid
group by sf.shiftid, SFD.unitID
" failed with the following error: "Invalid object name 'shiftcostdetail'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The shiftcostdetail is an existing table and the view works fine at the source system.
Can you help?
Thanks
|||Hi Panzin,
Could you please tell me where are you launching CDW from? You should launch CDW from the target machine is this machine is the one that has the latest version installed. From here, you can select the source the database and perform the copy. Could you please confirm that this is what you are doing? You could also select the "Save Transfer Logs" option before clicking "Finish" and send me the corresponding TransferDump*.sql files generated in :
C:\Documents and Settings\<user-name>\Local Settings\Application Data\Microsoft\SQL Server\Smo
It would be useful too to select "Write log to a file" before performing the copy and check for any other errors.
I will investigate the error that you described above, but it seems that it could be a dependency issue. I will get back to you once I find more information.
Thanks,
Oscar.
Hi Oscar
Thank you for your reply
The CDW is running from the target system.
The target system is the one with the CTP installed
The posted error is from the log file
I can't find the "Save Transfer Logs" option
Thank's again
|||Hi Panzin,
Are you using the SMO Transfer method to copy the database or Detach/Attach? I believe you are using the SMO Transfer method...
The "Save transfer logs?" checkbox is in the "Configure the Package" page of the wizard.
By the way, are you also copying any extra objects apart from the database? If so, which ones? Are you referencing any objects that are outside this view that might require the selection of some particular extra objects?
Cheers,
Oscar.
Hello Oscar
Thank you for your help
I'm using the SMO transfer method and the related objects that i'm copying are the "logins"
At the configure the Pacage page I'm using
Logging options "Text File" and the posted error is from the text file ...
also show that
1. db created at target server is at compatibility level 90 (source level=80)
2. when I changed the view script and add "dbo." in front of table names the error move to next view creation.
!!! this does not work for all views
Cheers
Nick
|||Hi Nick,
I would really need to see the full log files (i.e. TransferDump*.sql and SMO Tranfer log) in order to be able to help more. You could send them directly to me at oscar.naim@.microsoft.com.
By the way, are you defining extended properties for this particular database?
Thanks,
Oscar.
Hello oscar
I do not have any extended properties at my database.
I realy can;t find any files named TransferDump*.* in my disk
I found a directory SMO but it is empty
the directory is created under the SQLAgent acount documents and settings...
I monitor the directory as the CDW is executed and a file was created
but when the execution stops with or with out an error the file is deleted
so I can;t postit to you
Thank you
Copying database using "Copy Database"
I am struggling with the "Copy Database Wizard" in SQL Server 2005. I am used to working with DTS to copy data from one server to another, but with the new tools, I am having serious problems (in fact, it's unusable)
1. When copying a database using the "SQL Management Object" method, I always get errors concerning logins. If I select not to copy logins, I get errors "sp_grantdbaccess failed". If I do select to copy logins, the logins can't be created because the machine names are different (one the source machine, the login is called MACHINE1/mylogin, but on the destination machine, such a login cannot be created)
2. For small databases, I ALWAYS get the error "CREATE DATABASE failed. Primary file must be at least 3 MB to accommodate a copy of the model database". There is no way to specify a larger size for the database in the wizard.
Note: copying databases using detach/attach is not an option (the servers cannot see eachother's shares)
I must say that in general I hate the new management tools. Enterprise Manager had its flaws too, but the quality of the "SQL Server Management Studio" seems very low IMHO.
Regards,
Philippe Leybaert
Blake05 wrote:
I can get the copy to work but it will not copy any of my stored procedures or functions.
This is actually very simple, but the error messages are of no help. The problem is that there is a bug in at least one stored procedure or function. Go through them all until you find the ones that you can't save/update, and repair or delete (if obsolete) them. Once they are all functioning, the copy will work without a hitch.
|||I notice that no one from Microsoft has answered this problem.It seems to me the Copy Database Wizard is completely ignoring the fact that I am always trying to deselect the logins. It just happily tries to copy them even though it's going to a development machine that will only see 4 of the 100 logins on the production server.
I struggled with this problem for days and was crossing my fingers that it would be solved in SP1, sadly it's not.
Detaching is not an option for production databases!!!
Fix this Microsoft!!!
|||
We are aware of many issues in the Copy Database Wizard. We're doing a lot of work on the wizard in SP2 to address these.
If you have a specific scenario you would like to see addressed, please file a defect report here: http://lab.msdn.microsoft.com/productfeedback/Default.aspx. Defects reports entered at the feedback center are used to prioritize work for future versions and service packs.
Thanks,
Steve
Hi Philippe,
You can now install the latest version of the Copy Database Wizard from the following location:
http://www.microsoft.com/sql/ctp.mspx
This CTP version includes many improvements and hopefully they should address most of your current issues.
Thanks,
Oscar.
Hello Oscar
I have a problem with Copy Database Wizard to.
Have agent account as sysadmin in both source and target database
Target server has CTP Dec 2006 installed. Bat I can’t install it to the source “production” system
Managed to transfer five databases fixing the error found at the error log file
At the sixth database I have an error that I can not understand
The error appears when trying to create a view at the target system.
errorCode=-1073548784 description=Executing the query "create view [dbo].[VShift_Cost]
as
select sf.ShiftID, SFD.UnitID, sum(sfd.charge) as Shift_Charge
from shiftcostdetail sfd inner join shiftcost sf on sfd.shiftcostid = sf.shiftcostid
group by sf.shiftid, SFD.unitID
" failed with the following error: "Invalid object name 'shiftcostdetail'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The shiftcostdetail is an existing table and the view works fine at the source system.
Can you help?
Thanks
|||Hi Panzin,
Could you please tell me where are you launching CDW from? You should launch CDW from the target machine is this machine is the one that has the latest version installed. From here, you can select the source the database and perform the copy. Could you please confirm that this is what you are doing? You could also select the "Save Transfer Logs" option before clicking "Finish" and send me the corresponding TransferDump*.sql files generated in :
C:\Documents and Settings\<user-name>\Local Settings\Application Data\Microsoft\SQL Server\Smo
It would be useful too to select "Write log to a file" before performing the copy and check for any other errors.
I will investigate the error that you described above, but it seems that it could be a dependency issue. I will get back to you once I find more information.
Thanks,
Oscar.
Hi Oscar
Thank you for your reply
The CDW is running from the target system.
The target system is the one with the CTP installed
The posted error is from the log file
I can't find the "Save Transfer Logs" option
Thank's again
|||Hi Panzin,
Are you using the SMO Transfer method to copy the database or Detach/Attach? I believe you are using the SMO Transfer method...
The "Save transfer logs?" checkbox is in the "Configure the Package" page of the wizard.
By the way, are you also copying any extra objects apart from the database? If so, which ones? Are you referencing any objects that are outside this view that might require the selection of some particular extra objects?
Cheers,
Oscar.
Hello Oscar
Thank you for your help
I'm using the SMO transfer method and the related objects that i'm copying are the "logins"
At the configure the Pacage page I'm using
Logging options "Text File" and the posted error is from the text file ...
also show that
1. db created at target server is at compatibility level 90 (source level=80)
2. when I changed the view script and add "dbo." in front of table names the error move to next view creation.
!!! this does not work for all views
Cheers
Nick
|||Hi Nick,
I would really need to see the full log files (i.e. TransferDump*.sql and SMO Tranfer log) in order to be able to help more. You could send them directly to me at oscar.naim@.microsoft.com.
By the way, are you defining extended properties for this particular database?
Thanks,
Oscar.
Hello oscar
I do not have any extended properties at my database.
I realy can;t find any files named TransferDump*.* in my disk
I found a directory SMO but it is empty
the directory is created under the SQLAgent acount documents and settings...
I monitor the directory as the CDW is executed and a file was created
but when the execution stops with or with out an error the file is deleted
so I can;t postit to you
Thank you
Copying database using "Copy Database"
I am struggling with the "Copy Database Wizard" in SQL Server 2005. I am used to working with DTS to copy data from one server to another, but with the new tools, I am having serious problems (in fact, it's unusable)
1. When copying a database using the "SQL Management Object" method, I always get errors concerning logins. If I select not to copy logins, I get errors "sp_grantdbaccess failed". If I do select to copy logins, the logins can't be created because the machine names are different (one the source machine, the login is called MACHINE1/mylogin, but on the destination machine, such a login cannot be created)
2. For small databases, I ALWAYS get the error "CREATE DATABASE failed. Primary file must be at least 3 MB to accommodate a copy of the model database". There is no way to specify a larger size for the database in the wizard.
Note: copying databases using detach/attach is not an option (the servers cannot see eachother's shares)
I must say that in general I hate the new management tools. Enterprise Manager had its flaws too, but the quality of the "SQL Server Management Studio" seems very low IMHO.
Regards,
Philippe Leybaert
Blake05 wrote:
I can get the copy to work but it will not copy any of my stored procedures or functions.
This is actually very simple, but the error messages are of no help. The problem is that there is a bug in at least one stored procedure or function. Go through them all until you find the ones that you can't save/update, and repair or delete (if obsolete) them. Once they are all functioning, the copy will work without a hitch.
|||I notice that no one from Microsoft has answered this problem.It seems to me the Copy Database Wizard is completely ignoring the fact that I am always trying to deselect the logins. It just happily tries to copy them even though it's going to a development machine that will only see 4 of the 100 logins on the production server.
I struggled with this problem for days and was crossing my fingers that it would be solved in SP1, sadly it's not.
Detaching is not an option for production databases!!!
Fix this Microsoft!!!
|||
We are aware of many issues in the Copy Database Wizard. We're doing a lot of work on the wizard in SP2 to address these.
If you have a specific scenario you would like to see addressed, please file a defect report here: http://lab.msdn.microsoft.com/productfeedback/Default.aspx. Defects reports entered at the feedback center are used to prioritize work for future versions and service packs.
Thanks,
Steve
Hi Philippe,
You can now install the latest version of the Copy Database Wizard from the following location:
http://www.microsoft.com/sql/ctp.mspx
This CTP version includes many improvements and hopefully they should address most of your current issues.
Thanks,
Oscar.
Hello Oscar
I have a problem with Copy Database Wizard to.
Have agent account as sysadmin in both source and target database
Target server has CTP Dec 2006 installed. Bat I can’t install it to the source “production” system
Managed to transfer five databases fixing the error found at the error log file
At the sixth database I have an error that I can not understand
The error appears when trying to create a view at the target system.
errorCode=-1073548784 description=Executing the query "create view [dbo].[VShift_Cost]
as
select sf.ShiftID, SFD.UnitID, sum(sfd.charge) as Shift_Charge
from shiftcostdetail sfd inner join shiftcost sf on sfd.shiftcostid = sf.shiftcostid
group by sf.shiftid, SFD.unitID
" failed with the following error: "Invalid object name 'shiftcostdetail'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The shiftcostdetail is an existing table and the view works fine at the source system.
Can you help?
Thanks
|||Hi Panzin,
Could you please tell me where are you launching CDW from? You should launch CDW from the target machine is this machine is the one that has the latest version installed. From here, you can select the source the database and perform the copy. Could you please confirm that this is what you are doing? You could also select the "Save Transfer Logs" option before clicking "Finish" and send me the corresponding TransferDump*.sql files generated in :
C:\Documents and Settings\<user-name>\Local Settings\Application Data\Microsoft\SQL Server\Smo
It would be useful too to select "Write log to a file" before performing the copy and check for any other errors.
I will investigate the error that you described above, but it seems that it could be a dependency issue. I will get back to you once I find more information.
Thanks,
Oscar.
Hi Oscar
Thank you for your reply
The CDW is running from the target system.
The target system is the one with the CTP installed
The posted error is from the log file
I can't find the "Save Transfer Logs" option
Thank's again
|||Hi Panzin,
Are you using the SMO Transfer method to copy the database or Detach/Attach? I believe you are using the SMO Transfer method...
The "Save transfer logs?" checkbox is in the "Configure the Package" page of the wizard.
By the way, are you also copying any extra objects apart from the database? If so, which ones? Are you referencing any objects that are outside this view that might require the selection of some particular extra objects?
Cheers,
Oscar.
Hello Oscar
Thank you for your help
I'm using the SMO transfer method and the related objects that i'm copying are the "logins"
At the configure the Pacage page I'm using
Logging options "Text File" and the posted error is from the text file ...
also show that
1. db created at target server is at compatibility level 90 (source level=80)
2. when I changed the view script and add "dbo." in front of table names the error move to next view creation.
!!! this does not work for all views
Cheers
Nick
|||Hi Nick,
I would really need to see the full log files (i.e. TransferDump*.sql and SMO Tranfer log) in order to be able to help more. You could send them directly to me at oscar.naim@.microsoft.com.
By the way, are you defining extended properties for this particular database?
Thanks,
Oscar.
Hello oscar
I do not have any extended properties at my database.
I realy can;t find any files named TransferDump*.* in my disk
I found a directory SMO but it is empty
the directory is created under the SQLAgent acount documents and settings...
I monitor the directory as the CDW is executed and a file was created
but when the execution stops with or with out an error the file is deleted
so I can;t postit to you
Thank you
Thursday, March 8, 2012
copying data oracle2sql
I discovered that copying data from oracle using "openquery" with linked
server is sevaral time slower that using "dtsexecui" (dts import/export
wzard). I used the same query for both methods. Does anybode has expirience
solving slowly openquery behaviour? My linked server has "allow in process"
enabled.
Seems dts import/export wizzard doesn't use rollback segment? May I could
rewrite my query?
select *
from openquery (sapr3_prd, '
select MATNR, WERKS, LGORT, LFGJA, LFMON, LABST
, UMLME ,INSME, EINME, SPEME, RETME, VKLAB
, VKUML
from sapr3.mardh
where mandt = ''600''
')
Ramunasopenquery is not designed to move large amount of data.
the import/export wizard use the bulk insert feature of SQL Server which
result on the highest performance you can for a loading.
"Seems dts import/export wizzard doesn't use rollback segment?"
what do you mean by this?
you can import data in 1 transaction or multiple transactions
"Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
news:1174662643.833343@.loger.vpmarket.int...
> Hi,
> I discovered that copying data from oracle using "openquery" with linked
> server is sevaral time slower that using "dtsexecui" (dts import/export
> wzard). I used the same query for both methods. Does anybode has
> expirience
> solving slowly openquery behaviour? My linked server has "allow in
> process"
> enabled.
> Seems dts import/export wizzard doesn't use rollback segment? May I could
> rewrite my query?
> select *
> from openquery (sapr3_prd, '
> select MATNR, WERKS, LGORT, LFGJA, LFMON, LABST
> , UMLME ,INSME, EINME, SPEME, RETME, VKLAB
> , VKUML
> from sapr3.mardh
> where mandt = ''600''
> ')
> Ramunas
>|||you think the bottleneck is the insert part into sql, not select from
oracle? i think different - sql server is able to select data from oracle in
different way.
the openquery from oracle always fails with message: "ora-01555 snapshot too
old: rollback segment number XX with name YYY to small". my idea is to use
fresh table and load data in the same transaction like:
begin tran
truncate table MyTable
insert into MyTable
select * from openquery (sapr3_prd, '....')
if @.@.error <> 0
rollback tran
else
commit tran
is it possible to achieve this with dtsexecui? it's strange but dtsexecui
never get this error, so my idea this is because import/export wizard
doesn't use rollback segment in oracle. you said that possible to import
data in one transaction, what you mean? because when I use dtsexecui, and
try to load 100 mln of rows and if import fails after 80 mln, so these 80
mln of rows will be added to the table.
"Jeje" <willgart@.hotmail.com> wrote in message
news:OcLKPJmbHHA.4476@.TK2MSFTNGP03.phx.gbl...[vbcol=seagreen]
> openquery is not designed to move large amount of data.
> the import/export wizard use the bulk insert feature of SQL Server which
> result on the highest performance you can for a loading.
> "Seems dts import/export wizzard doesn't use rollback segment?"
> what do you mean by this?
> you can import data in 1 transaction or multiple transactions
> "Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
> news:1174662643.833343@.loger.vpmarket.int...
could[vbcol=seagreen]|||no, the insert into sql server is not the problem.
the problem is the loading part from the Oracle driver, and the overhead of
the openquery syntax.
using a bulk insert command through an SSIS package will provide far better
performance.
"Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
news:1174888638.520904@.loger.vpmarket.int...
> you think the bottleneck is the insert part into sql, not select from
> oracle? i think different - sql server is able to select data from oracle
> in
> different way.
> the openquery from oracle always fails with message: "ora-01555 snapshot
> too
> old: rollback segment number XX with name YYY to small". my idea is to use
> fresh table and load data in the same transaction like:
> begin tran
> truncate table MyTable
> insert into MyTable
> select * from openquery (sapr3_prd, '....')
> if @.@.error <> 0
> rollback tran
> else
> commit tran
> is it possible to achieve this with dtsexecui? it's strange but dtsexecui
> never get this error, so my idea this is because import/export wizard
> doesn't use rollback segment in oracle. you said that possible to import
> data in one transaction, what you mean? because when I use dtsexecui, and
> try to load 100 mln of rows and if import fails after 80 mln, so these 80
> mln of rows will be added to the table.
>
>
> "Jeje" <willgart@.hotmail.com> wrote in message
> news:OcLKPJmbHHA.4476@.TK2MSFTNGP03.phx.gbl...
> could
>
copying data oracle2sql
I discovered that copying data from oracle using "openquery" with linked
server is sevaral time slower that using "dtsexecui" (dts import/export
wzard). I used the same query for both methods. Does anybode has expirience
solving slowly openquery behaviour? My linked server has "allow in process"
enabled.
Seems dts import/export wizzard doesn't use rollback segment? May I could
rewrite my query?
select *
from openquery (sapr3_prd, '
select MATNR, WERKS, LGORT, LFGJA, LFMON, LABST
, UMLME ,INSME, EINME, SPEME, RETME, VKLAB
, VKUML
from sapr3.mardh
where mandt = ''600''
')
Ramunas
openquery is not designed to move large amount of data.
the import/export wizard use the bulk insert feature of SQL Server which
result on the highest performance you can for a loading.
"Seems dts import/export wizzard doesn't use rollback segment?"
what do you mean by this?
you can import data in 1 transaction or multiple transactions
"Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
news:1174662643.833343@.loger.vpmarket.int...
> Hi,
> I discovered that copying data from oracle using "openquery" with linked
> server is sevaral time slower that using "dtsexecui" (dts import/export
> wzard). I used the same query for both methods. Does anybode has
> expirience
> solving slowly openquery behaviour? My linked server has "allow in
> process"
> enabled.
> Seems dts import/export wizzard doesn't use rollback segment? May I could
> rewrite my query?
> select *
> from openquery (sapr3_prd, '
> select MATNR, WERKS, LGORT, LFGJA, LFMON, LABST
> , UMLME ,INSME, EINME, SPEME, RETME, VKLAB
> , VKUML
> from sapr3.mardh
> where mandt = ''600''
> ')
> Ramunas
>
|||you think the bottleneck is the insert part into sql, not select from
oracle? i think different - sql server is able to select data from oracle in
different way.
the openquery from oracle always fails with message: "ora-01555 snapshot too
old: rollback segment number XX with name YYY to small". my idea is to use
fresh table and load data in the same transaction like:
begin tran
truncate table MyTable
insert into MyTable
select * from openquery (sapr3_prd, '....')
if @.@.error <> 0
rollback tran
else
commit tran
is it possible to achieve this with dtsexecui? it's strange but dtsexecui
never get this error, so my idea this is because import/export wizard
doesn't use rollback segment in oracle. you said that possible to import
data in one transaction, what you mean? because when I use dtsexecui, and
try to load 100 mln of rows and if import fails after 80 mln, so these 80
mln of rows will be added to the table.
"Jeje" <willgart@.hotmail.com> wrote in message
news:OcLKPJmbHHA.4476@.TK2MSFTNGP03.phx.gbl...[vbcol=seagreen]
> openquery is not designed to move large amount of data.
> the import/export wizard use the bulk insert feature of SQL Server which
> result on the highest performance you can for a loading.
> "Seems dts import/export wizzard doesn't use rollback segment?"
> what do you mean by this?
> you can import data in 1 transaction or multiple transactions
> "Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
> news:1174662643.833343@.loger.vpmarket.int...
could[vbcol=seagreen]
|||no, the insert into sql server is not the problem.
the problem is the loading part from the Oracle driver, and the overhead of
the openquery syntax.
using a bulk insert command through an SSIS package will provide far better
performance.
"Ramunas Balukonis" <ramblk2@.hotmail.com> wrote in message
news:1174888638.520904@.loger.vpmarket.int...
> you think the bottleneck is the insert part into sql, not select from
> oracle? i think different - sql server is able to select data from oracle
> in
> different way.
> the openquery from oracle always fails with message: "ora-01555 snapshot
> too
> old: rollback segment number XX with name YYY to small". my idea is to use
> fresh table and load data in the same transaction like:
> begin tran
> truncate table MyTable
> insert into MyTable
> select * from openquery (sapr3_prd, '....')
> if @.@.error <> 0
> rollback tran
> else
> commit tran
> is it possible to achieve this with dtsexecui? it's strange but dtsexecui
> never get this error, so my idea this is because import/export wizard
> doesn't use rollback segment in oracle. you said that possible to import
> data in one transaction, what you mean? because when I use dtsexecui, and
> try to load 100 mln of rows and if import fails after 80 mln, so these 80
> mln of rows will be added to the table.
>
>
> "Jeje" <willgart@.hotmail.com> wrote in message
> news:OcLKPJmbHHA.4476@.TK2MSFTNGP03.phx.gbl...
> could
>
Wednesday, March 7, 2012
copying a table from one database to another "last" doesnt appear the same
another. I am using the dts wizard to import the data. After I
successfully import the data, I open both tables to compare the
records to make sure they are the same. I right click on a field and
click "last" for both tables. However, the record is different for
both. If I do a query the record is still there but they do not show
up in the same order. Why does'nt the import wizard import the
records in the same order? Any help would be greatly appreciated.Rows in a table are not ordered. The Wizard does an INSERT... SELECT from
one table to another and unless there's a clustered index on the table
there's a good chance that the rows will be physically stored in a different
order.
Don't worry about the physical order - just use SELECT... ORDER BY if you
want to see the rows ordered.
--
David Portas
----
Please reply only to the newsgroup
--|||Great! Thank you very much for your help! After submitting this
question I noticed that microsoft mentions this on their site:
"Because SQL Server can use parallel scans to retrieve data, the data
bulk copied from an instance of SQL Server is not guaranteed to be in
any specific order unless you bulk copy from a query and specify an
ORDER BY clause."
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||But note that even if you manage to insert the rows in a specific order
there is no guarantee that they will be sorted in that order when you view
the data. If you require a specific order then you need to use ORDER BY
every time you want to view the data.
--
David Portas
----
Please reply only to the newsgroup
--
Copying a DTS Package and Jobs
Just want to ask how can I copy a DTS Package? Something like "Save As"...saving a DTS Package to another package name in the same server, or copying a DTS package to another server.
What I am doing right now, is I create the whole package again just to have another copy of it.
Same question with a Job.
Thank you so much. :)Why not try scripting it then just execute?|||for jobs u can right click on a job and use "generate sql script" to script it and execute it with QA.
for DTS it is a bit tricky. u can save-as an open DTS package as "structured storage file" (location drop-down). copy that disk file to another machine. and then right click on Data-Transformation-Services to open that saved package. need to save it again in SQL server of that machine.
Copying a DTS Package and Jobs
Just want to ask how can I copy a DTS Package? Something like "Save As"...saving a DTS Package to another package name in the same server, or copying a DTS package to another server.
What I am doing right now, is I create the whole package again just to have another copy of it.
Same question with a Job.
Thank you so much.Hey,
If you are using Enterprise manager, double click the package( or right click on the package, there will be a "Design package" option), it will open DTS Package designer, there you will find a menu under the main menu, click on Package and there will be a Save as... command there|||Hi Galexyus,
Thanks for taking the time to answer my query.
I found the "Save As" command already. What am I doing?
It's just in front of me, right before my very eyes. =)
Many thanks to you.
God Bless.
Saturday, February 25, 2012
CopyFile in DTS ActiveX Script Task
w
is my code I'm using in my DTS ActiveX Script Task. I'm getting a "File Not
Found" message on Line 25 (I marked it below). Can someone see the problem
with my code'
Dim NYear
Dim NMonth
Dim NDate
NYear = Year(Date)
NMonth = Month(Date)
NDate = CStr(NYear) + CStr(NMonth)
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile =
" \\wstlfp02\ebs$\SQLDataAccess\WPE\PandGI
nvoicesToMCFA\PGInvoiceDetailYYYYMM
"
sDestinationFile =
" \\wstlfp02\ebs$\SQLDataAccess\WPE\PandGI
nvoicesToMCFA\PGInvoiceDetail" +
"_RunDate_" + NDate
oFSO.CopyFile sSourceFile, sDestinationFile '***(This is Line 25)***
' Clean Up
Set oFSO = Nothing
Main = DTSTaskExecResult_SuccessHi
I assume you have tried outputting the file names in a MsgBox and validated
that they are correct? http://www.sqldts.com/default.aspx?292 has an example
of using the filesystem object to copy a file, and
http://www.sqldts.com/default.aspx?200 has an example of using the date as
part of a filename.
Make sure that the account that you are running this has permissions to the
share, it may be worth getting it working with a local drive first.
John
"atchleykl" wrote:
> I am trying to copy a file and giving it a name with a date behind it. Be
low
> is my code I'm using in my DTS ActiveX Script Task. I'm getting a "File N
ot
> Found" message on Line 25 (I marked it below). Can someone see the proble
m
> with my code'
> Dim NYear
> Dim NMonth
> Dim NDate
> NYear = Year(Date)
> NMonth = Month(Date)
> NDate = CStr(NYear) + CStr(NMonth)
> Dim oFSO
> Dim sSourceFile
> Dim sDestinationFile
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> sSourceFile =
> " \\wstlfp02\ebs$\SQLDataAccess\WPE\PandGI
nvoicesToMCFA\PGInvoiceDetailYYYY
MM"
> sDestinationFile =
> " \\wstlfp02\ebs$\SQLDataAccess\WPE\PandGI
nvoicesToMCFA\PGInvoiceDetail" +
> "_RunDate_" + NDate
> oFSO.CopyFile sSourceFile, sDestinationFile '***(This is Line 25)***
> ' Clean Up
> Set oFSO = Nothing
> Main = DTSTaskExecResult_Success
>
Friday, February 24, 2012
Copy, Delete Files, and Transfer via DTS
I need to transfer files from another server to my database server (SQL
Server 7).
The job details is:
1. copy the files to backup folder ( d:\ftp\backup_data\ ), the backup
filename added with currentdate and time. I use xp_cmdshell.
2. load the file content to database. I use DTS from text file.
3. delete the source file. (xp_cmdshell).
The problem is xp_cmdshell is denied for accessing a mapping path, so copy
and deletion process will not run. I've try both sql server administrator
level or NT 4 administrator level login, but it still did'nt work.
Is there's anyway to do this?
Thanks in advance
TeguhThe access rights you will need to move, copy are not
yours, instead its the service account of you sql server.
Give the directory that rather than your own user id, and
that should do it.
Peter
"Do not awake the sleeping dragon for you are crunchy and
taste good with ketchup".
>--Original Message--
>Hi,
>I need to transfer files from another server to my
database server (SQL
>Server 7).
>The job details is:
>1. copy the files to backup folder (
d:\ftp\backup_data\ ), the backup
>filename added with currentdate and time. I use
xp_cmdshell.
>2. load the file content to database. I use DTS from text
file.
>3. delete the source file. (xp_cmdshell).
>The problem is xp_cmdshell is denied for accessing a
mapping path, so copy
>and deletion process will not run. I've try both sql
server administrator
>level or NT 4 administrator level login, but it still
did'nt work.
>Is there's anyway to do this?
>Thanks in advance
>Teguh
>
>.
>
Copy Wizard failed?
Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:Unspecified error
Step Error code: 80004005
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:1100
How do I resolve this?
Both the source database and destination database have valid
authentications.It's likely related to permissions. For permissions
requirements, service account requirements, refer to the
following article:
INF: Understanding and Troubleshooting the Copy Database
Wizard in SQL Server 2000
http://support.microsoft.com/?id=274463
-Sue
On Wed, 3 Dec 2003 18:21:41 -0500, "Ed"
<eddiemarino@.hotmail.com> wrote:
>I tried to use Copy Database wizard but it keeps returning this error:
>Step Error Source: Microsoft Data Transformation Services (DTS) Package
>Step Error Description:Unspecified error
>Step Error code: 80004005
>Step Error Help File:sqldts80.hlp
>Step Error Help Context ID:1100
>
>How do I resolve this?
>Both the source database and destination database have valid
>authentications.
>|||Thanks, Sue.
Could a database be copied without using this wizard?
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:ii01tvo98f6qoe1rspo94u3i2lrm3mssne@.4ax.com...
> It's likely related to permissions. For permissions
> requirements, service account requirements, refer to the
> following article:
> INF: Understanding and Troubleshooting the Copy Database
> Wizard in SQL Server 2000
> http://support.microsoft.com/?id=274463
> -Sue
> On Wed, 3 Dec 2003 18:21:41 -0500, "Ed"
> <eddiemarino@.hotmail.com> wrote:
> >I tried to use Copy Database wizard but it keeps returning this error:
> >
> >Step Error Source: Microsoft Data Transformation Services (DTS) Package
> >Step Error Description:Unspecified error
> >
> >Step Error code: 80004005
> >Step Error Help File:sqldts80.hlp
> >Step Error Help Context ID:1100
> >
> >
> >How do I resolve this?
> >
> >Both the source database and destination database have valid
> >authentications.
> >
>|||Hi
It is not clear why you want to use this but maybe the way around it is to
use a different method to copy the database:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q314546
http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b224071
John
"Ed" <eddiemarino@.hotmail.com> wrote in message
news:%23weAzjnuDHA.1060@.TK2MSFTNGP12.phx.gbl...
> I tried to use Copy Database wizard but it keeps returning this error:
> Step Error Source: Microsoft Data Transformation Services (DTS) Package
> Step Error Description:Unspecified error
> Step Error code: 80004005
> Step Error Help File:sqldts80.hlp
> Step Error Help Context ID:1100
>
> How do I resolve this?
> Both the source database and destination database have valid
> authentications.
>|||Yes...you can copy a backup file to the destination server
and restore the backup. You can use sp_detach_db and
sp_attach_db.
-Sue
On Fri, 5 Dec 2003 11:00:32 -0500, "Ed"
<eddiemarino@.hotmail.com> wrote:
>Thanks, Sue.
>Could a database be copied without using this wizard?
>"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
>news:ii01tvo98f6qoe1rspo94u3i2lrm3mssne@.4ax.com...
>> It's likely related to permissions. For permissions
>> requirements, service account requirements, refer to the
>> following article:
>> INF: Understanding and Troubleshooting the Copy Database
>> Wizard in SQL Server 2000
>> http://support.microsoft.com/?id=274463
>> -Sue
>> On Wed, 3 Dec 2003 18:21:41 -0500, "Ed"
>> <eddiemarino@.hotmail.com> wrote:
>> >I tried to use Copy Database wizard but it keeps returning this error:
>> >
>> >Step Error Source: Microsoft Data Transformation Services (DTS) Package
>> >Step Error Description:Unspecified error
>> >
>> >Step Error code: 80004005
>> >Step Error Help File:sqldts80.hlp
>> >Step Error Help Context ID:1100
>> >
>> >
>> >How do I resolve this?
>> >
>> >Both the source database and destination database have valid
>> >authentications.
>> >
>