Location: SQL Server

Discussion: Script (or atleast dictate) a unique path for log files?

Keyword tags: database sql server

Watch
brian_summers
brian_summers
Script (or atleast dictate) a unique path for log files?
Dec 29 2007, 1:57 AM EST
Is it possible to script (or atleast dictate) a unique path for log files when installing a SQL instance?
I have a customer that is asking.

He is able to manually change the directory path for log files after installing, but he's looking to automate the install process.
Any ideas?

Brian
1  out of 1 found this valuable. Do you?    
todd_muirhead
todd_muirhead
RE: Script (or atleast dictate) a unique path for log files?
Dec 31 2007, 12:23 AM EST
It is possible to script the location of the log file during the creation of a SQL Server database. We have an example in the create db script for the SQL Server version of DVD Store. See the wiki section - http://www.delltechcenter.com/page/DVD+Store .

Thanks - Todd
1  out of 1 found this valuable. Do you?    
brian_summers
brian_summers
RE: Script (or atleast dictate) a unique path for log files?
Jan 2 2008, 8:10 AM EST
thanks todd :-) Do you find this valuable?    
brian_summers
brian_summers
RE: Script (or atleast dictate) a unique path for log files?
Jan 2 2008, 5:49 PM EST
Is this script buried in the ds2_sqlserver.tar.gz? Do you find this valuable?    
todd_muirhead
todd_muirhead
RE: Script (or atleast dictate) a unique path for log files?
Jan 3 2008, 12:56 AM EST
The example of how to specify a log file is included in the create all scripts located in the ds2_sqlserver.tar.gz. After you extract the files (you can use Winzip to open these tar files in windows - you will get a warning about trailing garbage - which you can safely ignore) the sqlserverds2_Create_all_large4.sql located in the sqlserverds2 directory will include it. It is also in the sqlserverds2\build\sqlserverds2_create_db.sql file.

Briefly it is something like this:


CREATE DATABASE DS2 ON
PRIMARY
(
NAME = 'primary',
FILENAME = 'G:\ds.mdf'
),
FILEGROUP DS_MISC_FG
(
NAME = 'ds_misc',
FILENAME = 'H:\ds_misc.ndf',
SIZE = 1GB
),
.....................
LOG ON
(
NAME = 'ds_log',
FILENAME = 'L:\ds_log.ldf',
SIZE = 100GB
)
GO

(The above is cut and pasted from one of the build files I mentioned)

Thanks,
Todd
1  out of 1 found this valuable. Do you?    
brian_summers
brian_summers
RE: Script (or atleast dictate) a unique path for log files?
Jan 3 2008, 6:46 AM EST
Thanks Todd!

Brian
Do you find this valuable?    
brian_summers
brian_summers
RE: Script (or atleast dictate) a unique path for log files?
Jan 28 2008, 12:53 PM EST
Todd...any chance I could grab you for a quick call with my customer?

Per his latest email...

"All that has shown up on this thread is for creating a new database with a different log path. What I need is to install a SQL instance with a non-default log file path. I don’t have a login to post comments on that thread. I don’t know if there is someone else to ask, or if we need to clarify what I am looking for on that post."

--Brian
Do you find this valuable?    
todd_muirhead
todd_muirhead
RE: Script (or atleast dictate) a unique path for log files?
Jan 28 2008, 5:20 PM EST
I haven't been able to find a way to script the SQL Server log file path during installation. But, you should be able to script what you are doing to change them manually. In SQL Management Studio you can select the Script option from the properties dialog where you are changing the path for the log.

Thanks - Todd
Do you find this valuable?    
Top Contributors
Browse by Keywords
Loading...