Showing posts with label steps. Show all posts
Showing posts with label steps. Show all posts

Wednesday, March 7, 2012

Database restore

Hi All,

I am trying to restore a database from backup on another system [my
client's] but I had to follow some weired steps.

Step 1. Restore the database from EM 's GUI.
[Users as on My machine get restored but their logins are not
activated. So I have to follow the next steps]

sp_helpuser shows me the userName but null LoginName and
DefaultDatabase

Step 2. Create a new login , grant access to the DB

Step 3. Then run the script to change the ownership from earlier DB
user to new user.

Step 4. In EM make new user as dbo.

Really weired steps.

There should be easier way to restore the database in simple and
effective manner

With warm regards
Jatinderjsfromynr (jatinder.singh@.clovertechnologies.com) writes:
> I am trying to restore a database from backup on another system [my
> client's] but I had to follow some weired steps.
> Step 1. Restore the database from EM 's GUI.
> [Users as on My machine get restored but their logins are not
> activated. So I have to follow the next steps]
> sp_helpuser shows me the userName but null LoginName and
> DefaultDatabase
> Step 2. Create a new login , grant access to the DB
> Step 3. Then run the script to change the ownership from earlier DB
> user to new user.
> Step 4. In EM make new user as dbo.

Look at sp_change_users_login in Books Online.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland,
It worked, I have another problem
by mistake I created all of my table in a user not as SA.so I tried
this to change the ownership

select 'EXEC sp_changeobjectowner oldusername'+
char(39)+name+char(39)+','+ char(39) +'dbo'+char(39) from sysobjects
where uid=6 {old user's ID}

It works but I am looking for some easy methods

With warm regards
Jatinder|||jsfromynr (jatinder.singh@.clovertechnologies.com) writes:
> It worked, I have another problem
> by mistake I created all of my table in a user not as SA.so I tried
> this to change the ownership
> select 'EXEC sp_changeobjectowner oldusername'+
> char(39)+name+char(39)+','+ char(39) +'dbo'+char(39) from sysobjects
> where uid=6 {old user's ID}
>
> It works but I am looking for some easy methods

It can't get any easier than that!

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 24, 2012

Database recovery

Hi All,
Plaese excuse me if this sounds like a stupid question, my SQL sever crashed
and all my databases are gone. Which steps do I follow to restore my
database. In the backup folder of the Sql there is folders of database names
containg the table names with the extension "bak". Please help
For Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help
|||To add to what Wayne has to say,
You should read the entire section on Backup and Recovery in the Books
Online. That way, you know that you covered all of your bases during the
restore process.
Rick Sawtell
MCT, MCSD, MCDBA
|||You will have to restore the master database first, then the model and msdb.
All of the remaining user databases can then be restored.
Make sure that you have brought the installation back to the same service
pack and hotfix levels before restore the master database.
Sincerely,
Anthony Thomas

"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:ud9IkmN7EHA.2316@.TK2MSFTNGP15.phx.gbl...
For Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help
|||"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help
You may also want to look for any .MDF and .LDF files.
It MAY be possible to reinstall SQL Server and them simply reattach these
sp_attach_db.
These will probably be more recent than your backups.

Database recovery

Hi All,
Plaese excuse me if this sounds like a stupid question, my SQL sever crashed
and all my databases are gone. Which steps do I follow to restore my
database. In the backup folder of the Sql there is folders of database names
containg the table names with the extension "bak". Please helpFor Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help|||To add to what Wayne has to say,
You should read the entire section on Backup and Recovery in the Books
Online. That way, you know that you covered all of your bases during the
restore process.
Rick Sawtell
MCT, MCSD, MCDBA|||You will have to restore the master database first, then the model and msdb.
All of the remaining user databases can then be restored.
Make sure that you have brought the installation back to the same service
pack and hotfix levels before restore the master database.
Sincerely,
Anthony Thomas
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:ud9IkmN7EHA.2316@.TK2MSFTNGP15.phx.gbl...
For Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help|||"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help
You may also want to look for any .MDF and .LDF files.
It MAY be possible to reinstall SQL Server and them simply reattach these
sp_attach_db.
These will probably be more recent than your backups.

Database recovery

Hi All,
Plaese excuse me if this sounds like a stupid question, my SQL sever crashed
and all my databases are gone. Which steps do I follow to restore my
database. In the backup folder of the Sql there is folders of database names
containg the table names with the extension "bak". Please helpFor Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
--
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help|||To add to what Wayne has to say,
You should read the entire section on Backup and Recovery in the Books
Online. That way, you know that you covered all of your bases during the
restore process.
Rick Sawtell
MCT, MCSD, MCDBA|||You will have to restore the master database first, then the model and msdb.
All of the remaining user databases can then be restored.
Make sure that you have brought the installation back to the same service
pack and hotfix levels before restore the master database.
Sincerely,
Anthony Thomas
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:ud9IkmN7EHA.2316@.TK2MSFTNGP15.phx.gbl...
For Each db,
Restore database <dbname> from disk = <completefilename>
You need to determine if you have log backups or only full database backups.
If you have log backups, then each db restore you should add ' with
norecovery', and use the restore log command to restore the logs...
--
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
"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help|||"Nkagi" <Nkagi@.discussions.microsoft.com> wrote in message
news:A0128E1C-76A2-4FFE-B977-E36759C436BF@.microsoft.com...
> Hi All,
> Plaese excuse me if this sounds like a stupid question, my SQL sever
crashed
> and all my databases are gone. Which steps do I follow to restore my
> database. In the backup folder of the Sql there is folders of database
names
> containg the table names with the extension "bak". Please help
You may also want to look for any .MDF and .LDF files.
It MAY be possible to reinstall SQL Server and them simply reattach these
sp_attach_db.
These will probably be more recent than your backups.

Database question...

I have a database that was on a SQL Server that failed. The data file is
intact
but I need to bring it up. What steps do I need to do in order to attach
this to
another SQL Server with the plan of maving it back to the original server
once we
get the server rebuilt.
Any help would be greatly appreciated.You might be able to use sp_attach_db of you have all the files that constitutes the database. A
database backup file is better (RESTORE DATABASE). You also need to make sure that login exists at
the new server (and other stuff needed in the system databases) and then handle login to use mapping
(sp_change_users_login).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:EA95EEE6-1FD6-41E8-A65E-7F8A647A7D55@.microsoft.com...
>I have a database that was on a SQL Server that failed. The data file is
> intact
> but I need to bring it up. What steps do I need to do in order to attach
> this to
> another SQL Server with the plan of maving it back to the original server
> once we
> get the server rebuilt.
> Any help would be greatly appreciated.|||If your data file is intact, you can try sp_attach_single_file_db too...
"Joe" wrote:
> I have a database that was on a SQL Server that failed. The data file is
> intact
> but I need to bring it up. What steps do I need to do in order to attach
> this to
> another SQL Server with the plan of maving it back to the original server
> once we
> get the server rebuilt.
> Any help would be greatly appreciated.

Database question...

I have a database that was on a SQL Server that failed. The data file is
intact
but I need to bring it up. What steps do I need to do in order to attach
this to
another SQL Server with the plan of maving it back to the original server
once we
get the server rebuilt.
Any help would be greatly appreciated.
If your data file is intact, you can try sp_attach_single_file_db too...
"Joe" wrote:

> I have a database that was on a SQL Server that failed. The data file is
> intact
> but I need to bring it up. What steps do I need to do in order to attach
> this to
> another SQL Server with the plan of maving it back to the original server
> once we
> get the server rebuilt.
> Any help would be greatly appreciated.

Database question...

I have a database that was on a SQL Server that failed. The data file is
intact
but I need to bring it up. What steps do I need to do in order to attach
this to
another SQL Server with the plan of maving it back to the original server
once we
get the server rebuilt.
Any help would be greatly appreciated.You might be able to use sp_attach_db of you have all the files that constit
utes the database. A
database backup file is better (RESTORE DATABASE). You also need to make sur
e that login exists at
the new server (and other stuff needed in the system databases) and then han
dle login to use mapping
(sp_change_users_login).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:EA95EEE6-1FD6-41E8-A65E-7F8A647A7D55@.microsoft.com...
>I have a database that was on a SQL Server that failed. The data file is
> intact
> but I need to bring it up. What steps do I need to do in order to attach
> this to
> another SQL Server with the plan of maving it back to the original server
> once we
> get the server rebuilt.
> Any help would be greatly appreciated.|||If your data file is intact, you can try sp_attach_single_file_db too...
"Joe" wrote:

> I have a database that was on a SQL Server that failed. The data file is
> intact
> but I need to bring it up. What steps do I need to do in order to attach
> this to
> another SQL Server with the plan of maving it back to the original server
> once we
> get the server rebuilt.
> Any help would be greatly appreciated.

Friday, February 17, 2012

database performance

hi,
I am having sql 2k and my database retriving data very
slowly why actually i don't no
i want database performance steps so i can configure my
data base very well .
my server configuration is very good 1gb ram p4 machine i
am having
thanks
gajjuWithout a great deal more information like Disk config, server config, CPU
count, Statements being executed, Data Size, Structure of tables etc etc any
advice can only be from 50,000 feet.
A good place to start would be indexes though. You can use the Index Tuning
Wizard to give you an idea of what to apply.
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Gajanan Shinde" <gaju_007@.yahoo.com> wrote in message
news:0c5e01c3662f$a06a8f60$a101280a@.phx.gbl...
> hi,
> I am having sql 2k and my database retriving data very
> slowly why actually i don't no
> i want database performance steps so i can configure my
> data base very well .
> my server configuration is very good 1gb ram p4 machine i
> am having
> thanks
> gajju|||I suggest researching these three books, BOL, SQL Server 2000 performance
tuning and inside SQL server 2000. I agree with Alan in starting with
indexes but not knowing your knowledge level, an understanding of
normalization never hurts.
HTH
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Gajanan Shinde" <gaju_007@.yahoo.com> wrote in message
news:0c5e01c3662f$a06a8f60$a101280a@.phx.gbl...
> hi,
> I am having sql 2k and my database retriving data very
> slowly why actually i don't no
> i want database performance steps so i can configure my
> data base very well .
> my server configuration is very good 1gb ram p4 machine i
> am having
> thanks
> gajju