Thursday, March 29, 2012

Database Structure

Hi Everyone
I Have a Question Concerning DataBase Structure,
If i have a database that contains All Master Tables [user acount,user
detail &...] & i have to make another module for the same system that will
use the same master tables
Is it Preferred To Construct A New Database for this module & any any other
new module or make it all in the same database because they all shared the
same master Data?
Any Help Will Be Appreciated
Hi
Size tends to be one of the drivers as to whether you should partition, if
it is a reasonable size then keep them together. If you used views to access
the data then it would be quite easy to partition it at a later point.
John
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data?
> Any Help Will Be Appreciated
>
|||As John Suggests, Absolutely, positively use views so you can move things if
you wish..
I prefer ( if size permits) to have everything in a single database...
However you may wish to place different modules in different filegroups IF
you think you may wish to backup/restore a module independently of the
others..
If you put things in different databases, remember things can get out of
sync, unless you shut everything down for backups... Also there can be no
cross-database referential integrity...
Try to put them together in the db, but separate if you must.
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
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data?
> Any Help Will Be Appreciated
>
|||"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:eXcEc7keFHA.2736@.TK2MSFTNGP12.phx.gbl...
> As John Suggests, Absolutely, positively use views so you can move things
> if you wish..
> I prefer ( if size permits) to have everything in a single database...
> However you may wish to place different modules in different filegroups IF
> you think you may wish to backup/restore a module independently of the
> others..
> If you put things in different databases, remember things can get out of
> sync, unless you shut everything down for backups... Also there can be no
> cross-database referential integrity...
> Try to put them together in the db, but separate if you must.
>
I agree. But I would go further and say that when you are designing a
system from the ground-up, you never "must". If you think you must seperate
related objects into different databases, think again. Schemas, FileGroups,
views, permissions, etc will usually let you keep the objects in one
database.
David
|||If you place your master data in several databases, then you may end up with
lots of duplicate for indexes, views, triggers, procedures etc, it probably
does not worth unless your table will be really big.
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data?
> Any Help Will Be Appreciated
>

Database Structure

Hi,
Is there a way to automate a process that export the database strucuture once a day !
All the objects - Tables, Indexes, Procedures, Views Etc..
Any Help I apreciate !
Thank's
You could run a sql agent job that uses SQL-DMO to script your database.
Here is an article that I wrote that might help:
http://www.dbazine.com/larsen4.shtml
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Carrasco" <Carrasco@.discussions.microsoft.com> wrote in message
news:5964A3E3-E149-4E4D-812D-B6B62FE9C878@.microsoft.com...
> Hi,
> Is there a way to automate a process that export the database strucuture
once a day !
> All the objects - Tables, Indexes, Procedures, Views Etc..
> Any Help I apreciate !
> Thank's
>
sql

Database Structure

Hi Everyone
I Have a Question Concerning DataBase Structure,
If i have a database that contains All Master Tables [user acount,user
detail &...] & i have to make another module for the same system that will
use the same master tables
Is it Preferred To Construct A New Database for this module & any any other
new module or make it all in the same database because they all shared the
same master Data'
Any Help Will Be AppreciatedHi
Size tends to be one of the drivers as to whether you should partition, if
it is a reasonable size then keep them together. If you used views to access
the data then it would be quite easy to partition it at a later point.
John
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data'
> Any Help Will Be Appreciated
>|||As John Suggests, Absolutely, positively use views so you can move things if
you wish..
I prefer ( if size permits) to have everything in a single database...
However you may wish to place different modules in different filegroups IF
you think you may wish to backup/restore a module independently of the
others..
If you put things in different databases, remember things can get out of
sync, unless you shut everything down for backups... Also there can be no
cross-database referential integrity...
Try to put them together in the db, but separate if you must.
--
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
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data'
> Any Help Will Be Appreciated
>|||"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:eXcEc7keFHA.2736@.TK2MSFTNGP12.phx.gbl...
> As John Suggests, Absolutely, positively use views so you can move things
> if you wish..
> I prefer ( if size permits) to have everything in a single database...
> However you may wish to place different modules in different filegroups IF
> you think you may wish to backup/restore a module independently of the
> others..
> If you put things in different databases, remember things can get out of
> sync, unless you shut everything down for backups... Also there can be no
> cross-database referential integrity...
> Try to put them together in the db, but separate if you must.
>
I agree. But I would go further and say that when you are designing a
system from the ground-up, you never "must". If you think you must seperate
related objects into different databases, think again. Schemas, FileGroups,
views, permissions, etc will usually let you keep the objects in one
database.
David|||If you place your master data in several databases, then you may end up with
lots of duplicate for indexes, views, triggers, procedures etc, it probably
does not worth unless your table will be really big.
"Mariame" <mariame_waguih@.hotmail.com> wrote in message
news:uPlhibieFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi Everyone
> I Have a Question Concerning DataBase Structure,
> If i have a database that contains All Master Tables [user acount,user
> detail &...] & i have to make another module for the same system that
> will use the same master tables
> Is it Preferred To Construct A New Database for this module & any any
> other new module or make it all in the same database because they all
> shared the same master Data'
> Any Help Will Be Appreciated
>

Database stress tester

Hello

Are there any database stress testing tools like database hammer bundled with any editions of 2005?

Or is there a resource kit somewhere that has one?

Thanks

this is the closest thing from MSFT http://msdn.microsoft.com/vstudio/teamsystem/products/dbpro/ .|||

third-party tool...

http://www.idera.com/Products/SQLscaler/?s=GW

|||

The original DBHammer tool works with SQL 2005, I've used it several times on it, have you tried it?

|||

Thanks for the replies

I had heard of the database hammer, but I have never used it. I will try it as, as soon as I can find a copy of it somewhere! Is it available to download?

Database Stored on NaS

Can anyone tell me if it is possible to save SQL 2000 Database files on a
NAS. I am running out of Disk Space on our SQL Server and thought a NAS
would be the easiest option for expanding the capacity.
Thanks
Possible? yes.
Advisable? definitely NOT.
Supported? No.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>
|||Yes, you can store database files on a NaS device, but this will often be a
substantial tradeoff in terms of performance (while you didn't really give
us any details about your specific NaS architecture, typically this is used
for low $-per-GB storage, and not for high performance).
http://www.aspfaq.com/
(Reverse address to reply.)
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:#AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>
|||check kb below
http://support.microsoft.com/default...b;en-us;304261
You might want to look at iSCSI as an alternative
http://support.microsoft.com/default...b;en-us;833770
Andy.
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>
|||You will pay a disk I/O performance hit not just because NAS is IP connected
but because Windows will not be able to issue Scatter Gather I/O requests
against it.
SQL Server uses these APIs to enhance its file maintenance and usage.
Sincerely,
Anthony Thomas

"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
Can anyone tell me if it is possible to save SQL 2000 Database files on a
NAS. I am running out of Disk Space on our SQL Server and thought a NAS
would be the easiest option for expanding the capacity.
Thanks
|||Thanks for everyone's input. The performance is not really an issue. We
have several customers that we support and for every customer we have a copy
of their SQL Data. We do periodically need to run some transactions through
the customers database but that doesn't really happen very often. All of
the data is currently sitting on our SQL box and I need to shift it
somewhere else. I thought the NAS would be the easiest option but I am now
just tempted to buy another SQL box just for the supported DB's.
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>

