Solved

How to create SQL database (mdf - file) & log file

Posted on 2001-06-19
8
2,476 Views
Last Modified: 2007-12-19
I am running Oracle-SQL Server 8 Personal.   I want to create sql database and log file for specified location {drive:/path}. What is the procedure, method of this database creation.

I don't have any Windows based application for that.

The following comment is not working properly {Error at line No. 2 {Invalid procedure call "ON"}

/----------------------------------------------
CREATE DATABASE Sales
ON
(NAME = Sales_dat,
FILENAME = 'c:\mssql7\data\saledat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'c:\mssql7\data\salelog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
/----------------------------------------------

[Note : please give me any e.g. And it's very urgent]
0
Comment
Question by:sunifnb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6205882
Are you using M$ SQL Server, or Oracle Server? i ask because of the version 8. SQL Server 2000 indicates is internal version as 8, but the name Personal is rather Oracle. On the other hand, mdf and ldf files is really SQL Server?

I assume that you use SQL server 2000...
Using the Query Analyser, you can simply issue this "query":
CREATE DATABASE YourDatabaseName;

This will create a database, with a mdf file and a ldf file in the default location and with default names.
For more precise indications, you should look up the CREATE DATABASE statement in the Books Online (BOL)

Using the Enterprise Manager, you can simply right-click the Databases folder, and choose "Create New Database".
Finally, in the tools menu, you could use the Create Database Wizard...

Cheers
0
 

Author Comment

by:sunifnb
ID: 6206708
Sorry, i don't have any enterprise manager, so i want to know Oracle SQL comment for create database at the spesific location {drive:/path} and also log file.

Please help me.....
0
 
LVL 8

Accepted Solution

by:
chigrik earned 25 total points
ID: 6209013
>Sorry, i don't have any enterprise manager

What do you have to create database?
If you have isql or osql utilities, the path by default C:\MSSQL7\BINN,
you can create database by running the following statement from the
command prompt (you can put the create database statement
into sql file and run this file from the command prompt):

osql -U sa -P -i c:\CreateDb.sql


Where CreateDb.sql contains the following:

CREATE DATABASE Sales
ON
(NAME = Sales_dat,
FILENAME = 'c:\mssql7\data\saledat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'c:\mssql7\data\salelog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )


Hope this helps
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6209263
As i thought: sunifnb, you are speaking of ORACLE, and this is currently the MS SQL Server topic area!

Now in oracle, the creation of a database is not as simply as in SQL Server, and depends furthermore from the OS You are using.

I think you are trying to use a MSSQL Server Syntax on Oracle Server, where the ON clause is invalid...

I suggest that you post your question rather in the Oracle topic area.

Cheers
0
 
LVL 6

Assisted Solution

by:crsankar
crsankar earned 25 total points
ID: 6216072
If you are trying to create a database in oracle the create database statement would be something of this sort.


CREATE DATABASE db_name
DATAFILE 'phys_file_name' SIZE 10M AUTOEXTEND ON NEXT 2M
LOGFILE 'logfilename1','logfilename2';

Note that this is just the create database statement. There are several other steps involved like creating an instance running scripts for creating data dictionary tables, createing additional tablespaces and rollback segments and so on...

I would suggest you get a dba's help.

If you have db assistant you can create a database very easily in oralce.

Regards
crsankar



0
 
LVL 6

Expert Comment

by:crsankar
ID: 6216074
Note that you should include the sizing paramaters for the log files too in the create database statement.
0
 

Expert Comment

by:CleanupPing
ID: 9282181
sunifnb:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 3

Expert Comment

by:SQLMaster
ID: 9514384
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between chigrik and crsankar
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Dheeraj Jain
EE Cleanup Volunteer
0

Featured Post

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question