Want to correct the database design

I have below database already on one of the environment and its surprisingly designed somewhat in the past.
now I want to correct it with one default filegroup with one primary and one log file, same time i am concerned for data as its production and no test environment is there, can you suggest a way which ensure full consistency and steps i need to do
CREATE
DATABASE [Sample]
ON 
PRIMARY
NAME =
N'Sample_Data',
FILENAME
=
N'E:\SqlData\Sample_data'
, SIZE
= 512000KB
, MAXSIZE
=
UNLIMITED, FILEGROWTH
= 0),
NAME =
N'Sample_Data2',
FILENAME
=
N'E:\SqlData\Sample_data2'
, SIZE
= 14073728KB
, MAXSIZE
=
UNLIMITED, FILEGROWTH
= 10%),
NAME =
N'Sample_Data3',
FILENAME
=
N'I:\Sample_data\Sample_data3'
, SIZE
= 38608640KB
, MAXSIZE
=
UNLIMITED, FILEGROWTH
= 10%),
FILEGROUP [SECONDARY]
NAME =
N'Sample_Data4',
FILENAME
=
N'I:\Sample_data\Sample_data4'
, SIZE
= 2050240KB
, MAXSIZE
=
UNLIMITED, FILEGROWTH
= 10%)
LOG
ON
NAME =
N'Sample_Log',
FILENAME
=
N'H:\SqlLogs\Sample_log'
, SIZE
= 76616KB
, MAXSIZE
= 20480000KB
, FILEGROWTH
= 10%),
NAME =
N'Sample_Log2',
FILENAME
=
N'H:\SqlLogs\Sample_log2'
, SIZE
= 1024KB
, MAXSIZE
= 56320000KB
, FILEGROWTH
= 10%),
NAME =
N'Sample_Log3',
FILENAME
=
N'I:\Sample_data\GMaster_log3'
, SIZE
= 1280KB
, MAXSIZE
= 20480000KB
, FILEGROWTH
= 10%)
GO

