Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Thursday, March 29, 2012

DBA Format

I am a developer who recently stepped in for our DBA when they (abruptly)
left and am not sure how to setup a deployment for one of our clients.
I think I could do a detach then have them attach or a backup then send them
the backup.
I would like to ask how a DBA would like to see what I am sending out.
Also, a pointer to the documentation would help.
Thanks for your help
Lance
The answer to your question depends a lot on what it actually is you're
deploying. A whole app, a database only, updates to an existing database,
...?
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:N85xc.23665$aM1.8131@.fed1read02...
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send
them
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>
|||Just a database. New installation.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> The answer to your question depends a lot on what it actually is you're
> deploying. A whole app, a database only, updates to an existing database,
> ...?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:N85xc.23665$aM1.8131@.fed1read02...
(abruptly)
> them
>
|||You could do a backup and send them the .BAK file, then they could restore
it. However, this has some dependencies, e.g. data folder locations, etc.
Simplest might be to detach the database, send the MDF/LDF file(s), then
re-attach.
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...[vbcol=seagreen]
> Just a database. New installation.
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
database,[vbcol=seagreen]
> (abruptly)
send
>
|||Another thing you might consider doing is scripting out the database and the
objects it contains. You can do this by right-clicking a database in
Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...
> Just a database. New installation.
|||Wouldn't the ATTACH be a problem if it is in a different folder location?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:OFs%23bjNTEHA.3700@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> You could do a backup and send them the .BAK file, then they could restore
> it. However, this has some dependencies, e.g. data folder locations, etc.
> Simplest might be to detach the database, send the MDF/LDF file(s), then
> re-attach.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
you're[vbcol=seagreen]
> database,
clients.[vbcol=seagreen]
> send
out.
>
|||Doesn't this miss the records in the database? I have about 1/2 million
rows I need to include in what I send them.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uBSjakNTEHA.2372@.TK2MSFTNGP11.phx.gbl...
> Another thing you might consider doing is scripting out the database and
the
> objects it contains. You can do this by right-clicking a database in
> Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
>
|||you need to detach\reattach or Restore a backup using the "WITH MOVE" Option
if you need more info let me know
cheers,
Greg Jackson
PDX, Oregon
|||Lance,
My preferred approach would be to backup/restore, but as Aaron said
there are dependencies and you will likely orphan any users in the
database. This can however be fixed by adding new logins to the
destination box and mapping orphaned users to the logins using
sp_change_users_login.
You will likely also need the WITH MOVE option of the RESTORE DATABASE
statement. You might also want to change the database owner to something
meaningful on the destination, I would recommend sa. Use
sp_changedbowner to do this.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Lance Geeck wrote:
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send them
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>

DBA Format

