This tutorial assumes you have created the test database. If you have not, see Lesson 1: Creating the test database.
You can copy and paste the SQL statements in this tutorial into Interactive SQL.
Start Sybase Central and connect to the test database app_profiling.db with the user ID DBA and the password sql.
If you are unfamiliar with starting Sybase Central and connecting to a database, see Connect to a local database.
In the left pane, select the app_profiling - DBA database, and then choose File » Open Interactive SQL.
Interactive SQL starts and connects to the app_profiling - DBA database.
In Interactive SQL, run the following SQL statements to introduce index fragmentation. These statements can take a few minutes to complete.
CREATE TABLE fragment ( id INT ); CREATE INDEX idx_fragment ON fragment ( id ); INSERT INTO fragment SELECT * FROM sa_rowgenerator ( 0, 100000 ); DELETE FROM fragment WHERE MOD ( id, 2 ) = 0; INSERT INTO fragment SELECT * FROM sa_rowgenerator ( 0, 100000 ); INSERT INTO fragment SELECT * FROM sa_rowgenerator ( 0, 100000 ); COMMIT;
Exit Interactive SQL.
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|