Sql server data file and log file

hello experts
what is the best way to save data file and log file in a two node cluster environment. i have an active\passive cluster with windows server 2008r2 enterprise and sql server 2008r2. i am new to the environment and i noticed that all system and user databases
including their data and log files are stored in one drive, just curious, what is the best practise in such kinds of scenario, thank you as always for your help.

Make sure  you have valid/tested  backup strategy for both system and user databases.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • System Center 2012 R2 install: SQL server Data file and log file

    This might be a dumb question, but I can't find the answer anywhere.  
    I'm installing a new instance of  System Center 2012 R2 on a new server, I'm stuck on the SQL Server data file section.  Everytime I put in a path, it says that tne path does not exist.  I'm I supposed to be creating some sort of SQL Server
    data file and log file before this installation, I didn't get this prompt when installing System Center 2012 SP1 or hen I upgraded from System Center 2012 SP1 to System Center 2012 R2
    My SQL is on a different server
    Thank you in advanced

    Have you reviewed the setup.log?
    On a side note, why would you put the database file on the same drive as the OS? That defeats the whole purpose of having a remote SQL Server. Why use a remote SQL Server in the first place.
    Jason | http://blog.configmgrftw.com

  • How to design SQL server data file and log file growth

    how to design SQL DB data file and log file growth- SQL server 2012
    if my data file is having 10 GB sizze and log file is having 5 GB size
    what should be the size in MB (not in %) of autogrowth. based on what we have to determine the ideal size of file auto growth.

    It's very difficult to give a definitive answer on this. Best principal is to size your database correctly in advance so that you never have to autogrow, of course in reality that isn't always practical.
    The setting you use is really dictated by the expected growth in your files. Given that the size is relatively small why not set it to 1gb on the datafile(s) and 512mb on the log file? The important thing is to monitor it on an on-going basis to see if that's
    the appropriate amount.
    One thing you should do is enable instant file initialization by granting the service account Perform Volume Maintenance tasks in group policy. This will allow the data files to grow quickly when required, details here:
    https://technet.microsoft.com/en-us/library/ms175935%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
    Also, it possible to query the default trace to find autogrowth events, if you wanted you could write an alert/sql job based on this 
    SELECT
    [DatabaseName],
    [FileName],
    [SPID],
    [Duration],
    [StartTime],
    [EndTime],
    CASE [EventClass]
    WHEN 92 THEN 'Data'
    WHEN 93 THEN 'Log' END
    FROM sys.fn_trace_gettable('c:\path\to\trace.trc', DEFAULT)
    WHERE
    EventClass IN (92,93)
    hope that helps

  • SQL Server data change and Security

    in our environ any user who login with sa they can change any table data.
    so i write trigger to capture changed data like who change, from which IP etc this
    CREATE TRIGGER [TRG_Users]
    ON [dbo].[UserRights] AFTER INSERT, UPDATE, DELETE
    AS
    DECLARE @strIP VARCHAR(MAX)
    SET @strIP=(SELECT dbo.GetCurrentIP())
    IF EXISTS (SELECT * FROM INSERTED) AND EXISTS (SELECT * FROM DELETED)
    --PRINT 'Update happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'UPDATE')
    ELSE
    IF EXISTS (SELECT * FROM INSERTED)
    --PRINT 'Insert happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'INSERT')
    ELSE
    --PRINT 'Delete happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'DELETE')
    CREATE FUNCTION [dbo].[GetCurrentIP] ()
    RETURNS varchar(255)
    AS
    BEGIN
    DECLARE @IP_Address varchar(255);
    SELECT @IP_Address = client_net_address
    FROM sys.dm_exec_connections
    WHERE Session_id = @@SPID;
    Return @IP_Address;
    END
    but the problem is user can change data after disabling the trigger on specific table. so trigger will not fire and user can seamlessly change data.
    so guide me what is the best way to capture data change and log them. so no one can bypass the security. please do not tell me disable sa account because i am looking for different approach to capture the change data. is there any secure way exist in sql
    server 2005/2008 if yes then please discuss here. thanks

    If you have shared SA password with different users you are bound to get these scenarios.Instaed of focussing on how to capture I would like you to talk with different users and only provide them access which is required.Follow policy f minimum privilege
    your environement will be less complex .
    You can use combination of Logon trigger and CDC to capture it.But again why o make things complex by sharing SA password with many users.
    https://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-%28cdc%29-in-sql-server-2008/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Export dump file and log file  name as sysdate in script

    Hi to All,
    Can anybody help me to give logical backup export dump file namd log file name is as contain sysdate in its name so that we can Uniquelly identified it.
    Regards
    DXB_DBA

    On windows it gets a bit hairy as there really is no clean and nice way of doing it.There are a couple of options.
    1. If you can rely on dateformat not changing, you can use a static substring expression. For example, the following might work w/ finnish locale echo %date:~3,2%%date:~6,2%%date:~9,4%Similarly, when you know the dateformat you can tokenize the output of 'date /t' and discard the tokens you don't want.
    2. You can set dateformat to your liking and then just use %date% in your script
    3. You can run a "SELECT to_char(sysdate,..." into a file and then read that file in your script.
    4. Simon Sheppard also has a solution you could use as a basis. I have a slight issue with the approach, but that could just be me.
    5. Use gnuwin32 or similar ;)
    Also note that %date% env var is set automatically from w2k onwards, so some of the solutions might not work w/ older versions.

  • CREATE DATABASE with data file and log file in query pane

    Hi everyone, 
    After I ran the below code I got the following error message. Can someone help me fix this?
    Thanks
    CREATE DATABASE project
    ON
    (Name= 'project_dat',
    FILENAME ='C:\project.mdf',
    SIZE = 10,
    MAXSIZE = 100,
    FILEGROWTH = 5)
    LOG ON
    (NAME = project_log,
    FILENAME = 'C:\project.ldf',
    SIZE =40,
    MAXSIZE = 100,
    FILEGROWTH = 10);
    Msg 5123, Level 16, State 1, Line 1
    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\project.mdf'.
    Msg 1802, Level 16, State 4, Line 1
    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
    skilo

    Hello ,
    Please go through by support site :
    Use SQL Server Enterprise Manager
    Note The instance of SQL Server Enterprise Manager that is included with SQL Server 7.0 does not support setting the default data directory and the default log directory. However, you can register your instance of SQL Server 7.0 in the instance
    of SQL Server Enterprise Manager that is included with SQL Server 2000, and you can then follow these steps to set the default data directory and the default log directory for your instance of SQL Server 7.0.
    Click Start, point to   Programs, point to
    Microsoft SQL Server, and then click Enterprise Manager.
    In SQL Server Enterprise Manager, right-click your instance of SQL Server, and then click  
    Properties.
    In the SQL Server Properties (Configure) - <Instance Name> dialog box, click the
    Database Settings tab.
    In the New database default location section, type a valid folder path in the
    Default data directory box and in the Default log directory box.
    Click OK.
    Stop your instance of SQL Server, and then restart your instance of SQL Server.
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • Oracle script to extract SQL server data to XML/CSX file format

    HI,
    I have a requirement like-
    Create an Oracle script to Extract data from SQL Server to XML/CSV file format in File server (Oracle Server and File Server are in different boxes).
    Create an Oracle script to Retrieve data from the File Server, validate and load into the Oracle staging table
    Create an Oracle script to Push data from Oracle Staging table to native SQL Server table
    We may/may not be using the staging table
    Could anyone please respond immediately as it is urgent ?
    Thanks,
    Inbamalar

    user10594152 wrote:
    HI,
    I have a requirement like-
    Create an Oracle script to Extract data from SQL Server to XML/CSV file format in File server (Oracle Server and File Server are in different boxes).
    Create an Oracle script to Retrieve data from the File Server, validate and load into the Oracle staging table
    Create an Oracle script to Push data from Oracle Staging table to native SQL Server table
    We may/may not be using the staging table
    Could anyone please respond immediately as it is urgent ?
    Thanks,
    Inbamalar
    Urgent issues indicate a live/production system is having problems and a company is losing money, or customers are being prevented from using it.
    For urgent issues you should raise your issue with Oracle Support using your customer support identifier.
    The community forums are for non-urgent issues.  To suggest such issues are urgent is considered rude, as the people who help here are volunteers with their own jobs to do, so demanding their time for your "urgent" issue is not appropriate.  It also suggests that you think your issue is more important than other people's issues, so you are being rude to those people too.  Your issue is no more important than anyone elses.
    In relation to your question, you need to provide more information.
    Please read: Re: 2. How do I ask a question on the forums?
    When you refer to "SQL Server" are you referring to the Microsoft SQL Server product, or are you just referring to a physical server with your oracle database on it?

  • DATE fields and LOG files  in context with external tables

    I am facing two problems when dealing with the external tables feature in Oracle 9i.
    I created an External Table with some fileds with the DATE data type . There were no issues during the creation part. But when i query the table, the DATE fields are not properly selected though the data is there in the files. Is there any ideas to deal with this ?
    My next question is regarding the log files. The contents in the log file seems to be growing when querying the external tables. Is there a way to control this behaviour?
    Suggestions / Advices on the above two issues are welcome.
    Thanks
    Lakshminarayanan

    Hi
    If you have date datatypes than:
    select
    greatest(TABCASER1.CASERRECIEVEDDATE, EVCASERS.FINALEVDATES, EVCASERS.PUBLICATIONDATE, EVCASERS.PUBLICATIONDATE, TABCASER.COMPAREACCEPDATE)
    from TABCASER, TABCASER1, EVCASERS
    where ...-- join and other conditions
    1. greatest is good enough
    2. to_date creates date dataype from string with the format of format string ('mm/dd/yyyy')
    3. decode(a, b, c, d) is a function: if a = b than return c else d. NULL means that there is no data in the cell of the table.
    6. to format the date for display use to_char function with format modell as in the to_date function.
    Ott Karesz
    http://www.trendo-kft.hu

  • Shell Script to grep Job File name and Log File name from crontab -l

    Hello,
    I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l.
    #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1
    #40 17 * * * /home/oracle/refresh/refresh_ux634.sh > /home/oracle/refresh/refresh_ux634.sh.log 2>&1
    In crontab -l, there are many jobs, i need to grep job name like 'refresh_ug634.sh' and corresponding log name like 'refresh_ug634.sh.log '.
    I am thinking of making a universal script that can grep job name, log name and hostname for one server.
    Then, suppose i modify the refresh_ug634.sh script and call that universal script and echo those values when the script gets executed.
    Please can anyone help.
    All i need to do is have footer in all the scripts running in crontab in one server.
    job file name
    log file name
    hostname
    Please suggest if any better solution. Thanks.

    957704 wrote:
    I need help how to grep that information from crontab -l
    Please can you provide some insight how to grep that shell script name from list of crontab -l jobs
    crontab -l > cron.log -- exporting the contents to a file
    cat cron.log|grep something -- need some commands to grep that infoYou are missing the point. This forum is for discussion of SQL and PL/SQL questions. What does your question have to do with SQL or PL/SQL.
    It's like you just walked into a hardware store and asked where they keep the fresh produce.
    I will point out one thing about your question. You are assuming every entry in the crontab has exactly the same format. consider this crontab:
    #=========================================================================
    # NOTE:  If this is on a clustered environment, all changes to this crontab
    #         must be replicated on all other nodes of the cluster!
    # minute        (0 thru 59)
    # hour          (0 thru 23)
    # day-of-month  (1 thru 31)
    # month         (1 thru 12)
    # weekday       (0 thru 6, sunday thru saturday)
    # command
    #=========================================================================
    00 01 1-2 * 1,3,5,7 /u01/scripts/myscript01  5 orcl  dev
    00 04 * * * /u01/scripts/myscript02 hr 365 >/u01/logs/myscript2.lis
    00 6 * * * /u01/scripts/myscript03  >/u01/logs/myscript3.lisThe variations are endless.
    When you get to an appropriate forum (this on is not it) it will be helpful to explain your business requirement, not just your proposed technical solution.

  • SQL Server Data Tools (2012) and Business Intelligence Studios (2008)

    Hi,
    Can SQL Server 2012 Data Tools be installed alongside BIDS 2008 on my workstation or will I encounter issues?
    Thanks

    Related blogs: BIDS Templates Come to Visual Studio 2012 in SSDT Update
    QUOTE: "Of course you can. I had “BIDS” for SQL Server 2008 R2 installed earlier and then i upgraded it to SQL server 2012 . Now i have “SQL server data tools” and “BIDS ” , both running seamlessly."
    http://blog.sqlauthority.com/2013/03/10/sqlauthority-news-sql-server-data-tools-business-intelligence-for-visual-studio-2012-sql-server-2012-data-tier-application-framework/
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • EXPDP generates new dmp file and reports "file already exists" error

    Hello everyone,
    Hope you all had a wonderful holiday. I got some problems with datapump expdp 10.2.0.4. It would be appreciated if you could provide some advice. Thanks in advance.
    I newly created a 10.2.0.4 database. The database can startup and be connected via Toad without problem. I can also use impdp to import some data to the new database. But when I'm trying to use expdp to export a schema from the database, I got the following errors:
    expdp parfile=expdp_scott_mfp1.parExport: Release 10.2.0.4.0 - 64bit Production on Monday, 26 December, 2011 22:10:49
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options
    ORA-39001: invalid argument value
    ORA-39000: bad dump file specification
    ORA-31641: unable to create dump file "/u02/exports/mfp1/expdp_scott_mfp1_12262011.dmp"
    ORA-27038: created file already exists
    Additional information: 1
    Every time I run the expdp, it just creates the dmp file (expdp_scott_mfp1_12262011.dmp) specified in the parfile under the EXPORT directory and reports "file already exists " error.
    Your advice is highly appreciated.
    Thanks.
    Edited by: 904668 on Dec 27, 2011 8:47 AM

    i thought I found the problem. Used same file name on dump file and log file. How stupid of me. Sorry for bothering. Thanks and happy new year!

  • The February 2015 release of SQL Server Data Tools is now available for download

    We'd like to announce the availability of the latest February 2015 release of SQL Server Data Tools.
    This update is now available for Visual Studio 2012 and 2013. For Visual Studio 2012, use the SQL > Check for Updates tool inside Visual Studio. For Visual Studio 2013, check the Visual Studio update channel (Tools > Extensions and Updates > Updates)
    for this update.  Alternatively, administrative installs are available via the link below.
    Get it here:
    http://msdn.microsoft.com/en-us/data/hh297027
    What’s New?
    Support for the latest Azure SQL Database V12 features
    Improved Cross-Platform Schema Comparison
    New advanced publish options
    Fixes for customer reported issues
    For more details, see the SQL Server Data Tools team blog:
    http://blogs.msdn.com/b/ssdt/archive/2015/03/03/sql-server-data-tools-and-data-tier-application-framework-update-for-february-2015.aspx

    While we are investigating this issue, you can revert to the November release with the links below.  You will need to uninstall your current SSDT.MSI and then run the installer from these ISOs.
    Visual Studio 2012 versions:
    SSDT_11.1.41025.0_BR.iso
    SSDT_11.1.41025.0_CN.iso
    SSDT_11.1.41025.0_DE.iso
    SSDT_11.1.41025.0_EN.iso
    SSDT_11.1.41025.0_ES.iso
    SSDT_11.1.41025.0_FR.iso
    SSDT_11.1.41025.0_IT.iso
    SSDT_11.1.41025.0_JA.iso
    SSDT_11.1.41025.0_KO.iso
    SSDT_11.1.41025.0_RU.iso
    SSDT_11.1.41025.0_TW.iso
    Visual Studio 2013 versions:
    SSDT_12.0.41025.0_BR.iso
    SSDT_12.0.41025.0_CN.iso
    SSDT_12.0.41025.0_DE.iso
    SSDT_12.0.41025.0_EN.iso
    SSDT_12.0.41025.0_ES.iso
    SSDT_12.0.41025.0_FR.iso
    SSDT_12.0.41025.0_IT.iso
    SSDT_12.0.41025.0_JA.iso
    SSDT_12.0.41025.0_KO.iso
    SSDT_12.0.41025.0_RU.iso
    SSDT_12.0.41025.0_TW.iso

  • Steps to move Data and Log file for clustered SQL Server

    Hi guys 
    we have Active'passive SQL 2008R2 cluster environment.
    looking for steps to move Data and log files from user Database  and System Database for  SQL Server Clustered Instance. 
    Currently Data and log  files resides on same drive for user and system Databases..
    Thanks
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

    Try the below link
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/468de435-3432-45c2-a50b-23519cd2686e/moving-the-system-databases-in-a-sql-cluster?forum=sqldisasterrecovery
    -Prashanth

  • Do we need to format data and log files with 64k cluster size for sql server 2012?

    Do we need to format data and log files with 64k cluster size for sql server 2012?
    Does this best practice still applies to sql server 2012 & 2014?

    Yes.  The extent size of SQL Server data files, and the max log block size have not changed with the new versions, so the guidance should remain the same.
    Microsoft SQL Server Storage Engine PM

  • SQL Server 2012 installation and to default user database files to a particular path

    Hi, I am working on SQL Server 2012 installation on one of our test boxes and I would like to configure the sql server install binaries and all the system databases but for tempdb to be in my C and tempdb on a different drive and once all this is set up,
    whenever a developer creates a new database without specifying the path for the mdf & ldf files. They should be defaulted to a path like "D:/Data file" & "D:/Log file" for instance instead of being created on the C drive.
    Thanks in advance.........
    Ione

    Hi,
    You can of course set default location of database through management Studio please refer below link. Once you change default location even if you do not specify location it would take default one.
    http://sqlandme.com/2013/03/18/sql-server-changing-default-database-location-for-server/
    I would advise you not to keep files on C drive let it be dedicated system drive also its quite possible that SQL server service account would not have privilege on C drive so after you move tempdb SQL server would not come online as tempdb files cannot
    be created . Tempdb is always recreated after SQL Server starts so you just need to change location once using Alter database command
    See example mentioned in below link for how to do that
    http://msdn.microsoft.com/en-us/library/ms345408%28SQL.90%29.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

Maybe you are looking for