Database Stored on NaS

Can anyone tell me if it is possible to save SQL 2000 Database files on a
NAS. I am running out of Disk Space on our SQL Server and thought a NAS
would be the easiest option for expanding the capacity.
ThanksPossible? yes.
Advisable? definitely NOT.
Supported? No.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>|||Yes, you can store database files on a NaS device, but this will often be a
substantial tradeoff in terms of performance (while you didn't really give
us any details about your specific NaS architecture, typically this is used
for low $-per-GB storage, and not for high performance).
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:#AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>|||check kb below
http://support.microsoft.com/default.aspx?scid=kb;en-us;304261
You might want to look at iSCSI as an alternative
http://support.microsoft.com/default.aspx?scid=kb;en-us;833770
Andy.
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>|||You will pay a disk I/O performance hit not just because NAS is IP connected
but because Windows will not be able to issue Scatter Gather I/O requests
against it.
SQL Server uses these APIs to enhance its file maintenance and usage.
Sincerely,
Anthony Thomas
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
Can anyone tell me if it is possible to save SQL 2000 Database files on a
NAS. I am running out of Disk Space on our SQL Server and thought a NAS
would be the easiest option for expanding the capacity.
Thanks|||Thanks for everyone's input. The performance is not really an issue. We
have several customers that we support and for every customer we have a copy
of their SQL Data. We do periodically need to run some transactions through
the customers database but that doesn't really happen very often. All of
the data is currently sitting on our SQL box and I need to shift it
somewhere else. I thought the NAS would be the easiest option but I am now
just tempted to buy another SQL box just for the supported DB's.
"Sarah Kingswell" <skingswell@.xonitek.co.uk> wrote in message
news:%23AOymtT4EHA.824@.TK2MSFTNGP11.phx.gbl...
> Can anyone tell me if it is possible to save SQL 2000 Database files on a
> NAS. I am running out of Disk Space on our SQL Server and thought a NAS
> would be the easiest option for expanding the capacity.
> Thanks
>

Database stored in .ldf file

Problem:
Contractor migrated Great Plains databases to new server (Win2000, SQL2000).
Databases are set up in reverse. Data is stored in .ldf, and log files are
stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (Kno
w
how to do this)
Can I shrink the logs even though they're in .mdf named files?
Is it ok to leave them alone in the reversed naming convention state?
Can I detach the databases, create a new .mdf, restore the database(.ldf)
from backup to the new .mdf file? If so, do I need to restore the log file
also, or can I start a new one from scratch?
Thanks for the help.Name is totally irrelevant to SQL Server, as well as extension. If you feel
it is OK, you can keep
the names. One option is to backup, detach (for safety - keep the files some
where else), and with
restore use the MOVE option to specify new file names. Or possibly only deta
ch, rename files and
attach specifying new correct file names (do this from QA not EM - QA gives
you full control over
the parameters used to sp_attach_db procedure).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rick A" <Rick A@.discussions.microsoft.com> wrote in message
news:326AE016-3AAE-47B0-B216-E8EA16549B6A@.microsoft.com...
> Problem:
> Contractor migrated Great Plains databases to new server (Win2000, SQL2000
).
> Databases are set up in reverse. Data is stored in .ldf, and log files ar
e
> stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (K
now
> how to do this)
> Can I shrink the logs even though they're in .mdf named files?
> Is it ok to leave them alone in the reversed naming convention state?
> Can I detach the databases, create a new .mdf, restore the database(.ldf)
> from backup to the new .mdf file? If so, do I need to restore the log fil
e
> also, or can I start a new one from scratch?
> Thanks for the help.
>
>
>
>sql

Database stored in .ldf file

Problem:
Contractor migrated Great Plains databases to new server (Win2000, SQL2000).
Databases are set up in reverse. Data is stored in .ldf, and log files are
stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (Know
how to do this)
Can I shrink the logs even though they're in .mdf named files?
Is it ok to leave them alone in the reversed naming convention state?
Can I detach the databases, create a new .mdf, restore the database(.ldf)
from backup to the new .mdf file? If so, do I need to restore the log file
also, or can I start a new one from scratch?
Thanks for the help.
Name is totally irrelevant to SQL Server, as well as extension. If you feel it is OK, you can keep
the names. One option is to backup, detach (for safety - keep the files somewhere else), and with
restore use the MOVE option to specify new file names. Or possibly only detach, rename files and
attach specifying new correct file names (do this from QA not EM - QA gives you full control over
the parameters used to sp_attach_db procedure).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rick A" <Rick A@.discussions.microsoft.com> wrote in message
news:326AE016-3AAE-47B0-B216-E8EA16549B6A@.microsoft.com...
> Problem:
> Contractor migrated Great Plains databases to new server (Win2000, SQL2000).
> Databases are set up in reverse. Data is stored in .ldf, and log files are
> stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (Know
> how to do this)
> Can I shrink the logs even though they're in .mdf named files?
> Is it ok to leave them alone in the reversed naming convention state?
> Can I detach the databases, create a new .mdf, restore the database(.ldf)
> from backup to the new .mdf file? If so, do I need to restore the log file
> also, or can I start a new one from scratch?
> Thanks for the help.
>
>
>
>

Database stored in .ldf file

Problem:
Contractor migrated Great Plains databases to new server (Win2000, SQL2000).
Databases are set up in reverse. Data is stored in .ldf, and log files are
stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (Know
how to do this)
Can I shrink the logs even though they're in .mdf named files?
Is it ok to leave them alone in the reversed naming convention state?
Can I detach the databases, create a new .mdf, restore the database(.ldf)
from backup to the new .mdf file? If so, do I need to restore the log file
also, or can I start a new one from scratch?
Thanks for the help.Name is totally irrelevant to SQL Server, as well as extension. If you feel it is OK, you can keep
the names. One option is to backup, detach (for safety - keep the files somewhere else), and with
restore use the MOVE option to specify new file names. Or possibly only detach, rename files and
attach specifying new correct file names (do this from QA not EM - QA gives you full control over
the parameters used to sp_attach_db procedure).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rick A" <Rick A@.discussions.microsoft.com> wrote in message
news:326AE016-3AAE-47B0-B216-E8EA16549B6A@.microsoft.com...
> Problem:
> Contractor migrated Great Plains databases to new server (Win2000, SQL2000).
> Databases are set up in reverse. Data is stored in .ldf, and log files are
> stored in .mdf. Log file(.mdf) out of control and needs to be shrunk. (Know
> how to do this)
> Can I shrink the logs even though they're in .mdf named files?
> Is it ok to leave them alone in the reversed naming convention state?
> Can I detach the databases, create a new .mdf, restore the database(.ldf)
> from backup to the new .mdf file? If so, do I need to restore the log file
> also, or can I start a new one from scratch?
> Thanks for the help.
>
>
>
>

Database storage limitations in sql server

Whats the limitations of data storage in sqlserver DB. How will be the perforamcne if i have database which will get a data of 400 GB per year and all the data should be there in the table the whole year and then it can be archived.according to ms you can continue to scale out and up if you use multiple servers clustered together with distributed partitioned views. more hardware. more sql liscenses. no problem. right.|||And the alternative is...? 32-way 32-bit cluster with a terabyte or 2 of RAM and the SAN of SAM. You gotta go up or out. I prefer out or both. I don't expect my software for free.

