You are on page 1of 53

SQL Training

2006.12.4 Shanghai

Grace Zhou

SQL Training

Schedule: SQL Installation SQLAccuMark SQL user's permission setting in AccuMark SQL Backup and Restoration SQL Connection Exercise

SQL Training

SQL Installation SQL different versions MSDE2000(SP4) SQL Server 2000 (SP4) SQL Server 2005 SQL Server 2005 Express

SQL Training
SQL Installation Instruction
1. System Account
a. Built-in System Account
Local System Account doesnt require a password to connect to SQL Server on the same computer. (Recommended) Network Service Account similar to an authenticated 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 of access as members of the Users group. This limited access helps safeguard the system if individual services or progresses are compromised.

b. Domain User Account


Uses Windows Authentication to set up and connect to SQL Server. (Recommended)

SQL Training
2. Authentication Mode Use 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 Windows operation 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.

SQL Training
c. Windows Mode and Mixed Mode Conversion Choose a server, view the Property. The current setting is Windows Only Mode for example.

SQL Training
Change it to SQL Server and Windows Mixed Mode

SQL Training
Restart is required to enable the service

Choose the server, edit SQL Server Property

SQL Training
Choose SQL Authentication Mode, set the default user name as sa, and valid password

SQL Training
3. SQL Service
SQL 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)

SQL Training
SQL AccuMark

SQL Training
DSN (Data Source Name)
1.What is DSN Provides connectivity to a database through an ODBC driver. Contains the database name, directory, database drive, userid, password and other information. Basically they are data structures used to describe the connection to a database. Once you create a DSN for a particular database, you can use the DSN in an application to call information from the database. It is most likely beneficial when the system is not connected 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

SQL Training
Choose Administrative Tool and open Data Source (ODBC)

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

SQL Training
Choose SQL Server as the drive for data source.

Name the data source, and choose the SQL server to be connected.

SQL Training

SQL Training

SQL Training
3. Connect DSN in AccuMark
Enter DSN name, click OK after successfully test.

SQL Training
Server Path (Optional)

SQL Training
Authentication
When 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 should choose SQL, and enter the valid user name and password.

SQL Training
CAD Relational Database
Set 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.

SQL Training
An existing SQL storage area can be assigned to be connected with the relational database.

SQL Training
Open the Enterprise Management in SQL Server2000 or Management Studio 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.

SQL Training

SOL user's permission setting in AccuMark


Add User
Choose Add/Change Login User in MSDE-Manager

SQL Training
Set User permission for AccuMark database

Attention: This feature is currently unavailable

SQL Training

SQL Training
Set the different user privileges for different storage area

SQL Training
After setting unreadable permission, when user open any data in this storage area, such prompt as follows will appear:

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

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 2000 or Management Studio in SQL Server2005

SQL Training
SQL/MSDE Backup and Restoration
1. Create Server Registration, choose manually register or from the list

SQL Training

SQL Training

SQL Training
2. Backup Database
Right click the mouse on a selected storage area for backup, choose Backup Database in all tasks option.

SQL Training

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

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 Training
3. Restore Database
Right click the mouse on a selected storage area to be restored, choose Restore Database in all tasks

SQL Training
Choose the backup file to be restored

SQL Training

SQL Training
SQL Server Backup and Restoration
1. Backup database
Take SQL Server 2005 Express as example, open Management Studio, expand Database node, choose the database for backup.

SQL Training
Set the location for saving the backup file

The completed successfully" dialogue box will appear

SQL Training
2. Restore Database
Choose the database to be restored

SQL Training
Choose From Device to assign the path of backup file

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
Add user in Computer Manager (use his Windows login username and password), and add to user group with administrator permission

SQL Training
Firewall setting
For Windows XP OS, its firewall needs to be set.

SQL Training

SQL Training

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

SQL Training
Enable TCP/IP and Named Pipes.
1. MSDE2000:
Enable through setting DISABLENETWORKPROTOCOLS=0

2. SQL Server 2000 (Default is enabled)

SQL Training
3.SQL Server 2005

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

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

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

You might also like