Showing posts with label secondary. Show all posts
Showing posts with label secondary. Show all posts

Friday, March 30, 2012

question about secondary file

Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben
1) No, you don't need to have a 1:1 relationship between data and log files.
2) If you don't specify a filegroup when you create a table or index, then
it goes into the default filegroup. You can change the default filegroup.
3) See #2. The data go into the table and the table is in whichever
filegroup it was created.
Best practices:
Keep the primary data and log files small. Do not place user objects in the
primary filegroup. Rather, create a separate filegroup and place the
objects there. Change the default filegroup to be something other than the
primary fielgroup.
Note: You can delete secondary data and log files. You cannot delete the
primary ones (file numbers 1 and 2). Thus, to migrate to another file, you
can add files to the user-defined filegroups, empty the original file and
the drop that file. In order to migrate primary files, you need to detach
the DB and move those files. Keeping them small mitigates the downtime.
HTH
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Ben" <b@.en.sd> wrote in message
news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben
|||Thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> schreef in bericht
news:elNsijdfHHA.4704@.TK2MSFTNGP06.phx.gbl...
> 1) No, you don't need to have a 1:1 relationship between data and log
> files.
> 2) If you don't specify a filegroup when you create a table or index, then
> it goes into the default filegroup. You can change the default filegroup.
> 3) See #2. The data go into the table and the table is in whichever
> filegroup it was created.
> Best practices:
> Keep the primary data and log files small. Do not place user objects in
> the
> primary filegroup. Rather, create a separate filegroup and place the
> objects there. Change the default filegroup to be something other than
> the
> primary fielgroup.
> Note: You can delete secondary data and log files. You cannot delete the
> primary ones (file numbers 1 and 2). Thus, to migrate to another file,
> you
> can add files to the user-defined filegroups, empty the original file and
> the drop that file. In order to migrate primary files, you need to detach
> the DB and move those files. Keeping them small mitigates the downtime.
> HTH
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Ben" <b@.en.sd> wrote in message
> news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
> Hi,
> i read about primary and secondary files, but not everything is obvious to
> me.
> If i define a database with a primary + log file and 3 secondary files:
> 1) do i have to also define for each secondary file a log file?
> 2) when i create a table, where is it placed (in the primary, in one of
> the
> secondary files)? Who decides this?
> 3) same question about data
> Thanks
> Ben
>

question about secondary file

Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben1) No, you don't need to have a 1:1 relationship between data and log files.
2) If you don't specify a filegroup when you create a table or index, then
it goes into the default filegroup. You can change the default filegroup.
3) See #2. The data go into the table and the table is in whichever
filegroup it was created.
Best practices:
Keep the primary data and log files small. Do not place user objects in the
primary filegroup. Rather, create a separate filegroup and place the
objects there. Change the default filegroup to be something other than the
primary fielgroup.
Note: You can delete secondary data and log files. You cannot delete the
primary ones (file numbers 1 and 2). Thus, to migrate to another file, you
can add files to the user-defined filegroups, empty the original file and
the drop that file. In order to migrate primary files, you need to detach
the DB and move those files. Keeping them small mitigates the downtime.
HTH
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Ben" <b@.en.sd> wrote in message
news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben|||Thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> schreef in bericht
news:elNsijdfHHA.4704@.TK2MSFTNGP06.phx.gbl...
> 1) No, you don't need to have a 1:1 relationship between data and log
> files.
> 2) If you don't specify a filegroup when you create a table or index, then
> it goes into the default filegroup. You can change the default filegroup.
> 3) See #2. The data go into the table and the table is in whichever
> filegroup it was created.
> Best practices:
> Keep the primary data and log files small. Do not place user objects in
> the
> primary filegroup. Rather, create a separate filegroup and place the
> objects there. Change the default filegroup to be something other than
> the
> primary fielgroup.
> Note: You can delete secondary data and log files. You cannot delete the
> primary ones (file numbers 1 and 2). Thus, to migrate to another file,
> you
> can add files to the user-defined filegroups, empty the original file and
> the drop that file. In order to migrate primary files, you need to detach
> the DB and move those files. Keeping them small mitigates the downtime.
> HTH
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Ben" <b@.en.sd> wrote in message
> news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
> Hi,
> i read about primary and secondary files, but not everything is obvious to
> me.
> If i define a database with a primary + log file and 3 secondary files:
> 1) do i have to also define for each secondary file a log file?
> 2) when i create a table, where is it placed (in the primary, in one of
> the
> secondary files)? Who decides this?
> 3) same question about data
> Thanks
> Ben
>sql