Read up on Google's technology. They can go out on 386 machines - discards. And as soon as people start discarding 1GHz machines, they'll switch to a real operating system.

database still exists after deletion

hi

Basically, I create a database with sql, then I delete it manually(not via sql statment. This is a problem which I realise. In fact, you can't delete the database because the VS 2005 still is using it) I run the same code again,
then it says the database still exists, even it is physically destroied.

--Here is the errors:
System.Data.SqlClient.SqlException: Database 'riskDatabase' already exists.
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolea
n breakConnection)

--The evidence that the database doesn't exist physically:
Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open database "riskDatabase" requested by the login. The login failed.

--The code:
/*
* C# code to programmically create
* database and table. It also inserts
* data into the table.
*/

using System;
using System.Collections.Generic;
using System.Text;

using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace riskWizard
{
public class RiskWizard
{
// Sql
private string connectionString;
private SqlConnection connection;
private SqlCommand command;

// Database
private string databaseName;
private string currDatabasePath;
private string database_mdf;
private string database_ldf;

public RiskWizard(string databaseName, string currDatabasePath, string database_mdf, string database_ldf)
{
this.databaseName = databaseName;
this.currDatabasePath = currDatabasePath;
this.database_mdf = database_mdf;
this.database_ldf = database_ldf;
}

private void executeSql(string sql)
{
// Create a connection
connection = new SqlConnection(connectionString);

// Open the connection.
if (connection.State == ConnectionState.Open)
connection.Close();

connection.ConnectionString = connectionString;
connection.Open();

command = new SqlCommand(sql, connection);
try
{
command.ExecuteNonQuery();
}
catch (SqlException e)
{
Console.WriteLine(e.ToString());
}
}

public void createDatabase()
{
string database_data = databaseName + "_data";
string database_log = databaseName + "_log";

connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=;Integrated Security=SSPI;";

string sql = "CREATE DATABASE " + databaseName + " ON PRIMARY"
+ "(name=" + database_data + ",filename=" + database_mdf + ",size=3,"
+ "maxsize=5,filegrowth=10%)log on"
+ "(name=" + database_log + ",filename=" + database_ldf + ",size=3,"
+ "maxsize=20,filegrowth=1)";

executeSql(sql);
}

public void dropDatabase()
{
connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

string sql = "DROP DATABASE " + databaseName;

executeSql(sql);
}

// Create table.
public void createTable(string tableName)
{
connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

string sql = "CREATE TABLE " + tableName +
"(userId INTEGER IDENTITY(1, 1) CONSTRAINT PK_userID PRIMARY KEY," +
"name CHAR(50) NOT NULL, address CHAR(255) NOT NULL, employmentTitle TEXT NOT NULL)";

executeSql(sql);
}

// Insert data
public void insertData(string tableName)
{
string sql;

connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1001, 'Puneet Nehra', 'A 449 Sect 19, DELHI', 'project manager') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1002, 'Anoop Singh', 'Lodi Road, DELHI', 'software admin') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1003, 'Rakesh M', 'Nag Chowk, Jabalpur M.P.', 'tester') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1004, 'Madan Kesh', '4th Street, Lane 3, DELHI', 'quality insurance mamager') ";
executeSql(sql);
}

public static void Main(String[] argv)
{
string databaseName = "riskDatabase";
string currDatabasePath = "E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\A pp_Data";
// Need to be more flexible.
string database_mdf = "'E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\ App_Data\\riskDatabase.mdf'";
string database_ldf = "'E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\ App_Data\\riskDatabase.ldf'";

RiskWizard riskWizard = new RiskWizard(databaseName, currDatabasePath, database_mdf, database_ldf);
riskWizard.createDatabase();
riskWizard.createTable("userTable");
riskWizard.insertData("userTable");
//riskWizard.dropDatabase();
}
}
}Have someone tried to create a database then drop it in runtime?

Database status: Loading

After restoring my old transaction logs, the database
showing a status: 'Loading'. The database status still
remain 'Loading' even after 3 days.
Is there anyway I can stop the loading and will it cause
any problem to my data?Perhaps the last log was restored with NORECOVERY. In this case, you
can recover the database with the command below. This will not
introduce any data problems.
RESTORE DATABASE MyDatabase
WITH RECOVERY
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"TEO" <teo.yongjiew@.eonbank.com.my> wrote in message
news:067501c3a80b$73cf54e0$a401280a@.phx.gbl...
> After restoring my old transaction logs, the database
> showing a status: 'Loading'. The database status still
> remain 'Loading' even after 3 days.
> Is there anyway I can stop the loading and will it cause
> any problem to my data?sql

Database status check

Hey guys,

A question about database status !

I would like to do 2 checks through T-sql :

* Check if a database exists in my Sql Server

- I found following T-Sql code and it does the trick, so no problem here I guess :

Code Snippet

select * from sys.databases where name = 'Testing'

* Check if the database is Online or Offline

Here I'm having trouble selecting a good approach.

At first I would just launch a query to one of my tables, but it got me thinking, this would create a timeout if the database is offline, not ?

So how could I avoid this timeout ? I found out that the SysDatabases table has a status field I can query, but I can't find any document reference for the difference in Status Online or Offline ( I see a change when I do the test local, but I can't get a int reference to really check the value ).

NOTE : I'm on sql 2000 !

So any suggestions ?

Hey Depechie,

check out this tip: http://www.mssqltips.com/tip.asp?tip1033

success,

hansco

Database Status = Loading

A coworker is repeatedly experiencing problems restoring database backups on
a new sql virtual server (clustered). He has restored a database backup
using enterprise manager. Enterprise manager told him that the restore has
completed without giving any errors. We can not access the database and
enterprise manager shows the status of the database as "Loading". I ran the
command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
basically saying that the database was not completely loaded or the restore
did not complete. Can anyone tell me what the problem is or tell me how to
avoid this scenario?
-SJHi
Have you checked the SQL Server log and the System Event log to see if there
is any additional information in them?
It is usually a good idea to post the exact error numbers and messages.
John
"SJ" wrote:

> A coworker is repeatedly experiencing problems restoring database backups
on
> a new sql virtual server (clustered). He has restored a database backup
> using enterprise manager. Enterprise manager told him that the restore ha
s
> completed without giving any errors. We can not access the database and
> enterprise manager shows the status of the database as "Loading". I ran t
he
> command RESTORE DATABASE <databasename> WITH RECOVERY and received an erro
r
> basically saying that the database was not completely loaded or the restor
e
> did not complete. Can anyone tell me what the problem is or tell me how t
o
> avoid this scenario?
> --
> -SJ|||Here is the error:
File '<logical file name>' 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.
Enterprise manager told me "Restore of database '<databasename>' completed
successfully."
-SJ
"John Bell" wrote:
[vbcol=seagreen]
> Hi
> Have you checked the SQL Server log and the System Event log to see if the
re
> is any additional information in them?
> It is usually a good idea to post the exact error numbers and messages.
> John
> "SJ" wrote:
>|||Hi SJ
Check out:
http://groups.google.com/group/micr...27357de5278e8bd
John
"SJ" wrote:
[vbcol=seagreen]
> Here is the error:
> File '<logical file name>' was only partially restored by a database or fi
le
> 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.
> Enterprise manager told me "Restore of database '<databasename>' completed
> successfully."
> -SJ
> "John Bell" wrote:
>

