Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Need to fill the transaction logs to test dump tran

$
0
0

Create a table that has a column that is a CHAR(n) NOT NULL where (n) is larger that @@maxpagesize.  i.e. on a 2K page size server,  CREATE TABLE mytable (c1 CHAR(1200)).

 

This makes row so wide that only one will fit per data page.  As the corresponding INSERT log record consists of the inserted value plus some overhead, this means that each INSERT will also use up a full log page.

 

 

To very rapidly use up space, I start with the single row inserted as above and then do recursive inserts:

 

 

insert mytable select * from mytable

go

 

Each time this is run, it doubles the number of rows in the table (and generates a corresponding number of log records).  This is much faster than inserting literal values, as ASE doesn't have to parse the inserted values, it is just copying blocks of memory from one page to another.

 

Repeating this insert 15 times ("go 15") generates 32768 pages of data and 32768 pages of log records (~128 MB assuming a 2k page size).


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>