Articles‎ > ‎ASE 15.7‎ > ‎

Test: Alter Database ... Log Off ...

 

1> create database TEST on disk01=6 log on disk01=2 with override

2> go
CREATE DATABASE: allocating 1536 logical pages (6.0 megabytes) on disk 'disk01' (1536 logical pages requested).
CREATE DATABASE: allocating 512 logical pages (2.0 megabytes) on disk 'disk01' (512 logical pages requested).
 
1> alter database TEST log on disk01=4
2> go
Extending database by 1024 pages (4.0 megabytes) on disk disk01
 
1> sp_helpdb TEST
2> go
 name     db_size                    owner      dbid     created                  durability           lobcomplvl           inrowlen         status
 -------- -------------------------- ---------- -------- ------------------------ -------------------- -------------------- ---------------- ----------------------------
 TEST           12.0 MB              sa            4     Sep 29, 2011             full                          0               NULL         no options set
(1 row affected)
 device_fragments                                             size                       usage                                    created                                            free kbytes
 ------------------------------------------------------------ -------------------------- ---------------------------------------- -------------------------------------------------- --------------------------------
 disk01                                                              6.0 MB              data only                                Sep 29 2011 10:24AM                                            2776
 disk01                                                              2.0 MB              log only                                 Sep 29 2011 10:24AM                                not applicable
 disk01                                                              4.0 MB              log only                                 Sep 29 2011 10:26AM                                not applicable
                                                                                                                                      
 --------------------------------------------------------------------------------------------------------------------------------------------
 log only free kbytes = 6092                                                                                                          
(return status = 0)
 
Remove Partial fragment:
1> alter database TEST log off disk01=1
2> go
Msg 5063, Level 16, State 1:
Server 'ORALIN11', Line 1:
You must have the database 'TEST' in single-user mode to perform an operation that either partially fills a hole or removes a partial disk fragment from the database.
 
Remove Full fragment:
1> alter database TEST log off disk01=4
2> go
Removing 1024 pages (4.0 MB) from disk 'disk01' in database 'TEST'.
 
1> sp_helpdb TEST
2> go
 name     db_size                    owner      dbid     created                  durability           lobcomplvl           inrowlen         status
 -------- -------------------------- ---------- -------- ------------------------ -------------------- -------------------- ---------------- ----------------------------
 TEST            8.0 MB              sa            4     Sep 29, 2011             full                          0               NULL         no options set
(1 row affected)
 device_fragments                                             size                       usage                                    created                                            free kbytes
 ------------------------------------------------------------ -------------------------- ---------------------------------------- -------------------------------------------------- --------------------------------
 disk01                                                              6.0 MB              data only                                Sep 29 2011 10:24AM                                            2776
 disk01                                                              2.0 MB              log only                                 Sep 29 2011 10:24AM                                not applicable
                                                                                                                                      
 --------------------------------------------------------------------------------------------------------------------------------------------
 log only free kbytes = 2012                                                                                                          
(return status = 0)