| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hello I am looking for a script that creates a database like this: createdb -N to create a database of 2G In the script, I will use this: isql -U sa -P -S server_name create database how to search for a free device_name that has less than 2G space? Do you have any other script that automatically creates a database? thank you! |
|
#2
|
| > Hello > > I am looking for a script that creates a database like this: > > createdb -N > > to create a database of 2G > > In the script, I will use this: > > isql -U sa -P -S server_name > create database > > > how to search for a free device_name that has less than 2G > space? > > Do you have any other script that automatically creates a > database? > > thank you! (1) 2000MB is not the same as 2GB (2048MB). (2) You really do not want to seperate data and log? (3) You want the database to be on only one device? (4) But it can be in fragments on the device? (5) Your script example provides no of specifying the two arguments. I assume that you mean something more general. (I've forgotten if "create database" is valid within a stored procedure or not. If not, then perhaps (?) dynamic SQL can be used.) (6) Which release do you have? (7) Most importantly, do you really want to "administer" a server in this fashion? This method has a "hack" feeling to it. |
|
#3
|
| Hello and thanks for the reply. (1) 2000MB is not the same as 2GB (2048MB). Thanks for the info (2) You really do not want to seperate data and log? No (for the moment) (3) You want the database to be on only one device? Yes (for the moment) (4) But it can be in fragments on the device? Yes (5) Your script example provides no of specifying the two arguments. I assume that you mean something more general. (I've forgotten if "create database" is valid within a stored procedure or not. If not, then perhaps (?) dynamic SQL can be used.) A stored procedure is also an option (6) Which release do you have? 12.5.4 (7) Most importantly, do you really want to "administer" a server in this fashion? This method has a "hack" feeling to it. Yes. thanks again > > > news:48aabb1a.1952.1681692777-at-sybase.com... Hello > > > > I am looking for a script that creates a database like > this: > > > createdb -N > > > > to create a database of 2G > > > > In the script, I will use this: > > > > isql -U sa -P -S server_name > > create database > > > > > > how to search for a free device_name that has less than > > 2G space? > > > > Do you have any other script that automatically creates > > a database? > > > > thank you! > > (1) 2000MB is not the same as 2GB (2048MB). > (2) You really do not want to seperate data and log? > (3) You want the database to be on only one device? > (4) But it can be in fragments on the device? > (5) Your script example provides no of specifying the two > arguments. I assume that you mean something more > general. (I've forgotten if "create database" is valid > within a stored procedure or not. If not, then perhaps > (?) dynamic SQL can be used.) (6) Which release do you > have? (7) Most importantly, do you really want to > "administer" a server in this fashion? This method has a > "hack" feeling to it. > > |
|
#4
|
| Realizing that you can end up with some odd fragments in sysusages, and you could have some performance issues, and you'll have data and log mixed on the same devices ... - create your devices (disk init) - flag each device as a 'default' device (sp_diskdefault) - create your databases on the 'default' device (create database The above should allow you to create databases on any 'default' disks that still have some space available, ie, there's no need for you to know the name of devices with free space. NOTE: I'd recommend disabling the master device as a default disk. > Hello and thanks for the reply. > > (1) 2000MB is not the same as 2GB (2048MB). > Thanks for the info > (2) You really do not want to seperate data and log? > No (for the moment) > (3) You want the database to be on only one device? > Yes (for the moment) > (4) But it can be in fragments on the device? > Yes > (5) Your script example provides no of specifying the two > arguments. I > assume that you mean something more general. (I've > forgotten if "create > database" is valid within a stored procedure or not. If > not, then perhaps > (?) dynamic SQL can be used.) > A stored procedure is also an option > (6) Which release do you have? > 12.5.4 > (7) Most importantly, do you really want to "administer" > a server in this fashion? This method has a "hack" > feeling to it. > > Yes. > > thanks again > > > > > > news:48aabb1a.1952.1681692777-at-sybase.com... Hello > > > > > > I am looking for a script that creates a database like > > this: > > > > createdb -N > > > > > > to create a database of 2G > > > > > > In the script, I will use this: > > > > > > isql -U sa -P -S server_name > > > create database > > > > > > > > > how to search for a free device_name that has less > > > than 2G space? > > > > > > Do you have any other script that automatically > > > creates a database? > > > > > > thank you! > > > > (1) 2000MB is not the same as 2GB (2048MB). > > (2) You really do not want to seperate data and log? > > (3) You want the database to be on only one device? > > (4) But it can be in fragments on the device? > > (5) Your script example provides no of specifying the > > two arguments. I assume that you mean something more > > general. (I've forgotten if "create database" is valid > > within a stored procedure or not. If not, then perhaps > > (?) dynamic SQL can be used.) (6) Which release do you > > have? (7) Most importantly, do you really want to > > "administer" a server in this fashion? This method has > > a "hack" feeling to it. > > > > |
|
#5
|
| Mark A. Parsons wrote: > Realizing that you can end up with some odd fragments in > sysusages, and you could have some performance issues, and > you'll have data and log mixed on the same devices ... > > - create your devices (disk init) > - flag each device as a 'default' device (sp_diskdefault) > - create your databases on the 'default' device (create > database > > The above should allow you to create databases on any > 'default' disks that still have some space available, ie, > there's no need for you to know the name of devices with > free space. > > NOTE: I'd recommend disabling the master device as a > default disk. If I was stuck doing administration through a series of shell scripts, I would make it a bit more elaborate using the 'dos-like' screens provided by the dialog tool. That way, I wouldn't have to remember which script did what and what the options were at 3am in the morning. example) Have a screen show available space and have a dialog screen option to either place the new database on available space auto magically or specify the placement manually. This kind of console based GUI interface isn't necessarily a bad thing to use - Database Artisan does the same but as a windows gui not a console gui. Use what works ![]() -- Jason L. Froebe TeamSybase http://www.froebe.net/blog MyDatabases Free Magazine http://froebe.net/blog/mydatabases-magazine/ |
![]() |
| Thread Tools | |
| Display Modes | |