Showing posts with label complete. Show all posts
Showing posts with label complete. Show all posts

Tuesday, March 20, 2012

Script needed to edit open objects in Sybase

Currently I must manually complete the following commands to set a new value
for the "open objects" and "open indexes". I need a way script this process
in a batch file.

COMMANDS RAN: This is nothing to script, these commands obtain the current
values for open objects and open indexes.

isql -Usa -Pmanager -SCOP1_DS
execute sp_countmetadata "open objects"
execute sp_countmetadata "open indexes"
go

RESULTS: below are the results, there are 5124 user objects and 2122 user
indexes. I need a way to be able to multiple these numbers by a set value
and then use the new value and reset the user objects and user indexes. The
question is how do I isolate the results for each result so I can run the
calculations below. Here is the calculation I need:

current user objects * 1.05 = new value
current user indexes * 1.1 = new value

There are 5124 user objects in all database(s), requiring 6985 Kbytes of
memory.

The 'open objects' configuration parameter is currently set to 500.
(return status = 0)
There are 2122 user indexes in all database(s), requiring 5902 Kbytes of
memory.

The 'open indexes' configuration parameter is currently set to 5000.
(return status = 0)

SETTING THE NEW VALUES: Once I have the new values, I can set the ojects and
indexes as seen below.

1> execute sp_configure "open objects", 5380
2> execute sp_configure "open indexes", 2334
3> goAre you perhaps running Sybase? In that case, you'll probably get a more
help by asking this question in a Sybase forum (e.g. comp.databases.sybase)
rather than one dedicated to Microsoft SQL Server. We Microsoft SQL Server
DBAs are spoiled and don't need to deal with those config options anymore
:-)

--
Hope this helps.

Dan Guzman
SQL Server MVP

"News East" <Methu969@.yahoo.com> wrote in message
news:bY7Lf.171258$WH.51367@.dukeread01...
> Currently I must manually complete the following commands to set a new
> value for the "open objects" and "open indexes". I need a way script this
> process in a batch file.
> COMMANDS RAN: This is nothing to script, these commands obtain the current
> values for open objects and open indexes.
>
> isql -Usa -Pmanager -SCOP1_DS
> execute sp_countmetadata "open objects"
> execute sp_countmetadata "open indexes"
> go
>
>
> RESULTS: below are the results, there are 5124 user objects and 2122 user
> indexes. I need a way to be able to multiple these numbers by a set value
> and then use the new value and reset the user objects and user indexes.
> The question is how do I isolate the results for each result so I can run
> the calculations below. Here is the calculation I need:
> current user objects * 1.05 = new value
> current user indexes * 1.1 = new value
>
> There are 5124 user objects in all database(s), requiring 6985 Kbytes of
> memory.
> The 'open objects' configuration parameter is currently set to 500.
> (return status = 0)
> There are 2122 user indexes in all database(s), requiring 5902 Kbytes of
> memory.
> The 'open indexes' configuration parameter is currently set to 5000.
> (return status = 0)
>
> SETTING THE NEW VALUES: Once I have the new values, I can set the ojects
> and indexes as seen below.
>
> 1> execute sp_configure "open objects", 5380
> 2> execute sp_configure "open indexes", 2334
> 3> go|||News East (Methu969@.yahoo.com) writes:
> Currently I must manually complete the following commands to set a new
> value for the "open objects" and "open indexes". I need a way script
> this process in a batch file.

I guess that you should be able to read these from syscurconfigs or
sysconfigure. Provided that is, that Sybase has not changed the
location for the configuration parameters since last I saw it, and
that was loooong ago.

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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 12, 2012

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.
Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegro ups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>
|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.
|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegr oups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>
|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.
|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegr oups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegroups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegroups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegroups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegroups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegroups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegroups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>