I am a developer who recently stepped in for our DBA when they (abruptly)
left and am not sure how to setup a deployment for one of our clients.
I think I could do a detach then have them attach or a backup then send them
the backup.
I would like to ask how a DBA would like to see what I am sending out.
Also, a pointer to the documentation would help.
Thanks for your help
LanceThe answer to your question depends a lot on what it actually is you're
deploying. A whole app, a database only, updates to an existing database,
...?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:N85xc.23665$aM1.8131@.fed1read02...
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send
them
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>|||Just a database. New installation.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
> The answer to your question depends a lot on what it actually is you're
> deploying. A whole app, a database only, updates to an existing database,
> ...?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:N85xc.23665$aM1.8131@.fed1read02...
> > I am a developer who recently stepped in for our DBA when they
(abruptly)
> > left and am not sure how to setup a deployment for one of our clients.
> >
> > I think I could do a detach then have them attach or a backup then send
> them
> > the backup.
> >
> > I would like to ask how a DBA would like to see what I am sending out.
> >
> > Also, a pointer to the documentation would help.
> >
> > Thanks for your help
> > Lance
> >
> >
>|||You could do a backup and send them the .BAK file, then they could restore
it. However, this has some dependencies, e.g. data folder locations, etc.
Simplest might be to detach the database, send the MDF/LDF file(s), then
re-attach.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...
> Just a database. New installation.
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
> > The answer to your question depends a lot on what it actually is you're
> > deploying. A whole app, a database only, updates to an existing
database,
> > ...?
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "Lance Geeck" <lgeeck@.cox.net> wrote in message
> > news:N85xc.23665$aM1.8131@.fed1read02...
> > > I am a developer who recently stepped in for our DBA when they
> (abruptly)
> > > left and am not sure how to setup a deployment for one of our clients.
> > >
> > > I think I could do a detach then have them attach or a backup then
send
> > them
> > > the backup.
> > >
> > > I would like to ask how a DBA would like to see what I am sending out.
> > >
> > > Also, a pointer to the documentation would help.
> > >
> > > Thanks for your help
> > > Lance
> > >
> > >
> >
> >
>|||Another thing you might consider doing is scripting out the database and the
objects it contains. You can do this by right-clicking a database in
Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...
> Just a database. New installation.|||Wouldn't the ATTACH be a problem if it is in a different folder location?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:OFs%23bjNTEHA.3700@.TK2MSFTNGP09.phx.gbl...
> You could do a backup and send them the .BAK file, then they could restore
> it. However, this has some dependencies, e.g. data folder locations, etc.
> Simplest might be to detach the database, send the MDF/LDF file(s), then
> re-attach.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
> > Just a database. New installation.
> >
> > "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> > news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
> > > The answer to your question depends a lot on what it actually is
you're
> > > deploying. A whole app, a database only, updates to an existing
> database,
> > > ...?
> > >
> > > --
> > > http://www.aspfaq.com/
> > > (Reverse address to reply.)
> > >
> > >
> > >
> > >
> > > "Lance Geeck" <lgeeck@.cox.net> wrote in message
> > > news:N85xc.23665$aM1.8131@.fed1read02...
> > > > I am a developer who recently stepped in for our DBA when they
> > (abruptly)
> > > > left and am not sure how to setup a deployment for one of our
clients.
> > > >
> > > > I think I could do a detach then have them attach or a backup then
> send
> > > them
> > > > the backup.
> > > >
> > > > I would like to ask how a DBA would like to see what I am sending
out.
> > > >
> > > > Also, a pointer to the documentation would help.
> > > >
> > > > Thanks for your help
> > > > Lance
> > > >
> > > >
> > >
> > >
> >
> >
>|||Doesn't this miss the records in the database? I have about 1/2 million
rows I need to include in what I send them.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uBSjakNTEHA.2372@.TK2MSFTNGP11.phx.gbl...
> Another thing you might consider doing is scripting out the database and
the
> objects it contains. You can do this by right-clicking a database in
> Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
> > Just a database. New installation.
>|||you need to detach\reattach or Restore a backup using the "WITH MOVE" Option
if you need more info let me know
cheers,
Greg Jackson
PDX, Oregon|||Lance,
My preferred approach would be to backup/restore, but as Aaron said
there are dependencies and you will likely orphan any users in the
database. This can however be fixed by adding new logins to the
destination box and mapping orphaned users to the logins using
sp_change_users_login.
You will likely also need the WITH MOVE option of the RESTORE DATABASE
statement. You might also want to change the database owner to something
meaningful on the destination, I would recommend sa. Use
sp_changedbowner to do this.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Lance Geeck wrote:
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send them
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>

DBA Format