Database Status = Loading

A coworker is repeatedly experiencing problems restoring database backups on
a new sql virtual server (clustered). He has restored a database backup
using enterprise manager. Enterprise manager told him that the restore has
completed without giving any errors. We can not access the database and
enterprise manager shows the status of the database as "Loading". I ran the
command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
basically saying that the database was not completely loaded or the restore
did not complete. Can anyone tell me what the problem is or tell me how to
avoid this scenario?
-SJ
Hi
Have you checked the SQL Server log and the System Event log to see if there
is any additional information in them?
It is usually a good idea to post the exact error numbers and messages.
John
"SJ" wrote:

> A coworker is repeatedly experiencing problems restoring database backups on
> a new sql virtual server (clustered). He has restored a database backup
> using enterprise manager. Enterprise manager told him that the restore has
> completed without giving any errors. We can not access the database and
> enterprise manager shows the status of the database as "Loading". I ran the
> command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
> basically saying that the database was not completely loaded or the restore
> did not complete. Can anyone tell me what the problem is or tell me how to
> avoid this scenario?
> --
> -SJ
|||Here is the error:
File '<logical file name>' 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.
Enterprise manager told me "Restore of database '<databasename>' completed
successfully."
-SJ
"John Bell" wrote:
[vbcol=seagreen]
> Hi
> Have you checked the SQL Server log and the System Event log to see if there
> is any additional information in them?
> It is usually a good idea to post the exact error numbers and messages.
> John
> "SJ" wrote:
|||Hi SJ
Check out:
http://groups.google.com/group/micro...7357de5278e8bd
John
"SJ" wrote:
[vbcol=seagreen]
> Here is the error:
> File '<logical file name>' 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.
> Enterprise manager told me "Restore of database '<databasename>' completed
> successfully."
> -SJ
> "John Bell" wrote:

Database Status = Loading

A coworker is repeatedly experiencing problems restoring database backups on
a new sql virtual server (clustered). He has restored a database backup
using enterprise manager. Enterprise manager told him that the restore has
completed without giving any errors. We can not access the database and
enterprise manager shows the status of the database as "Loading". I ran the
command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
basically saying that the database was not completely loaded or the restore
did not complete. Can anyone tell me what the problem is or tell me how to
avoid this scenario?
--
-SJHi
Have you checked the SQL Server log and the System Event log to see if there
is any additional information in them?
It is usually a good idea to post the exact error numbers and messages.
John
"SJ" wrote:
> A coworker is repeatedly experiencing problems restoring database backups on
> a new sql virtual server (clustered). He has restored a database backup
> using enterprise manager. Enterprise manager told him that the restore has
> completed without giving any errors. We can not access the database and
> enterprise manager shows the status of the database as "Loading". I ran the
> command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
> basically saying that the database was not completely loaded or the restore
> did not complete. Can anyone tell me what the problem is or tell me how to
> avoid this scenario?
> --
> -SJ|||Here is the error:
File '<logical file name>' 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.
Enterprise manager told me "Restore of database '<databasename>' completed
successfully."
-SJ
"John Bell" wrote:
> Hi
> Have you checked the SQL Server log and the System Event log to see if there
> is any additional information in them?
> It is usually a good idea to post the exact error numbers and messages.
> John
> "SJ" wrote:
> > A coworker is repeatedly experiencing problems restoring database backups on
> > a new sql virtual server (clustered). He has restored a database backup
> > using enterprise manager. Enterprise manager told him that the restore has
> > completed without giving any errors. We can not access the database and
> > enterprise manager shows the status of the database as "Loading". I ran the
> > command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
> > basically saying that the database was not completely loaded or the restore
> > did not complete. Can anyone tell me what the problem is or tell me how to
> > avoid this scenario?
> >
> > --
> > -SJ|||Hi SJ
Check out:
http://groups.google.com/group/microsoft.public.sqlserver.clients/browse_frm/thread/b5447588fe32acf0/527357de5278e8bd#527357de5278e8bd
John
"SJ" wrote:
> Here is the error:
> File '<logical file name>' 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.
> Enterprise manager told me "Restore of database '<databasename>' completed
> successfully."
> -SJ
> "John Bell" wrote:
> > Hi
> >
> > Have you checked the SQL Server log and the System Event log to see if there
> > is any additional information in them?
> >
> > It is usually a good idea to post the exact error numbers and messages.
> >
> > John
> >
> > "SJ" wrote:
> >
> > > A coworker is repeatedly experiencing problems restoring database backups on
> > > a new sql virtual server (clustered). He has restored a database backup
> > > using enterprise manager. Enterprise manager told him that the restore has
> > > completed without giving any errors. We can not access the database and
> > > enterprise manager shows the status of the database as "Loading". I ran the
> > > command RESTORE DATABASE <databasename> WITH RECOVERY and received an error
> > > basically saying that the database was not completely loaded or the restore
> > > did not complete. Can anyone tell me what the problem is or tell me how to
> > > avoid this scenario?
> > >
> > > --
> > > -SJ

Database statistics

I need to know the statistics of use of the databases in my sql server 2k to
make a report... How ca I do that?
When you say use I assume you mean items like:
How many users have logged on per day.
How many commands have been processed per database.
Average duration of a command
etc...
Well I hate to say it but sql server does not provide you this
automatically. Although you can do server side tracing to save trace
information to a sql server table. Then using the information saved from
your trace you can then produce some of these statistics. Here is an
article I wrote that might help:
http://www.dbazine.com/larsen7.shtml
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Ricardo" <nomail@.terra.com.br> wrote in message
news:OSezecwhEHA.3264@.tk2msftngp13.phx.gbl...
> I need to know the statistics of use of the databases in my sql server 2k
to
> make a report... How ca I do that?
>
sql

Database statistics

I need to know the statistics of use of the databases in my sql server 2k to
make a report... How ca I do that?When you say use I assume you mean items like:
How many users have logged on per day.
How many commands have been processed per database.
Average duration of a command
etc...
Well I hate to say it but sql server does not provide you this
automatically. Although you can do server side tracing to save trace
information to a sql server table. Then using the information saved from
your trace you can then produce some of these statistics. Here is an
article I wrote that might help:
http://www.dbazine.com/larsen7.shtml
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Ricardo" <nomail@.terra.com.br> wrote in message
news:OSezecwhEHA.3264@.tk2msftngp13.phx.gbl...
> I need to know the statistics of use of the databases in my sql server 2k
to
> make a report... How ca I do that?
>

Database Statistics

I am trying to find an efficient way to get the number of times that each ro
w
in a table is selected. I want to avoid using triggers.
Any ideas?
Thanks
John
jpd0861@.msn.comIf you're using stored procedures to access data, then I'd simply suggest
extending those to implement table-use auditing. Of course you'd need to kee
p
statistics in a separate table - something like:
PK_column : AccesedTime (default getdate()) : AccessedBy (default system_use
r)
If your db design allows direct access to tables, then maybe your auditing
requirement is just another point in favour of using procedures.
ML|||From the good news/bad news category:
Good news. We don't have SELECT triggers, so you wont have any problem
Bad news, there really isn't any other way to do this unless you are using
stored procedures, and even then it would be a big drag on performance.
Or I am missing something?
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"John" <John@.discussions.microsoft.com> wrote in message
news:77D095BA-04A6-4EB7-83EB-57B28AA21C51@.microsoft.com...
>I am trying to find an efficient way to get the number of times that each
>row
> in a table is selected. I want to avoid using triggers.
> Any ideas?
> Thanks
> John
> jpd0861@.msn.com|||Thank you Louis, I was not clear in my original message. I know that there
are no SELECT triggers in SQL Server...just good old INSERT, UPDATE, and
DELETE.
FYI, I did get an answer about using table-use auditing from ML that seems
to make sense.
"Louis Davidson" wrote:

> From the good news/bad news category:
> Good news. We don't have SELECT triggers, so you wont have any problem
> Bad news, there really isn't any other way to do this unless you are using
> stored procedures, and even then it would be a big drag on performance.
> Or I am missing something?
> --
> ----
--
> Louis Davidson - http://spaces.msn.com/members/drsql/
> SQL Server MVP
>
> "John" <John@.discussions.microsoft.com> wrote in message
> news:77D095BA-04A6-4EB7-83EB-57B28AA21C51@.microsoft.com...
>
>|||I agree, I just wanted to be clear that without procs this would not be
possible. I rarely expect that people are actually using stored procedures,
but clearly this is yet another reason why they are so excellent.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"John" <John@.discussions.microsoft.com> wrote in message
news:6D10890D-C733-4673-852F-81C747F2EF10@.microsoft.com...
> Thank you Louis, I was not clear in my original message. I know that there
> are no SELECT triggers in SQL Server...just good old INSERT, UPDATE, and
> DELETE.
> FYI, I did get an answer about using table-use auditing from ML that seems
> to make sense.
> "Louis Davidson" wrote:
>

Database statistics

I need to know the statistics of use of the databases in my sql server 2k to
make a report... How ca I do that?When you say use I assume you mean items like:
How many users have logged on per day.
How many commands have been processed per database.
Average duration of a command
etc...
Well I hate to say it but sql server does not provide you this
automatically. Although you can do server side tracing to save trace
information to a sql server table. Then using the information saved from
your trace you can then produce some of these statistics. Here is an
article I wrote that might help:
http://www.dbazine.com/larsen7.shtml
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Ricardo" <nomail@.terra.com.br> wrote in message
news:OSezecwhEHA.3264@.tk2msftngp13.phx.gbl...
> I need to know the statistics of use of the databases in my sql server 2k
to
> make a report... How ca I do that?
>

Database state loading after restore.

Hi,
I have sql server 2000 running on windows 2003 clusters. While i
tried to restore the database i got the message that The restore
operation was successful. But still the database is showing state
"Loading."
I restored the database with recovery (Leave database opeational in
EM). I kept the database for a day and it shows still status as
"Loading".
Any help for this is highly appreciated.
Regards,
Jay
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Are you sure it is not only a refers issue in EM? Did you try below:
RESTORE DATABASE dbname WITH RECOVERY
And if you try above, what messages do you get?
Also, if you open QA and say "USE dbname", any errors?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jigar Patel" <jigar_pcs@.rediffmail.com> wrote in message
news:uCLjUt4rDHA.2828@.tk2msftngp13.phx.gbl...
> Hi,
> I have sql server 2000 running on windows 2003 clusters. While i
> tried to restore the database i got the message that The restore
> operation was successful. But still the database is showing state
> "Loading."
> I restored the database with recovery (Leave database opeational in
> EM). I kept the database for a day and it shows still status as
> "Loading".
> Any help for this is highly appreciated.
> Regards,
> Jay
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||I am sure as i have done this operation for atleast 15 times as of now.
I tried everything.
When i try to use
Use Database
Go
The message comes saying the database is still loading is not available.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||So what errors/messages do you get from the below command?
RESTORE DATABASE dbname WITH RECOVERY
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jigar Patel" <jigar_pcs@.rediffmail.com> wrote in message
news:uovOaN7rDHA.2360@.TK2MSFTNGP09.phx.gbl...
> I am sure as i have done this operation for atleast 15 times as of now.
> I tried everything.
> When i try to use
> Use Database
> Go
> The message comes saying the database is still loading is not available.
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Database startup time

Is it possible to find somewhere in the system table time of sql server startup?

Thanks

Hi, as the tempdb is created at very startup of the SQL Server service you can check the information on

sp_helpdb tempdb

HTH, Jens Suessmeyer,

http://www.sqlserver2005.de

sql

Database startup

in sql server (re)start where does it find the location of Master.mdf file .

In Oracle, there is control file where the location of *.dbf file is stored and Instance find the location of dbf file from that location

In sql server where it finds the location of Databases as master, msdb etc..

The location is set duing Server installation.

That information is stored in the registry. It can also be supplied as a command line start up parameter [ -dMasterFilePath ].

The registry location 'should' be:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\Parameters

Database Starting Up

I have a database which constantly saying it i starting up!!!!
2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
Can anyone tell me why?Hello,
Looks like you have enabled AUTOCLOSE database option turned. This will
close the database files once the last user diconnects
from the QA_test database and will put an entry back while the fast user
connect to this database. I recomment you to
disable this option being this will take some resources.
Thanks
Hari
"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>|||"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>
Yes, it is set as autoclose. Disable that.
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||Is it set to auto close? Check this and turn it off if it is on...
MC
"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>|||This is because "AutoClose" is set on your database.
This makes the database engine close the database when the last user drops
the connection to the database. This is done to free up resources. This
setting is on by default on MSDE/SQL Server Express, off by default on all
other SQL Server versions.
See also this link for some thoughts on this setting:
http://www.sqlservercentral.com/col...ordatabases.asp
Stein Tore
"Adam Sankey" wrote:

> I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>

Database Starting Up

I have a database which constantly saying it i starting up!!!!
2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
Can anyone tell me why?
Hello,
Looks like you have enabled AUTOCLOSE database option turned. This will
close the database files once the last user diconnects
from the QA_test database and will put an entry back while the fast user
connect to this database. I recomment you to
disable this option being this will take some resources.
Thanks
Hari
"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>
|||"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>
Yes, it is set as autoclose. Disable that.
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com
|||This is because "AutoClose" is set on your database.
This makes the database engine close the database when the last user drops
the connection to the database. This is done to free up resources. This
setting is on by default on MSDE/SQL Server Express, off by default on all
other SQL Server versions.
See also this link for some thoughts on this setting:
http://www.sqlservercentral.com/columnists/sjones/autoclosefordatabases.asp
Stein Tore
"Adam Sankey" wrote:

> I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>

Database Starting Up

I have a database which constantly saying it i starting up!!!!
2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
Can anyone tell me why?Hello,
Looks like you have enabled AUTOCLOSE database option turned. This will
close the database files once the last user diconnects
from the QA_test database and will put an entry back while the fast user
connect to this database. I recomment you to
disable this option being this will take some resources.
Thanks
Hari
"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>|||"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>
Yes, it is set as autoclose. Disable that.
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com|||Is it set to auto close? Check this and turn it off if it is on...
MC
"Adam Sankey" <AdamSankey@.discussions.microsoft.com> wrote in message
news:3679887C-EFD3-4B25-B2B0-AD8C39E0A325@.microsoft.com...
>I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>|||This is because "AutoClose" is set on your database.
This makes the database engine close the database when the last user drops
the connection to the database. This is done to free up resources. This
setting is on by default on MSDE/SQL Server Express, off by default on all
other SQL Server versions.
See also this link for some thoughts on this setting:
http://www.sqlservercentral.com/columnists/sjones/autoclosefordatabases.asp
Stein Tore
"Adam Sankey" wrote:
> I have a database which constantly saying it i starting up!!!!
> 2007-02-28 12:32:22.96 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:22.98 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:32:23.01 spid63 Starting up database 'QA_Test'.
> 2007-02-28 12:35:41.09 spid63 Starting up database 'QA_Test'.
> Can anyone tell me why?
>

