Showing posts with label ran. Show all posts
Showing posts with label ran. Show all posts

Sunday, March 25, 2012

db_owner problem

I recently registered my hosted database server on my pc. When I ran aspnet_regsql.exe the table created have dbo as schema, but when I create a news table throught stored procedure it has my username as schema.
When I buildt my site on my pc all tables have dbo as schema.
How do I make all tables on my hosted server db have same schema?

Thanks

The very Newbie

The schema of new objects is determined by the default schema of current database user. So just make sure all database users have the same default schema (for example). You can easily do this in Management Studio.|||

Thanks for your reply Iori_Jay.

Where and how in Management Studio do I make sure that default schema is MyUsername(current database user) instead of getting schema "dbo" for some tables and schema "MyUsername" for other tables?
When I ran aspnet_regsql.exe all tables and procedures have schema dbo allthough I use my username to create them.

Thanks again

The Very Newbie
We learn from masters

|||You can check the defaut schema of a database user by checkin the Properties of the user under SQL instance->Databases->your database->Security->Users.|||

Thanks again Iori_Jay,

In the security folder of my database there are 2 users: dbo and myself. I need to transfer schema, but don´t know how to make it work. My hosted server uses sql server 2000.

Thanks

|||

In SQL 2000 SHCEMA is not a seperated object, it equals to the owner of the object. So you need to change to owner of the object using such command:

EXEC sp_changeobjectowner 'myself.tbl1', 'dbo'

|||

Thanks a lotIori_Jay.

It works fine.

sql

Saturday, February 25, 2012

DB Maintenance Planner - Jobs not running

I set up 12 DB maintenance jobs on 3 separate DB's through the DB Maintenance
Planner - each job has a daily time to run.
All the jobs ran last night EXCEPT:
MSDB db trans log backup / MSDB db Integrity Checks
Master db trans log backup / Master db Integrity Checks
I am assuming that it is not necessary to run these jobs and I should delete
them. Am I right?
Thanks in advance.
bill
Hi,
I agree; Since there is no much data changes, it is not required to perform
transaction log backup on MSDB and Master databases.
Thanks
Hari
"WCM" <WCM@.discussions.microsoft.com> wrote in message
news:CC358189-EEC8-4FF3-91B0-F91972909ABE@.microsoft.com...
>I set up 12 DB maintenance jobs on 3 separate DB's through the DB
>Maintenance
> Planner - each job has a daily time to run.
> All the jobs ran last night EXCEPT:
> MSDB db trans log backup / MSDB db Integrity Checks
> Master db trans log backup / Master db Integrity Checks
> I am assuming that it is not necessary to run these jobs and I should
> delete
> them. Am I right?
> Thanks in advance.
> bill
|||Hari, thank you for the confirmation. b.
"Hari Prasad" wrote:

> Hi,
> I agree; Since there is no much data changes, it is not required to perform
> transaction log backup on MSDB and Master databases.
> Thanks
> Hari
> "WCM" <WCM@.discussions.microsoft.com> wrote in message
> news:CC358189-EEC8-4FF3-91B0-F91972909ABE@.microsoft.com...
>
>
|||Thank you, Tibor. I was concerned about those particular job failures. I
will set them up again and see if they work. If not, I am told that setting
up a new user (same username in both Windows and Sql Server) with permission
to run jobs may be necessary. Thanks again.
"Tibor Karaszi" wrote:

> But you definitely want to do integrity checks on these databases... :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%233r43%23CFHHA.4580@.TK2MSFTNGP05.phx.gbl...
>

Friday, February 17, 2012

dB is Loading

SQL & Win 2K
I have a dB that I restored and it got hung up at a phase
where it is '(Loading)'. I ran the script below, from a
post of Paul's from a while back, and an error message
was returned that 'Database 'xxx' cannot be opened. It is
in the middle of a restore.;' How can I get rid of this
dB?
alter database [xxx] set read_write with rollback
immediate
go
exec sp_removedbreplication [xxx]
go
use master
go
drop database [xxx]
go
TIA,
Larry...
Larry,
as far as I recall, my other solution was for a database stuck in RO mode.
For your case you could try
restore database xxx with recovery
Alternatively, you could restore the most recent backup with norecovery and
the logs with norecovery, apart from the last one which is with recovery.
HTH,
Paul Ibison
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul,
I ran the command you suggested and QA returned...
File 'xxx' was only partially restored by a database or
file restore. The entire file must be successfully
restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Any othere Ideas?
Larry..
|||Larry,
then it looks like your backup file wasn't fully
restored, so try restoring it again using with recovery.
Rgds,
Paul Ibison
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||As always, thanks for your help.