I am a developer who recently stepped in for our DBA when they (abruptly)
left and am not sure how to setup a deployment for one of our clients.
I think I could do a detach then have them attach or a backup then send them
the backup.
I would like to ask how a DBA would like to see what I am sending out.
Also, a pointer to the documentation would help.
Thanks for your help
LanceThe answer to your question depends a lot on what it actually is you're
deploying. A whole app, a database only, updates to an existing database,
...?
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:N85xc.23665$aM1.8131@.fed1read02...
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send
them
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>|||Just a database. New installation.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
> The answer to your question depends a lot on what it actually is you're
> deploying. A whole app, a database only, updates to an existing database,
> ...?
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:N85xc.23665$aM1.8131@.fed1read02...
(abruptly)[vbcol=seagreen]
> them
>|||You could do a backup and send them the .BAK file, then they could restore
it. However, this has some dependencies, e.g. data folder locations, etc.
Simplest might be to detach the database, send the MDF/LDF file(s), then
re-attach.
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...
> Just a database. New installation.
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:u$0ZJfNTEHA.3608@.TK2MSFTNGP11.phx.gbl...
database,[vbcol=seagreen]
> (abruptly)
send[vbcol=seagreen]
>|||Another thing you might consider doing is scripting out the database and the
objects it contains. You can do this by right-clicking a database in
Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
http://www.aspfaq.com/
(Reverse address to reply.)
"Lance Geeck" <lgeeck@.cox.net> wrote in message
news:6k5xc.23713$aM1.9744@.fed1read02...
> Just a database. New installation.|||Wouldn't the ATTACH be a problem if it is in a different folder location?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:OFs%23bjNTEHA.3700@.TK2MSFTNGP09.phx.gbl...
> You could do a backup and send them the .BAK file, then they could restore
> it. However, this has some dependencies, e.g. data folder locations, etc.
> Simplest might be to detach the database, send the MDF/LDF file(s), then
> re-attach.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
you're[vbcol=seagreen]
> database,
clients.[vbcol=seagreen]
> send
out.[vbcol=seagreen]
>|||Doesn't this miss the records in the database? I have about 1/2 million
rows I need to include in what I send them.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uBSjakNTEHA.2372@.TK2MSFTNGP11.phx.gbl...
> Another thing you might consider doing is scripting out the database and
the
> objects it contains. You can do this by right-clicking a database in
> Enterprise Manager, all tasks, generate SQL script, and follow the wizard.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Lance Geeck" <lgeeck@.cox.net> wrote in message
> news:6k5xc.23713$aM1.9744@.fed1read02...
>|||you need to detach\reattach or Restore a backup using the "WITH MOVE" Option
if you need more info let me know
cheers,
Greg Jackson
PDX, Oregon|||Lance,
My preferred approach would be to backup/restore, but as Aaron said
there are dependencies and you will likely orphan any users in the
database. This can however be fixed by adding new logins to the
destination box and mapping orphaned users to the logins using
sp_change_users_login.
You will likely also need the WITH MOVE option of the RESTORE DATABASE
statement. You might also want to change the database owner to something
meaningful on the destination, I would recommend sa. Use
sp_changedbowner to do this.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Lance Geeck wrote:
> I am a developer who recently stepped in for our DBA when they (abruptly)
> left and am not sure how to setup a deployment for one of our clients.
> I think I could do a detach then have them attach or a backup then send th
em
> the backup.
> I would like to ask how a DBA would like to see what I am sending out.
> Also, a pointer to the documentation would help.
> Thanks for your help
> Lance
>

DBA Administration db

HI, I would like to set up a dba admin database on each of the instances that I have. Is there any recommended standard format for this database?

Thanks

It would be totally dependent upon how you plan to use it. There are just too many variables.

DBA Administration db

HI, I would like to set up a dba admin database on each of the instances that I have. Is there any recommended standard format for this database?

Thanks

It would be totally dependent upon how you plan to use it. There are just too many variables.

Wednesday, March 7, 2012

DB name changes daily

Hi,
I am trying to write SQL automation that runs SQL scripts against the daily drop of the database. Each day, a new DB is created using the format (Testdb + xxxxx )where xxxxx= computed build number. Thus today's db name might be TEST12345 and tomorrow wo
uld be Test12346. I have a script that creates the dbname such as Test12345 and when I run it, I get the expected result, but when I try this statement
Use @.dbname
I get an error.
Is there a way to introduce a variable with a Use statement so that I can automatically open the latest db?
Thanks
Hi,
'USE' statement will change the DB context for the current connection and
then go back to where it was before (Default datbase context).
Doing this in an exec will change the context until the exec is completed
and then go back to default database context.
This is small example to show how to do it. This example uses the Northwind
database.
This database has a stored procedure 'emp_list' . From the master database
and execute the following:-
set quoted_identifier off
declare @.dbname varchar(15), @.procname varchar(25)
declare @.startdate varchar(10) , @.enddate varchar(10)
set @.dbname = 'northwind'
set @.procname = '[emp_list]'
exec ('USE ' + @.dbname + ' execute ' + @.procname )
the last statement translates to:
exec ( USE northwind execute [emp_list])
But after the execution again the context will go to the default database.
Note:
The best option rather than using the above is:- (SP_DEFAULTDB)
1. Have a common login
2. Every time after creating the new database use the sp_defaultdb procedure
to change the default db of the login
3. After this when ever that user logins the database context will be the
new database and there is nolt required to give USE XXXXX
Thanks
Hari
MCDBA
"Tomas" <anonymous@.discussions.microsoft.com> wrote in message
news:F9E1B6D0-5378-45AD-8A2C-6DF194B86B0A@.microsoft.com...
> Hi,
> I am trying to write SQL automation that runs SQL scripts against the
daily drop of the database. Each day, a new DB is created using the format
(Testdb + xxxxx )where xxxxx= computed build number. Thus today's db name
might be TEST12345 and tomorrow would be Test12346. I have a script that
creates the dbname such as Test12345 and when I run it, I get the expected
result, but when I try this statement
> Use @.dbname
> I get an error.
> Is there a way to introduce a variable with a Use statement so that I can
automatically open the latest db?
> Thanks