After Sybase is installed, the program-Sybase contains the following items:
Dsedit Utility
Ocscfg Utility
SQL advantage
Sybase Central Java Edition
Server config
Sybase Software Asset Management (sysam)
To perform database operations, you must first create a server.
Click Start ---- program ----- Sybase ---- server config. Select
Adaptive server, click create adaptive server in the right box to create an adaptive server
Server. Enter the server name, path, and other settings as prompted. When an error log is displayed,
Select Network Address and click add. In connection, enter the ip Address and port number 5000, for example:
192.168.0.107, 5000 Click OK to exit and then click configure default xp server.
But note that the port number is 5004. After the configuration is complete, click OK to exit and then click continue.
After the server is configured for a period of time, the new server can be created.
Click Start ---- program ---- sybase ----- sybase center to enter Sybase
The Centre interface, a tool, connects to the server first established, where you can directly perform database operations
Server actions.
Click Start ---- program ---- sybase ----- SQL advantage to establish a connection with the server.
After the server, you can directly enter an SQL script to perform operations on the database server.
1. Create two testdata devices. The testlog size is 500 mb and MB respectively, and write an SQL script.
A operates in Sybase Centre.
Click the server name, and click "add Database" in the right pane.
Follow the prompts to create the device.
B SQL script:
Disk init
Name = "testdata ",
Physname = "G:/Sybase/testdata. dat ",
Vdevno = 2, size = "500 m"
Disk init
Name = "testlog ",
Phyname = "g:/sybase/testlog. dat ",
Vdevno = 3, size = "400 M"
2. Expand the testlog in the device created above to 500 mb and write the SQL script.
A. in Sybase Centre, perform the following operations:
Right-click testlog in Database Devices and select Properties. On the General tab
Directly modify.
B. the SQL script is:
Disk resize
Name = "testlog ",
Size = "100 M" // note that the added size is entered here.
3. Create the test database, that is, its SQL script.
A. Operate in Sybase Centre
Point to Databases. In the right pane, click add as prompted.
B. SQL script:
Create database test
On testdata = "200 M"
Log on testlog = "200 M"
4. extended database
A. directly edit in Sybase Centre
Right-click "test", click "Devices", and select "edit.
B. SQL script:
Alter database test on testdata = "100 M"
Alter database test log on testlog = "50 M"
5. Create a table and insert data.
Use test
Go
Create table test (testno varchar (8), testcontern varchar (20 ))
Insert test values ('01', 'tanmiy ')
6. Back up the database
A. Back up data in Sybase Centre:
Start backup server first, then click to the database to be backed up, right-click backup first, and press
Complete.
B. the SQL script is:
Dump database test to "G:/Sybase/backup/testdump. Dump"
7. delete a database,
Drop database Test
8. Restore the database
A. Operate in Sybase centre
Create a database with the same name as the database to be restored and store it
The status is the same. Right-click the restore and use the online database name.
Active.
B. the SQL script is:
Load database test from "g:/sybase/backup/testdump. dump"