SQL Training en-us

download SQL Training en-us

of 53

Transcript of SQL Training en-us

  • 7/29/2019 SQL Training en-us

    1/53

    SQL Training

    2006.12.4 Shanghai

    Grace Zhou

  • 7/29/2019 SQL Training en-us

    2/53

    SQL Training

    Schedule:

    SQL Installation

    SQLAccuMark

    SQL user's permission setting in AccuMar

    SQL Backup and RestorationSQL Connection

    Exercise

  • 7/29/2019 SQL Training en-us

    3/53

    SQL Training

    SQL Installation

    SQL different versions

    MSDE2000(SP4)

    SQL Server 2000 (SP4)

    SQL Server 2005SQL Server 2005 Express

  • 7/29/2019 SQL Training en-us

    4/53

    SQL Training

    SQL Installation Instruction1. System Account

    a. Built-in System Account

    Local System Accountdoesnt require a

    password to connect to SQL Server on the

    same computer. (Recommended)

    Network Service Account similar to anauthenticated user account, has the same

    level of access as members of the Users group.

    Local Service Account similar to an authenticated user account, has the same level ofaccess as members of the Users group. This limited access helps safeguard the system ifindividual services or progresses are compromised.

    b. Domain User AccountUses Windows Authentication to set up and connect to SQL Server. (Recommended)

  • 7/29/2019 SQL Training en-us

    5/53

    SQL Training

    2. Authentication ModeUse the Authentication Mode in Installation

    Wizard to check the connection between

    the client and the server of this system

    a. Windows Mode

    SQL Server validates the account name and

    password using information in the Windowsoperation system. (Default)

    b. Mixed Mode (Windows authentication SQL Server authentication)User can use the trusted connection of Windows authentication or use

    SQL to login, but you must set strong passwords for SQL account.

  • 7/29/2019 SQL Training en-us

    6/53

    SQL Training

    c. Windows Mode and Mixed Mode Conversion

    Choose a server, view the Property. The current setting is Windows Only

    Mode for example.

  • 7/29/2019 SQL Training en-us

    7/53

    SQL Training

    Change it to SQL Server and Windows Mixed Mode

  • 7/29/2019 SQL Training en-us

    8/53

    SQL Training

    Restart is required to enable the service

    Choose the server, edit SQL Server Property

  • 7/29/2019 SQL Training en-us

    9/53

    SQL Training

    Choose SQL Authentication Mode, set the default user name as sa,

    and valid password

  • 7/29/2019 SQL Training en-us

    10/53

    SQL Training

    3. SQL ServiceSQL Server:

    the service is required to be enabled to run SQL

    (MSDE, SQL2000, SQL2005Express, SQL2005)

    SQL Server Agent:

    the service is required to be enabled to process SQL schedule backup task

    (MSDE, SQL2000, SQL2005)

    SQL Browser:

    the service is required to be enabled to connect different SQL servers

    (SQL2005Express, SQL2005)

  • 7/29/2019 SQL Training en-us

    11/53

    SQL Training

    SQL AccuMark

  • 7/29/2019 SQL Training en-us

    12/53

    SQL Training

    DSN (Data Source Name)1.What is DSN

    Provides connectivity to a database through an ODBC driver. Containsthe database name, directory, database drive, userid, password andother information. Basically they are data structures used to describe theconnection to a database. Once you create a DSN for a particulardatabase, you can use the DSN in an application to call information fromthe database. It is most likely beneficial when the system is notconnected to domain, you can use this way to connect database.

    2. Create DSN

    User DSN create for a specific user (information is stored in registry)

    System DSN can be used by anyone who has access to the machine

    (information is stored in registry)

    File DSN -DSN information is stored in a text file with a .dsn extension

  • 7/29/2019 SQL Training en-us

    13/53

    SQL Training

    Choose Administrative Tool and open Data Source (ODBC)

    Create System DSN, click Add button to create data source.

  • 7/29/2019 SQL Training en-us

    14/53

    SQL Training

    Choose SQL Server as the drive for data source.

    Name the data source, and choose the

    SQL server to be connected.

  • 7/29/2019 SQL Training en-us

    15/53

    SQL Training

  • 7/29/2019 SQL Training en-us

    16/53

    SQL Training

  • 7/29/2019 SQL Training en-us

    17/53

    SQL Training

    3. Connect DSN in AccuMarkEnter DSN name, click OK

    after successfully test.

  • 7/29/2019 SQL Training en-us

    18/53

    SQL Training

    Server Path (Optional)

  • 7/29/2019 SQL Training en-us

    19/53

    SQL Training

    AuthenticationWhen creating SQL instance, it can be assigned as Windows

    authentication or SQL authentication. If it is Windows authentication,

    keep the default Windows option. If it is SQL authentication, you shouldchoose SQL, and enter the valid user name and password.

  • 7/29/2019 SQL Training en-us

    20/53

    SQL Training

    CAD Relational DatabaseSet CAD Relational Database, AccuMark data can be shared with other

    software, such as WebPDM. Enter a random name in Database field of

    SQL Support, system will create this database automatically.

  • 7/29/2019 SQL Training en-us

    21/53

    SQL Training

    An existing SQL storage area can be assigned to be connected with therelational database.

  • 7/29/2019 SQL Training en-us

    22/53

    SQL Training

    Open the Enterprise Management in SQL Server2000 or ManagementStudio in SQL2005, you can find the AccuMark data such as Piece,

    Model and Marker saved in the relational database. Other software can

    access AccuMark data through this interface.

  • 7/29/2019 SQL Training en-us

    23/53

    SQL Training

    SOL user's permission setting in AccuMar Add User

    Choose Add/Change Login User in MSDE-Manager

  • 7/29/2019 SQL Training en-us

    24/53

    SQL Training

    Set User permission for AccuMark database

    Attention: This feature is currently unavailable

  • 7/29/2019 SQL Training en-us

    25/53

    SQL Training

  • 7/29/2019 SQL Training en-us

    26/53

    SQL Training

    Set the different user privileges for differentstorage area

  • 7/29/2019 SQL Training en-us

    27/53

    SQL Training

    After setting unreadable permission, when user open any data in thisstorage area, such prompt as follows will appear:

    While user doesn't have write permission for this storage area, he/shecan not save any data.

  • 7/29/2019 SQL Training en-us

    28/53

    SQL Training

    SQL Backup and Restoration

    There are two methods to backup SQL. Method one:Through the SQL/MSDE Backup

    feature in AccuMark Explorer

    Method two: Through the backup/restoration

    feature of Enterprise Manager in SQL Server 2000or Management Studio in SQL Server2005

  • 7/29/2019 SQL Training en-us

    29/53

    SQL Training

    SQL/MSDE Backup and Restoration1. Create Server Registration, choose manually register or

    from the list

  • 7/29/2019 SQL Training en-us

    30/53

    SQL Training

  • 7/29/2019 SQL Training en-us

    31/53

    SQL Training

    SQL T i i

  • 7/29/2019 SQL Training en-us

    32/53

    SQL Training

    2. Backup DatabaseRight click the mouse on a selected storage area for backup, choose

    Backup Database in all tasks option.

    SQL T i i

  • 7/29/2019 SQL Training en-us

    33/53

    SQL Training

    SQL T i i

  • 7/29/2019 SQL Training en-us

    34/53

    Choose the location for storing backup file. Default Location: C:\ProgramFiles\Microsoft SQL Server\MSSQL.1\MSSQL\Backup

    SQL Training

    SQL T i i

  • 7/29/2019 SQL Training en-us

    35/53

    SQL Training

    Set the schedule task for backup job

    Attention: For SQL Server 2000/2005/MSDE,SQL Agent must be enabled to

    support the implementation of schedule for backup job. Since SQL 2005

    Express doesn't have Agent service, this feature is not available.

    SQL T i i

  • 7/29/2019 SQL Training en-us

    36/53

    SQL Training

    3. Restore DatabaseRight click the mouse on a selected storage area to be restored, choose

    Restore Database in all tasks

    SQL T i i

  • 7/29/2019 SQL Training en-us

    37/53

    SQL Training

    Choose the backup file to be restored

    SQL T i i

  • 7/29/2019 SQL Training en-us

    38/53

    SQL Training

    SQL T i i

  • 7/29/2019 SQL Training en-us

    39/53

    SQL Training

    SQL Server Backup and Restoration1. Backup database

    Take SQL Server 2005 Express as example, open Management Studio,

    expand Database node, choose the database for backup.

    SQL Training

  • 7/29/2019 SQL Training en-us

    40/53

    SQL Training

    Set the location for saving the backup file

    The completed successfully" dialogue box will appear

    SQL Training

  • 7/29/2019 SQL Training en-us

    41/53

    SQL Training

    2. Restore DatabaseChoose the database to be restored

    SQL Training

  • 7/29/2019 SQL Training en-us

    42/53

    SQL Training

    Choose From Device to assignthe path of backup file

    SQL Training

  • 7/29/2019 SQL Training en-us

    43/53

    SQL Training

    SQL Connection User Permission

    1. User1 connects to local SQL Server on PC1:User1 must have administrator permission to connect SQL Server in

    local AccuMark.

    2. User1 connects to remote SQL Server on PC2:

    User 1 must be added in PC2s user group with administrators

    permission. Then User1 can connect to PC2s SQL Server.

    SQL Training

  • 7/29/2019 SQL Training en-us

    44/53

    SQL Training

    Add user in Computer Manager(use his Windows login username

    and password), and add to user

    group with administrator permission

    SQL Training

  • 7/29/2019 SQL Training en-us

    45/53

    SQL Training

    Firewall settingFor Windows XP OS, its firewall needs to be set.

    SQL Training

  • 7/29/2019 SQL Training en-us

    46/53

    SQL Training

    SQL Training

  • 7/29/2019 SQL Training en-us

    47/53

    SQL Training

    SQL Training

  • 7/29/2019 SQL Training en-us

    48/53

    SQL Training

    Add sqlserver.exe and sqlbrowser.exe to exceptional program list.

    SQL Training

  • 7/29/2019 SQL Training en-us

    49/53

    SQL Training

    Enable TCP/IP and Named Pipes.1. MSDE2000:

    Enable through setting DISABLENETWORKPROTOCOLS=0

    2. SQL Server 2000 (Default is enabled)

    SQL Training

  • 7/29/2019 SQL Training en-us

    50/53

    SQL Training

    3.SQL Server 2005

    SQL Training

  • 7/29/2019 SQL Training en-us

    51/53

    SQL Training

    4. SQL Server 2005 Express .Valid only upon restarting SQLServer and SQL Browser after enabling.

    SQL Training

  • 7/29/2019 SQL Training en-us

    52/53

    SQL Training

    Connection of different versions of SQL.When connecting the client to the server, using the same

    version of SQL is recommended.

    SQL Training

  • 7/29/2019 SQL Training en-us

    53/53

    SQL Training

    Exercise

    Install SQL Server2000 or SQL Server 2005 Express Practise SQL backup and restoration

    AccuMark : connect SQL Server (connected between 2 PCs)

    Practise setting different read/write access permission