question about secondary file

Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben1) No, you don't need to have a 1:1 relationship between data and log files.
2) If you don't specify a filegroup when you create a table or index, then
it goes into the default filegroup. You can change the default filegroup.
3) See #2. The data go into the table and the table is in whichever
filegroup it was created.
Best practices:
Keep the primary data and log files small. Do not place user objects in the
primary filegroup. Rather, create a separate filegroup and place the
objects there. Change the default filegroup to be something other than the
primary fielgroup.
Note: You can delete secondary data and log files. You cannot delete the
primary ones (file numbers 1 and 2). Thus, to migrate to another file, you
can add files to the user-defined filegroups, empty the original file and
the drop that file. In order to migrate primary files, you need to detach
the DB and move those files. Keeping them small mitigates the downtime.
HTH
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Ben" <b@.en.sd> wrote in message
news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
Hi,
i read about primary and secondary files, but not everything is obvious to
me.
If i define a database with a primary + log file and 3 secondary files:
1) do i have to also define for each secondary file a log file?
2) when i create a table, where is it placed (in the primary, in one of the
secondary files)? Who decides this?
3) same question about data
Thanks
Ben|||Thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> schreef in bericht
news:elNsijdfHHA.4704@.TK2MSFTNGP06.phx.gbl...
> 1) No, you don't need to have a 1:1 relationship between data and log
> files.
> 2) If you don't specify a filegroup when you create a table or index, then
> it goes into the default filegroup. You can change the default filegroup.
> 3) See #2. The data go into the table and the table is in whichever
> filegroup it was created.
> Best practices:
> Keep the primary data and log files small. Do not place user objects in
> the
> primary filegroup. Rather, create a separate filegroup and place the
> objects there. Change the default filegroup to be something other than
> the
> primary fielgroup.
> Note: You can delete secondary data and log files. You cannot delete the
> primary ones (file numbers 1 and 2). Thus, to migrate to another file,
> you
> can add files to the user-defined filegroups, empty the original file and
> the drop that file. In order to migrate primary files, you need to detach
> the DB and move those files. Keeping them small mitigates the downtime.
> HTH
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Ben" <b@.en.sd> wrote in message
> news:%23QuvGZdfHHA.1816@.TK2MSFTNGP06.phx.gbl...
> Hi,
> i read about primary and secondary files, but not everything is obvious to
> me.
> If i define a database with a primary + log file and 3 secondary files:
> 1) do i have to also define for each secondary file a log file?
> 2) when i create a table, where is it placed (in the primary, in one of
> the
> secondary files)? Who decides this?
> 3) same question about data
> Thanks
> Ben
>

Friday, March 23, 2012

Question about Log Shipping: Secondary non-writable?