Database starting

What does it mean when your log says over and over and
over again (even up to an hour ago) that your database is
starting up and yet the database looks fine. You can
open it in Enterprise Manager, etc.
turn off "autoclose" at the database level.
"NewPoster" <anonymous@.discussions.microsoft.com> wrote in message
news:281401c4de06$ee625bd0$a301280a@.phx.gbl...
> What does it mean when your log says over and over and
> over again (even up to an hour ago) that your database is
> starting up and yet the database looks fine. You can
> open it in Enterprise Manager, etc.
|||It sounds like your database has autoclose set to on. In Enterprise manager
right click on your database and select properties. From properties choose
the options tab. Uncheck auto close. Click OK at the bottom of the window and
you should be OK.
"NewPoster" wrote:

> What does it mean when your log says over and over and
> over again (even up to an hour ago) that your database is
> starting up and yet the database looks fine. You can
> open it in Enterprise Manager, etc.
>
sql

Database starting

What does it mean when your log says over and over and
over again (even up to an hour ago) that your database is
starting up and yet the database looks fine. You can
open it in Enterprise Manager, etc.turn off "autoclose" at the database level.
"NewPoster" <anonymous@.discussions.microsoft.com> wrote in message
news:281401c4de06$ee625bd0$a301280a@.phx.gbl...
> What does it mean when your log says over and over and
> over again (even up to an hour ago) that your database is
> starting up and yet the database looks fine. You can
> open it in Enterprise Manager, etc.|||It sounds like your database has autoclose set to on. In Enterprise manager
right click on your database and select properties. From properties choose
the options tab. Uncheck auto close. Click OK at the bottom of the window and
you should be OK.
"NewPoster" wrote:
> What does it mean when your log says over and over and
> over again (even up to an hour ago) that your database is
> starting up and yet the database looks fine. You can
> open it in Enterprise Manager, etc.
>

Database start trigger 2005

Hi,

I have searched high and low, and can not find any mention of SQL2005 and mount/start database DDL triggers.

I need a trigger/job/event to update a column in a table to indicate that the database has been restarted. I can not have an application connect to the database and set this value as I am afraid one of my other computers may connect first and get the wrong state from the database.

Is there any way to have SQL2005 update a table on MOUNT/Service Start/DB start?

Regards,
Derek

I solved it on my own. I use a StoredProcedure in the MASTER database and set it to start automatically.

~Derek

Database Standards HELP!

I would like to create a new database and follow some standard. I am hoping that there is some ANSI documentation or Microsoft documentation on a NAMING standard when creating objects in the database.
i.e Table name "tblEmployees"
Column name "txtLastName"

Is there any GOOD documentation on creating a database using a PROVEN, and ACCEPTED standard?

Hi HotChick -

I always rebel and do whatever I want.......but, here is a pretty decent link:http://vyaskn.tripod.com/object_naming.htm

|||The accepted standard is ISO 11179. http://metadata-standards.org/Document-library/Draft-standards/11179-Part5-Naming&Identification/

Database sql server2000 very slow

I have a database that had worked under msde 1.0 until reached the 2GB
of dimension and the dB was blocked. To make possible the work i had
deleted old data from some table. The database restart, but the
answers from server become very slow. So i decided to pass to Sql
Server 2000 without success. May i perform a check of this database?
if is a indexs problem there is a way to rebuild them?
Thanks in advance
Andy Wet"Andy Wet" <andy_wet@.yahoo.it> wrote in message
news:cbd71cd0.0311040107.31de9ec5@.posting.google.c om...
> I have a database that had worked under msde 1.0 until reached the 2GB
> of dimension and the dB was blocked. To make possible the work i had
> deleted old data from some table. The database restart, but the
> answers from server become very slow. So i decided to pass to Sql
> Server 2000 without success. May i perform a check of this database?
> if is a indexs problem there is a way to rebuild them?
> Thanks in advance
> Andy Wet

Can you explain what you mean by 'passing to SQL Server 2000'? Did you try
to upgrade MSDE to Standard Edition, did you backup/restore your MSDE
database on another version, etc.?

It might be worth using sp_updatestats to update the statstics in the
database, and also DBCC CHECKDB, if you think the database may be corrupted.

Simon

database speed in SQL server

Hi there,
My program in Delphi have 7 table with about 120,000 records and 200 fields.
I use SQL server for my database.
When my program launchs its speed is too low.
What shall I do to increase its speed?
Regards,
Doroodgarit probably has nothing to do with the number of tables and records in the
database. you can try several things:
* delay creating unnecessary objects and forms, and create them as needed
* delay connecting to the database, and again connect only when needed
* move time-consuming processing to background thread, if possible
* show splash screen, it will make the appearance better :)
in general, minimize the amount of work you perform on load.
btw, those '200 fields' seem pretty much..
dean
"doroodgar" <rdoroodgar@.noornet.net> wrote in message
news:uTKCZCpDFHA.148@.TK2MSFTNGP14.phx.gbl...
> Hi there,
> My program in Delphi have 7 table with about 120,000 records and 200
fields.
> I use SQL server for my database.
> When my program launchs its speed is too low.
> What shall I do to increase its speed?
> Regards,
> Doroodgar
>|||HI doroodgar,
You sound convinced SQL slow your application purely on the fact the you
return tons of records so I'll work with that.
Why do you need that size recordset on application launch ? This confuse me
a bit cause you load the records based on what ?
What does your application do ? Is there some sort of logic to the records
that you return, is it possible that you can narrow it down , you present
120k records on one page anyways... should you maybe try and load 100 at a
time ?
How do you application present the 200 fields ?
Is it a straight select statement that populate your recordset or do you use
joins ?
What's the timing compared to when you run it through QA ?
Hope this will help
Can you give more info regarding your query and application ?
"doroodgar" wrote:

> Hi there,
> My program in Delphi have 7 table with about 120,000 records and 200 field
s.
> I use SQL server for my database.
> When my program launchs its speed is too low.
> What shall I do to increase its speed?
> Regards,
> Doroodgar
>
>|||http://www.sql-server-performance.com
Regards
Mike
"Mal" wrote:
> HI doroodgar,
> You sound convinced SQL slow your application purely on the fact the you
> return tons of records so I'll work with that.
> Why do you need that size recordset on application launch ? This confuse m
e
> a bit cause you load the records based on what ?
> What does your application do ? Is there some sort of logic to the records
> that you return, is it possible that you can narrow it down , you present
> 120k records on one page anyways... should you maybe try and load 100 at a
> time ?
> How do you application present the 200 fields ?
> Is it a straight select statement that populate your recordset or do you u
se
> joins ?
> What's the timing compared to when you run it through QA ?
> Hope this will help
> Can you give more info regarding your query and application ?
> "doroodgar" wrote:
>sql

database speed

