--  Copyright (c) BEA Systems, Inc.  All rights reserved.
--
-- Sample Microsoft SQL Server create database, login, and user script
-- *** Make a copy of this script and change <<WEBLOGIC>> to the desired database and user.
-- *** CHANGE D:\DATAFILE, E:\LOGFILE and F:\INDEXFILE\WEBLOGIC_INDEX.NDF to valid disk locations for your environment.
-- *** Adjust file sizes as needed.
-- *** The default COLLATE setting can be modified as required by your environment.    
-- ***    See your Microsoft SQL Server documentation for SQL Collation Names and the WebLogic Portal Database Administration Guide 
--        (http://edocs.beasys.com) for additional information on configuring SQL Server databases.
-- *** A WEBLOGIC_INDEX FILEGROUP must be defined for proper execution of .sql files that define the WebLogic Portal database.
--
-- Create additional copies of this script to define additional databases for the WEBLOGIC_GROUPSPACE Content Management Repository database 
--  and to create additional Content Management Repository databases.  For example; change <<WEBLOGIC>> to WEBLOGIC_GROUPSPACE.

use master 
go
create database WLI
ON
(NAME = WEBLOGIC_DATA,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\WLI_DATA.mdf',
SIZE = 60)
LOG ON
(NAME = WEBLOGIC_LOG,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\WLI_LOG.ldf',
SIZE = 20)
COLLATE SQL_Latin1_General_CP1_CS_AS
go
checkpoint 
go
use master
go
exec sp_addlogin 'weblogic', 'weblogic', 'WLI', 'us_english'
go
use WLI
go
sp_changedbowner sa
go

ALTER DATABASE WLI ADD FILEGROUP [WEBLOGIC_INDEX] 
GO
ALTER DATABASE WLI ADD FILE(NAME = N'WEBLOGIC_INDEX', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\Data\WLI_INDEX.NDF' , SIZE = 60, FILEGROWTH = 10%) TO FILEGROUP [WEBLOGIC_INDEX]
GO