Hi, i think i'm just getting confused with all the reading. I have 2
servers, A is live and B is doing nothing. I want to create some kind
of warm standby so I looked at replication and log shipping. Repl
seems to be kinda messy so i think i will go with log shipping.
Database is around 2gigs and i can live with an interval of around
1/hr log ship.
Now my question is i read somewhere it says the databse on the second
server is read only...non writable? So what happens if i need to
failover and make the secondary server live? Is it then only readable
but unwritable? What good is that? Any ideas?>...or i just got it
wrong?
The secondary is unwriteable as long as you are shipping logs. Once you
take it live, it becomes he 'real' database server and starts servicing
requests. Note that I am answering your questions on a conceptual level, if
you want the technical details of HOW that happens, that is for a follow-up
question.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.c om...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?
|||There is a great section in SQL Books on Line which describes in detail, how
to make a secondary database primary... including how to get the logins to
match... Search for Log shipping ...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.c om...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?
|||Log Shipping in SQL Server 2000, Part 1
http://www.winnetmag.com/Article/Art...056/23056.html
Log Shipping in SQL Server 2000, Part 2
http://www.winnetmag.com/Article/Art...230/23230.html
/Sukhdev

Question about Log Shipping: Secondary non-writable?

Hi, i think i'm just getting confused with all the reading. I have 2
servers, A is live and B is doing nothing. I want to create some kind
of warm standby so I looked at replication and log shipping. Repl
seems to be kinda messy so i think i will go with log shipping.
Database is around 2gigs and i can live with an interval of around
1/hr log ship.
Now my question is i read somewhere it says the databse on the second
server is read only...non writable? So what happens if i need to
failover and make the secondary server live? Is it then only readable
but unwritable? What good is that? Any ideas?>...or i just got it
wrong?The secondary is unwriteable as long as you are shipping logs. Once you
take it live, it becomes he 'real' database server and starts servicing
requests. Note that I am answering your questions on a conceptual level, if
you want the technical details of HOW that happens, that is for a follow-up
question.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.com...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?|||There is a great section in SQL Books on Line which describes in detail, how
to make a secondary database primary... including how to get the logins to
match... Search for Log shipping ...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.com...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?|||Log Shipping in SQL Server 2000, Part 1
http://www.winnetmag.com/Article/Ar...3056/23056.html
Log Shipping in SQL Server 2000, Part 2
http://www.winnetmag.com/Article/Ar...3230/23230.html
/Sukhdev

Question about Log Shipping: Secondary non-writable?

Hi, i think i'm just getting confused with all the reading. I have 2
servers, A is live and B is doing nothing. I want to create some kind
of warm standby so I looked at replication and log shipping. Repl
seems to be kinda messy so i think i will go with log shipping.
Database is around 2gigs and i can live with an interval of around
1/hr log ship.
Now my question is i read somewhere it says the databse on the second
server is read only...non writable? So what happens if i need to
failover and make the secondary server live? Is it then only readable
but unwritable? What good is that? Any ideas?>...or i just got it
wrong?The secondary is unwriteable as long as you are shipping logs. Once you
take it live, it becomes he 'real' database server and starts servicing
requests. Note that I am answering your questions on a conceptual level, if
you want the technical details of HOW that happens, that is for a follow-up
question.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.com...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?|||There is a great section in SQL Books on Line which describes in detail, how
to make a secondary database primary... including how to get the logins to
match... Search for Log shipping ...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"slycat" <slycat@.consultant.com> wrote in message
news:dec83278.0411091807.15bb247a@.posting.google.com...
> Hi, i think i'm just getting confused with all the reading. I have 2
> servers, A is live and B is doing nothing. I want to create some kind
> of warm standby so I looked at replication and log shipping. Repl
> seems to be kinda messy so i think i will go with log shipping.
> Database is around 2gigs and i can live with an interval of around
> 1/hr log ship.
> Now my question is i read somewhere it says the databse on the second
> server is read only...non writable? So what happens if i need to
> failover and make the secondary server live? Is it then only readable
> but unwritable? What good is that? Any ideas?>...or i just got it
> wrong?|||Log Shipping in SQL Server 2000, Part 1
http://www.winnetmag.com/Article/ArticleID/23056/23056.html
Log Shipping in SQL Server 2000, Part 2
http://www.winnetmag.com/Article/ArticleID/23230/23230.html
/Sukhdev