I have two database (structurly idenical) on the same SQL server, first
working good, but second is very slow
(noticed from web aplication)
I would like the same speed for both database
is there any database parameters need to be set to make same speed
Thanks for your answerHi
What is about amount of data contain on both database? Is it the same?
Did you identify what queries are caused to the problem? If you did, have
you tried to improve them?
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
It is not so hard to make two databases equally slow just put "delay for" in
key places...|||Bojidar
What did you mean "put "delay for" in> key places..."?
"Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>
> It is not so hard to make two databases equally slow just put "delay for"
in
> key places...
>|||We can say amount of data is the same (very small variation), and number of
users are almost the same,
I didn't mention, there is also two web aplication (ASP, medical aplication)
that are using mentioned database,
aplication are located on the same IIS server, and everting is working on
LAN (one hospital)
maybe I must set some parametrs in IIS '
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eCOUd23UEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Hi
> What is about amount of data contain on both database? Is it the same?
> Did you identify what queries are caused to the problem? If you did, have
> you tried to improve them?
>
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>|||kidding
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u2AsB%233UEHA.2408@.tk2msftngp13.phx.gbl...
> Bojidar
> What did you mean "put "delay for" in> key places..."?
> "Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
> news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
first[vbcol=seagreen]
for"[vbcol=seagreen]
> in
>|||You should consider the physical file system... Are the databases loaded to
the same or equivalent disks using the same filegroups/files?
Have both of the databases been maintained ( indexdefrag and update
statistics.)
As one other poster mentioned... If you feel like the problem is in the
database, isolate one query which works more slowly in one db than the
other, and look at the query plan... If you can not isolate this to a
single query ( or a group of queries) it might not be a database problem.
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
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||DS1979,
You might want to compare that the databases are indeed identical using
a third party tool such as http://www.red-gate.com/SQL_Compare.htm or
look at http://www.aspfaq.com/show.asp?id=2209 for more options.
This will highlight any differences. Once you have confirmed they are
the same, update statistics and defrag indexes. Also check that the
databases are residing on the same disk subsystem by running sp_helpfile
in each db.
Use Profiler to check the worst performing queries, then look at the
execution plans of those queries - there could be indexing differences
between the databases.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
DS1979 wrote:
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||Thanks, I think maybe I found problem
See this
I found someting new in this story,
I found that administrator did this
1) copy xxx.mdf and xxx_log.ldf from (copy from file system) server A to
server B
2) Make new database on server B
3) Change path in server B database >>> properties >>> Data file and
Transaction Log to server B\xxx.mdf and server B\xxx_log.ldf
4) Put database server B\ working
no_sp_detach, no sp_attach ?
What do you think is this main reason for slow working (faster database
didn't moved from orginal location and it's working good)
What is the best solution to repair this situation now ?
Thanks, again
"Wayne Snyder" <wayne.snyder@.mariner-usa.com> wrote in message
news:%23PMikB5UEHA.3428@.TK2MSFTNGP12.phx.gbl...
> You should consider the physical file system... Are the databases loaded
to
> the same or equivalent disks using the same filegroups/files?
> Have both of the databases been maintained ( indexdefrag and update
> statistics.)
> As one other poster mentioned... If you feel like the problem is in the
> database, isolate one query which works more slowly in one db than the
> other, and look at the query plan... If you can not isolate this to a
> single query ( or a group of queries) it might not be a database problem.
> --
> 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
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>

database speed

I have two database (structurly idenical) on the same SQL server, first
working good, but second is very slow
(noticed from web aplication)
I would like the same speed for both database
is there any database parameters need to be set to make same speed
Thanks for your answer
Hi
What is about amount of data contain on both database? Is it the same?
Did you identify what queries are caused to the problem? If you did, have
you tried to improve them?
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>
|||"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
It is not so hard to make two databases equally slow just put "delay for" in
key places...
|||Bojidar
What did you mean "put "delay for" in> key places..."?
"Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>
> It is not so hard to make two databases equally slow just put "delay for"
in
> key places...
>
|||We can say amount of data is the same (very small variation), and number of
users are almost the same,
I didn't mention, there is also two web aplication (ASP, medical aplication)
that are using mentioned database,
aplication are located on the same IIS server, and everting is working on
LAN (one hospital)
maybe I must set some parametrs in IIS ?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eCOUd23UEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Hi
> What is about amount of data contain on both database? Is it the same?
> Did you identify what queries are caused to the problem? If you did, have
> you tried to improve them?
>
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>
|||kidding
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u2AsB%233UEHA.2408@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Bojidar
> What did you mean "put "delay for" in> key places..."?
> "Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
> news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
first[vbcol=seagreen]
for"
> in
>
|||You should consider the physical file system... Are the databases loaded to
the same or equivalent disks using the same filegroups/files?
Have both of the databases been maintained ( indexdefrag and update
statistics.)
As one other poster mentioned... If you feel like the problem is in the
database, isolate one query which works more slowly in one db than the
other, and look at the query plan... If you can not isolate this to a
single query ( or a group of queries) it might not be a database problem.
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
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>
|||DS1979,
You might want to compare that the databases are indeed identical using
a third party tool such as http://www.red-gate.com/SQL_Compare.htm or
look at http://www.aspfaq.com/show.asp?id=2209 for more options.
This will highlight any differences. Once you have confirmed they are
the same, update statistics and defrag indexes. Also check that the
databases are residing on the same disk subsystem by running sp_helpfile
in each db.
Use Profiler to check the worst performing queries, then look at the
execution plans of those queries - there could be indexing differences
between the databases.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
DS1979 wrote:
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>
|||Thanks, I think maybe I found problem
See this
I found someting new in this story,
I found that administrator did this
1) copy xxx.mdf and xxx_log.ldf from (copy from file system) server A to
server B
2) Make new database on server B
3) Change path in server B database >>> properties >>> Data file and
Transaction Log to server B\xxx.mdf and server B\xxx_log.ldf
4) Put database server B\ working
no_sp_detach, no sp_attach ?
What do you think is this main reason for slow working (faster database
didn't moved from orginal location and it's working good)
What is the best solution to repair this situation now ?
Thanks, again
"Wayne Snyder" <wayne.snyder@.mariner-usa.com> wrote in message
news:%23PMikB5UEHA.3428@.TK2MSFTNGP12.phx.gbl...
> You should consider the physical file system... Are the databases loaded
to
> the same or equivalent disks using the same filegroups/files?
> Have both of the databases been maintained ( indexdefrag and update
> statistics.)
> As one other poster mentioned... If you feel like the problem is in the
> database, isolate one query which works more slowly in one db than the
> other, and look at the query plan... If you can not isolate this to a
> single query ( or a group of queries) it might not be a database problem.
> --
> 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
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
>

database speed