I have already showed you how
DBCC SHRINKFILE('logical_ndf_file_name', EMPTYFILE);
ALTER DATABASE database_name REMOVE FILE logical_ndf_file_name;
Because there is only one file group all the data will be moved to the primary (.mdf) data file.
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

  • I want to access the database with user name and password without con. info/udl

    hi to all,
    im doing project related with database... normally i'll connect ***.udl file to open database.vi.
    now what is my question is I want to open the database with the user name with password.... y i need this because once i run the program the program should ask username and password to open database for write/read operation. if its wrong user name and password means program should be denied... 
    can any tell how to access the database toolkit with the username with password....
    im using labview 7.0... 
    i think my question is clear....waiting for reply thank you in advance...
    pls see this attachment.....
    Regards,
    N. Srinivasan
    Attachments:
    access.vi ‏37 KB

    i have already read that link in the discussion forum...but im still have some confussion in... i attached file is so like to give user name and password..?
    and one more things can tell wat to do in ODBC and MDB and in UDL for password lock.. each time i run the promgram it should ask password to acces the database.. 
     thank you a lot for your reply.. 
    it will be more more useful if u clear my doubts clearly....
    Regards,
    N. Srinivasan
    Attachments:
    user=pass.PNG ‏35 KB

  • Resolving Supertypes and Subtypes in the Database Design Transformer

    Hi,
    I have a design question re. converting Logical to Physical Data Models in Designer.
    For the mapping approach from my ERD to my SMD, I chose the Implicit Subtype Implementation, i.e. separate tables for each subtype and for the supertype. However, the subtypes have all the supertype columns. I wondered why Designer enforces this? It makes my SMD very cluttered. I would prefer to have the supertype columns in the supertype only.
    But, before you ask, I know this can be avoided by chosing the Arc Implementation. The problem I have with this approach is that the supertype has a separate FK column for each subtype. I am potentially dealing with many subtypes (50+), so am concerned about the number of null id columns in the supertype table. (Have used this approach before, but with only a handful of tables.)
    Thanks,
    Antony

    The reason that DDT creates one FK column per subtype is that Oracle cannot enforce referential integrity if the same FK references more than one table. You could reverse the foreign keys and have the subtype tables reference the supertype table, but I'm not sure that DDT can generate this - I guess I'd have to try it. Actually, null columns take up little or no space, so they really shouldn't cause a problem. If I remember correctly, the keys are enforced as exclusive arcs - only one of the FKs can be not null.

  • Need to design the database design to support Chinese language

    Hi,
      can anybody give me suggusstion to redesign the SQL Server 2008 R2 database with chinese language support for existing database with varchar datatype (Non- Unicode Data Type)
    Thanks
    Pari

    You have to use NVarchar. Here is the script. During Select also you need N in the string
    set nocount on
    go
    USE master;
    GO
    IF DB_ID (N'MyOptionsTest') IS NOT NULL
    DROP DATABASE MyOptionsTest;
    GO
    CREATE DATABASE MyOptionsTest
    COLLATE Chinese_Taiwan_Stroke_CI_AS;
    GO
    use MyOptionsTest
    go
    IF OBJECT_ID('jj1') IS NULL
    begin
    create table jj1 (name nvarchar(45))
    end
    go
    go
    insert into jj1
    select N'我家己人有淡薄無爽快。'
    insert into jj1
    select N's省城话; t省城話'
    insert into jj1
    select N'微软数据库'
    insert into jj1
    select N'你叫什么名字?'
    insert into jj1
    select N'歡迎!/ 不用謝!/ 不客氣!'
    insert into jj1
    select N'我想18號坐飛機到倫敦'
    select * from jj1
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • I mistyped a user name to enter a website. I want to correct the error but Firefox saved the incorrect user name and won't let me edit it.

    When I signed into a user-name-required website, I made a mistake, but didn't realize my mistake until after I asked firefox to save the sign-in information. Now, all I want to do is edit the username sign-in, but firefox won't allow the edit. What do I do?

    Remove a saved password here: Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    See:
    * http://kb.mozillazine.org/Deleting_autocomplete_entries

  • Database design for the Project System!

    Hi
    I need the database design schema for the Project System .
    For example with the transaction code CJ20N at the left side all the Project Hierarchy is tabulated.
    I want to  know the relations between tables ?
    Would you please help me ?

    look logical database PSJ with tcode SE36
    grx. A.

  • To get best database design

    Hello...
    I am going through one case study for the database design. and for this I want your view / suggestion regarding this.
    I have one table with 6 column
    create table test (
    id primary key,
    col1 varchar2(100),
    col2 varchar2(100),
    col3 varchar2(100),
    col4 varchar2(100),
    col5 varchar2(100))
    It might be possible that col1 value duplicated in col2 or col3 or col4 or col5 for some other raw.
    Now I have query that is require to search for the row by matching given value with all of 5 column col1 to col5. like this:--
    select * from test where col1=''pratik' or col2='pratik' or col3='pratik' or col4='pratik' or col5='pratik';
    I want to know, is this design is good for large table with millions of records into it.
    Is any other design is possible?? that is more efficient
    Thanks

    But in case of address, generally I am going to retrieve address for a give
    name or id. while in this case on basis of supplied value I have to search
    all 5 columnsNot necessarily. A search might be for all customers in a given postal district. But that is my point. I suggested address as a possible explanation for your requirements to fill a void.
    You have given us a strawman architecture and no clues about the underlying business premises. Under those circumstances all I can say is if you want to retrieve Col1, Col2, Col3, Col4 and Col5 for each ID where any of those columns matches 'Pratik' then I think your design is probably correct.
    Certainly I wouldn't want to suggest a different design without knowing why it is legitimate for the value 'Pratik' to appear in Col1, Col2, Col3, Col4 or Col5.
    Cheers, APC

  • Database design to support parameterised interface with MS Excel

    Hi, I am a novice user of SQL Server and would like some advice on how to solve a problem I have. (I hope I have chosen the correct forum to post this question)
    I have created a SQL Server 2012 database that comprises approx 10 base tables, with a further 40+ views that either summarise the base table data in various ways, or build upon other views to create more complex data sets (upto 4 levels of view).
    I then use EXCEL to create a dashboard that has multiple pivot table data connections to the various views.
    The users can then use standard excel features - slicers etc to interrogate the various metrics.
    The underlying database holds a single days worth of information, but I would like to extend this to cover multiple days worth of data, with the excel spreadsheet having a cell that defines the date for which information is to
    be retrieved.(The underlying data tables would need to be extended to have a date field)
    I can see how the excel connection string can be modified to filter the results such that a column value matches the date field,
    but how can this date value be passed down through all the views to ensure that information from base tables is restricted for the specied date, rather than the final results set being passed back to excel - I would rather not have the server resolve the views
    for the complete data set.
    I considered parameterisation of views, but I dont believe views support parameters, I also considered stored procedures, but I dont believe that stored procedures allow result sets to be used as pseudo tables.
    What other options do I have, or have I failed to grasp the way SQL server creates its execution plans and simply having the filter at the top level will ensure the result set is minimised at the lower level? (I dont really want the time taken for the dashboard
    refresh to increase - it currently takes approx 45 seconds following SQL Server Engine Tuning Advisor recommendations)
    As an example of 3 of the views, 
    Table A has a row per system event (30,000+ per day), each event having an identity, a TYPE eg Arrival or Departure, with a time of event, and a planned time for the event (a specified identity will have a sequence of Arrival and Departure events)
    View A compares seperate rows to determine how long between the Arrival and Departure events for an identity
    View B compares seperate rows to determine how long between planned Arrival and Departure events for an identity
    View C uses View A and view B to provide the variance between actual and planned
    Excel dashboard has graphs showing information retrieved from Views A, B and C. The dashboard is only likely to need to query a single days worth of information.
    Thanks for your time.

    You are posting in the database design forum but it seems to me that you have 2 separate but highly dependent issues - neither of which is really database design related at this point.  Rather you have an user interface issue and an database programmability
    issue.  Those I cannot really address since much of that discussion requires knowledge of your users, how they interface with the database, what they use the data for, etc.  In addition, it seems that Excel is the primary interface for your users
    - so it may be that you should post your question to an excel forum.
    However, I do have some comments.  First, views based on views is generally a bad approach.  Absent the intention of indexing (i.e., materializing) the views, the db engine does nothing different for a view than it does for any ad-hoc query. 
    Unfortunately, the additional layering of logic can impede the effectiveness of the optimizer.  The more complex your views become and the deeper the layering, the greater the chance that you befuddle the optimizer. 
    I would rather not have the server resolve the views for the complete data set
    I don't understand the above statement but it scares me.  IMO, you DO want the server to do as much work as possible since it is closest to the data and has (or should have) the resources to access and manipulate the data and generate the desired
    results.  You DON'T want to move all the raw data involved in a query over the network and into the client machine's storage (memory or disk) and then attempt to compute the desired values. 
    I considered parameterisation of views, but I dont believe views support parameters, I also considered stored procedures, but I dont believe that stored procedures allow result sets to be used as pseudo tables.
    Correct on the first point, though there is such a thing as a TVF which is similar in effect.  Before you go down that path, let's address the second statement.  I don't understand that last bit about "used as pseudo tables" but that sounds more
    like an Excel issue (or maybe an assumption).  You can execute a stored procedure and use/access the resultset of this procedure in Excel, so I'm not certain what your concern is.  User simplicity perhaps? Maybe just a terminology issue?  Stored
    procedures are something I would highly encourage for a number of reasons.  Since you refer to pivoting specifically, I'll point out that sql server natively supports that function (though perhaps not in the same way/degree Excel does).   It
    is rather complex tsql - and this is one reason to advocate for stored procedures.  Separate the structure of the raw data from the user.
    (I dont really want the time taken for the dashboard refresh to increase - it currently takes approx 45 seconds following SQL Server Engine Tuning Advisor recommendations)
    DTA has its limitations.  What it doesn't do is evaluate the "model" - which is where you might have more significant issues.  Tuning your queries and indexing your tables will only go so far to compensate for a poorly designed schema (not that
    yours is - just a generalization).  I did want to point out that your refresh process involves many factors - the time to generate a resultset in the server (including plan compilation, loading the data from disk, etc.), transmitting that data over the
    network, receiving and storing the resultset in the client application, manipulating the resultset into the desired form/format), and then updating the display.  Given that, you need to know how much time is spent in each part of that process - no sense
    wasting time optimizing the smallest time consumer. 
    So now to your sample table - Table A.  First, I'll give you my opinion of a flawed approach.  Your table records separate facts about an entity as multiple rows.  Such an approach is generally a schema issue for a number of reasons. 
    It requires that you outer join in some fashion to get all the information about one thing into a single row - that is why you have a view to compare rows and generate a time interval between arrival and departure.  I'll take this a step further and assume
    that your schema/code likely has an assumption built into it - specifically that a "thing" will have no more than 2 rows and that there will only be one row with type "arrival" and one row with type "departure". Violate that assumption and things begin to
    fall apart.  If you have control over this schema, then I suggest you consider changing it.  Store all the facts about a single entity in a single row.  Given the frequency that I see this pattern, I'll guess that you
    cannot.  So let's move on.
    30 thousand rows is tiny, so your current volume is negligible.  You still need to optimize your tables based on usage, so you need to address that first.  How is the data populated currently?  Is it done once as a batch?  Is it
    done throughout the day - and in what fashion (inserts vs updates vs deletes)?  You only store one day of data - so how do you accomplish that specifically?  Do you purge all data overnight and re-populate?   What indexes
    have you defined?  Do all tables have a clustered index or are some (most?) of them heaps?   OTOH, I'm going to guess that the database is at most a minimal issue now and that most of your concerns are better addressed at the user interface
    and how it accesses your database.  Perhaps now is a good time to step back and reconsider your approach to providing information to the users.  Perhaps there is a better solution - but that requires an understanding of your users, the skillset of
    everyone involved, what you have to work with, etc.  Maybe just some advanced excel training? I can't really say and it might be a better question for a different forum.   
    One last comment - "identity" has a special meaning in sql server (and most database engines I'm guessing).  So when you refer to identity, do you refer to an identity column or the logical identity (i.e., natural key) for the "thing" that Table A is
    attempting to model? 

  • How to modify the database by Oracle-ridc-client

    How to modify the database by Oracle-ridc-client

    First of all, from your question it is not very clear what kind of modifications you intend to do - one correct answer to your question could be "call any non-read-only service", which will result as insert/update/delete to a table somewhere. My guess is that this is not the answer you are looking for.
    While working with RIDC (or CIS to answer your other thread at once) you have to understand that you integrate primarily with the application layer of your solution. If you want to modify the database scheme, you might, for instance, add a new metadata field - this is OK, because there is a service that you may call to achieve that. On the other hand you might want to change the db scheme directly (e.g. add a new column to a standard table); here neither RIDC, not CIS will help you unless you create a custom (server-side) service that you will call. Note, however, that you should be doing this only if you are really sure what you are doing.

  • Database Design in JDeveloper

    Hi,
    In JDeveloper 10.1.3.1 (existing) database can be imported (I red about it in Oracle Magazine by Steve Muench). I selected some existing tables and printed these. This works fine and looks good on paper.
    I was wondering how trigger-code, functions, procedures can be imported (or created) in JDeveloper. Also, can I add storage information like tablespaces to objects?
    I would like to use JDeveloper as database-design tool (therefore I need some basic 'designer' functionality)
    Thanks,
    Stephan

    Thanks. I read the documents, interesting!
    From my 'Connections' page I can create a trigger. Thats fine.
    But imagine I do not have a database yet. I want to start from scratch and first create a new table having a simple trigger on it. I go to the 'Applications' page and in the 'Database Design' I drag a table from pallete. This works fine. But, how to add a trigger to this table??
    Thanks,
    Stephan

  • New Database Design

    Hi,
    I'm an DBA and i was assigned to design a new database(fresh) in oracle 11gR2 in windows platform for a project. Since, i'm new to database design, getting confusion on what perspective to approach and where to begin.
    Can anyone please help on this.
    Note: URL's are welcome.

    1011442 wrote:
    Hi,
    Thanks for providing the link.
    The link that you sounds good and providing much info on considerations in creating a database and schema security.
    But, i want the logical design part.
    Assume that the database design for College Management System. It might have enrollment module, result module, staff module, etc., including more schema objects. I'm expecting the procedures or steps involving in such designs & how to design.
    It starts with interviewing the end-user and determining their requirements .. especially flushing out all the entities (student, staff member, department, course, class, etc, etc, etc) and their attributes, then determining the relationship between said entities and attributes.  Those entities, attributes, and relationships will be your logical database design.

  • Getting the database dump based on constants

    Hi,
    I am having a ploblem in my project. The ploblem is i have to get the database dump based on diffrent constants that is if i have taken the dump yesterday and after that some modefaction has bean done tin the database now i want to take the database dump only for the modifyed data but not for the whole data. How can i get the database dump in this manner

    Unfortunately, this is not a feature of the Oracle Migration Workbench. It has been designed as a one shot recovery vehicle for the 3rd party database. I understand why you want to do this and it is on our list of enhancements.
    I'm sorry for the inconvenience
    Barry

  • How to generate oracle sequence using Database Designer Transformer

    I created Entity Relationship Diagram.I can generate Table relavant to that every entity.(using Database Design Transformer).Normaly the Database Design Transformer tries to find a suitable unique key that can be used as the primary key. If it cannot find one, it creates a surrogate primary key.it create sequence for that surrogate key.But I didn't want that.I want generate sequence only the attribute that have primary key.how can i do

    So a digital pulse??

  • How do I edit a merged clip in Audition, that was created in premiere to correct the synchronisation, and have it all updated to the premiere clip?

    Hello,
    How do I edit a merged clip in Audition, that was created in premiere to correct the synchronisation, and have it all updated to the premiere clip?
    I have tried several tutorials but these either:
    - show correction in premiere sequence (which is not practical; given the huge number of files we have)
    - or show the editing in audition of a sequence, not the clip.
    We have started merging audio and video (removing the original audio during merge) but some of the merged clips are out of sync, so we need to correct manually, BUT we want to correct the merged clip, which may or may not end up being used, so we do not want to take it to the sequence as all we are doing is prepare the synced files for editing.
    Any idea how I can correct the synchronisation in Audition?, when I right click on clip and select "Edit in Adobe Audition" I get a list of files but not a multitrack session where I can see my video and audio tracks.

    if premiere pro doesn't sync your footage properly, and you have a huge number of files, you may want to look at pluraleyes.  there is a demo, and if it works properly, it would save you time to have it done right the first time, instead of tracking down random merged clips with bad sync.
    premiere will either export a complete sequence or "edit clip in audition". the edit clip will create a copy of the original audio and open that in audition. there is no dynamic link, its just an audio file open in two programs at the same time.  since there is no dynamic link, its not possible to bring merged clips into audition.
    Adobe Premiere Pro Help | Synchronizing audio and video with Merge Clips
    Once created, the merged clip cannot be re-synchronized, or adjusted. You must make a new merged clip.
    Merged clip audio results in mono track audio only.Final Cut Pro XML and AAF interchange formats are not supported.
    this doesn't give me much hope that audition or any other adobe program outside of premiere will help you fix the problem merged clips.

  • Best Practice for the database owner of an SAP database.

    We recently had a user account removed from our SAP system when this person left the agency.  The account was associated with the SAP database (he created the database a couple of years ago). 
    I'd like to change the owner of the database to <domain>\<sid>adm  (ex: XYZ\dv1adm)  as this is the system admin account used on the host server and is a login for the sql server.  I don't want to associate the database with another admin user as that will change over time.
    What is the best practice for database owner for and SAP database?
    Thanks
    Laurie McGinley

    Hi Laura
    I'm not sure if this is best practise or not, but I've always had the SA user as the owner of the database. It just makes it easier for restores to other systems etc.
    Ken

Maybe you are looking for