I have two database (structurly idenical) on the same SQL server, first
working good, but second is very slow
(noticed from web aplication)
I would like the same speed for both database
is there any database parameters need to be set to make same speed
Thanks for your answerHi
What is about amount of data contain on both database? Is it the same?
Did you identify what queries are caused to the problem? If you did, have
you tried to improve them?
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
It is not so hard to make two databases equally slow just put "delay for" in
key places...|||Bojidar
What did you mean "put "delay for" in> key places..."?
"Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
> > I have two database (structurly idenical) on the same SQL server, first
> > working good, but second is very slow
> > (noticed from web aplication)
> >
> > I would like the same speed for both database
>
> It is not so hard to make two databases equally slow just put "delay for"
in
> key places...
>|||We can say amount of data is the same (very small variation), and number of
users are almost the same,
I didn't mention, there is also two web aplication (ASP, medical aplication)
that are using mentioned database,
aplication are located on the same IIS server, and everting is working on
LAN (one hospital)
maybe I must set some parametrs in IIS '
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eCOUd23UEHA.2692@.TK2MSFTNGP09.phx.gbl...
> Hi
> What is about amount of data contain on both database? Is it the same?
> Did you identify what queries are caused to the problem? If you did, have
> you tried to improve them?
>
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
> > I have two database (structurly idenical) on the same SQL server, first
> > working good, but second is very slow
> > (noticed from web aplication)
> >
> > I would like the same speed for both database
> > is there any database parameters need to be set to make same speed
> >
> > Thanks for your answer
> >
> >
>|||kidding
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u2AsB%233UEHA.2408@.tk2msftngp13.phx.gbl...
> Bojidar
> What did you mean "put "delay for" in> key places..."?
> "Bojidar Alexandrov" <bojo_do_not_spam@.kodar.net> wrote in message
> news:%23x1h563UEHA.2564@.TK2MSFTNGP11.phx.gbl...
> >
> > "DS1979" <ds19792004@.yahoo.com> wrote in message
> > news:caovo2$qcg$1@.ls219.htnet.hr...
> > > I have two database (structurly idenical) on the same SQL server,
first
> > > working good, but second is very slow
> > > (noticed from web aplication)
> > >
> > > I would like the same speed for both database
> >
> >
> > It is not so hard to make two databases equally slow just put "delay
for"
> in
> > key places...
> >
> >
>|||You should consider the physical file system... Are the databases loaded to
the same or equivalent disks using the same filegroups/files?
Have both of the databases been maintained ( indexdefrag and update
statistics.)
As one other poster mentioned... If you feel like the problem is in the
database, isolate one query which works more slowly in one db than the
other, and look at the query plan... If you can not isolate this to a
single query ( or a group of queries) it might not be a database problem.
--
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
"DS1979" <ds19792004@.yahoo.com> wrote in message
news:caovo2$qcg$1@.ls219.htnet.hr...
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||Out of curiousity have set a performance monitor for both
servers, it could be that one server is being used for a
lot more work than the other.
Other than that just follow what the guys have said.
J
>--Original Message--
>I have two database (structurly idenical) on the same SQL
server, first
>working good, but second is very slow
>(noticed from web aplication)
>I would like the same speed for both database
>is there any database parameters need to be set to make
same speed
>Thanks for your answer
>
>.
>|||DS1979,
You might want to compare that the databases are indeed identical using
a third party tool such as http://www.red-gate.com/SQL_Compare.htm or
look at http://www.aspfaq.com/show.asp?id=2209 for more options.
This will highlight any differences. Once you have confirmed they are
the same, update statistics and defrag indexes. Also check that the
databases are residing on the same disk subsystem by running sp_helpfile
in each db.
Use Profiler to check the worst performing queries, then look at the
execution plans of those queries - there could be indexing differences
between the databases.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
DS1979 wrote:
> I have two database (structurly idenical) on the same SQL server, first
> working good, but second is very slow
> (noticed from web aplication)
> I would like the same speed for both database
> is there any database parameters need to be set to make same speed
> Thanks for your answer
>|||Thanks, I think maybe I found problem
See this
I found someting new in this story,
I found that administrator did this
1) copy xxx.mdf and xxx_log.ldf from (copy from file system) server A to
server B
2) Make new database on server B
3) Change path in server B database >> properties >> Data file and
Transaction Log to server B\xxx.mdf and server B\xxx_log.ldf
4) Put database server B\ working
no_sp_detach, no sp_attach ?
What do you think is this main reason for slow working (faster database
didn't moved from orginal location and it's working good)
What is the best solution to repair this situation now ?
Thanks, again
"Wayne Snyder" <wayne.snyder@.mariner-usa.com> wrote in message
news:%23PMikB5UEHA.3428@.TK2MSFTNGP12.phx.gbl...
> You should consider the physical file system... Are the databases loaded
to
> the same or equivalent disks using the same filegroups/files?
> Have both of the databases been maintained ( indexdefrag and update
> statistics.)
> As one other poster mentioned... If you feel like the problem is in the
> database, isolate one query which works more slowly in one db than the
> other, and look at the query plan... If you can not isolate this to a
> single query ( or a group of queries) it might not be a database problem.
> --
> 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
>
> "DS1979" <ds19792004@.yahoo.com> wrote in message
> news:caovo2$qcg$1@.ls219.htnet.hr...
> > I have two database (structurly idenical) on the same SQL server, first
> > working good, but second is very slow
> > (noticed from web aplication)
> >
> > I would like the same speed for both database
> > is there any database parameters need to be set to make same speed
> >
> > Thanks for your answer
> >
> >
>

Database special users

What are the sys and information_schema special database users used for.

Hi!

sys and information_schema are special database users who has "public" access rights(by default) to access "INFORMATION_SCHEMA" and "SYS" system views, like: INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS, etc...

Note: And you cannot delete these users.

Thanks & Regards,

Kiran.Y

Database spanning multiple partitions.....help

I posted a message earlier, thinking I knew the how. However I didn't
Cany anyone tell me how to change an existing database that exists on an H:
drive to span across another partition of say an I: .
My idea is this, the database is growing. We expanded the mirrored hard
drives from 70gb to 140gb. Now we have an additional amount of unused
space. I formatted the new partition and gave it an I: name.
I thought you could give the database a "Secondary" location. I thought
this meant that if the database filled up my H: drive, then it would
automatically start writing to the I: drive. Is this the case? If so, ho
w
can I set it up?
Thanks for any help
GordonYou thought wrong Gordon<g>. You would be better off to change the original
partition to the full size of the new drives and not have to worry about
splitting them up. Since the two partitions are on the same drive array
there is no performance gain in splitting them. You can add a new file to
the existing file group on the new partition but what will happen is this.
SQL Server uses a proportional fill algorithm to fill the files within the
filegroup. This is based on the amount of free space in each file. Ideally
you start with multiple files that are empty and sql server will fill them
equally as it inserts new rows. In your case if you simply add a new file
there will be some data written to the new file and some to the old. The
ratio depends on the amount of free space in each file. When filling in
disproportion like that it will cause more reads and writes to one file vs
spreading evenly over all of them. While you can do what you are after you
need to realize this is not going to work the way you thought. I recommend
you repartition the drive to make it one large partition instead of two
smaller ones.
Andrew J. Kelly SQL MVP
"Gordon" <Gordon@.discussions.microsoft.com> wrote in message
news:90E69280-63BF-4BA8-8F73-584C9534B06E@.microsoft.com...
>I posted a message earlier, thinking I knew the how. However I didn't
> Cany anyone tell me how to change an existing database that exists on an
> H:
> drive to span across another partition of say an I: .
> My idea is this, the database is growing. We expanded the mirrored hard
> drives from 70gb to 140gb. Now we have an additional amount of unused
> space. I formatted the new partition and gave it an I: name.
> I thought you could give the database a "Secondary" location. I thought
> this meant that if the database filled up my H: drive, then it would
> automatically start writing to the I: drive. Is this the case? If so,
> how
> can I set it up?
> Thanks for any help
> Gordonsql