Posts

Showing posts from January, 2012

Table Partitioning in SAP

When tables grow large, queries on the table will be slow. Index range scans, table scans, backups and restores will be slow. The most common characteristic of such tables is that the older entries in the table are seldom changed and updates happen on the newer entries. By partitioning the table, the older entries can be maintained in a seperate partion, thereby increasing performance--looking up for query results in a smaller set of data, parallel processing in different partitions, faster backups etc. Types of Partitions: Range Partition : This allows you to partition data by range of values. Example: 1st partition by column Date: Jan 01 2000 - Dec 31 2005; 2nd partition by column Date: Jan 01 2006 - Dec 31 2010 and 3rd partition by column Date: Jan 01 2011 - Dec 31 2015. List Partition : This allows you to maintain a list of values that constitute a partition. Ex: 1st partition by Plant: 5000; 2nd partition by Plant:6000. Hash Partition : A hash algorithm is used to distribu

Disabling File System Transports in PI

If you have configured CTS+ or CMS for XI/PI transports, you may want to disable file system based transport. In order to disable file based transports, follow these steps: Call open Exchange Profile from http://<server>:<port>/exchangeProfile Create the boolean parameters com.sap.aii.ibrep.core.transport.enableFileExport and com.sap.aii.ibdir.core.transport.enableFileExport under the directory com. Set the value as false or uncheck option in PI 7.3.

Database Locks

Locking is a mechanism to control concurrent access to data in order to maintain consistency. Lock requests are made to concurrency-control manager . Transaction can proceed only after the request for lock is approved. Data can be locked in e X clusive mode or S hared mode. When a transaction sets an exclusive mode, it can both read and alter it. Whereas a shared mode will only let the transaction to read the data. A transaction may be granted a lock on an item if the requested lock is compatible (see the compatibility matrix) with locks already held on the item by other transactions. For example if a request for an exclusive lock is made on data that is already locked, the request will not be approved until the existing lock (shared or exclusive) is removed. S X S TRUE FALSE X FALSE FALSE Table: Compatibility matrix The concurrency control manager records all the locks granted in a system table called the Lock table. Two transactions T1 and T2 enter a deadlock state whe

Part 3 UNIX Stream Editor: sed

This is the last part on sed. Part 1 and 2 can be found as linked.. Multiple lines in pattern space Using N for multiple pattern lines The instruction N appends a newline character to the pattern space and waits for the next line. When the next line is read, it appends the line to the pattern space. Finally the resulting pattern space is output. Check these examples to understand N instruction. [user9@localhost ~]$ sed 'N' this is a test the line is not immediately printed here this is a test the line is not immediately printed here [user9@localhost ~]$ sed 'N' 1 2 1 2 3 4 3 4 [user9@localhost ~]$ sed 'N > N' 1 2 3 1 2 3 4 5 6 4 5 6 Print (P), delete (D) up to first embedded new line The instruction P prints the first part of the pattern space up to first embedded newline character and D deletes the first part of the pattern space up to first embedded newline character. In the following example, the first line is rea

Part 2 UNIX Stream Editor: sed

This is a continuation of   Part 1 UNIX Stream Editor: sed . Print instruction p The instruction p prints the pattern space. In the following example, the lines are printed twice. Once by sed and once by the instruction p. [user9@localhost ~]$ sed 'p' /etc/passwd root:x:0:0:root:/root:/bin/bash root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin bin:x:1:1:bin:/bin:/sbin/nologin No print option -n In the above example, the lines were printed twice. You can use -n (no print) option to suppress the print by sed. The output is printed only if there is an instruction  to print (instruction p in this case) [user9@localhost ~]$ sed -n 'p' /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin Pattern matching Let's use -n and p to do a pattern match. You can use context addressing to find the pattern and instruction p to print the pattern space to achieve that. The result is si

Part 1 UNIX Stream Editor: sed

Image
Stream Editor is a utility to parse text line-by-line and edit. Here is how a stream editor works: The first line from the input is read into a buffer (known as pattern space). By default this buffer can hold one line at a time. sed applies the instructions in the pattern space. The changed pattern space is output and the buffer is cleared. The process repeats for all the lines provided as input Let's understand sed through examples Substitution  The following sed instruction reads input and replaces the first occurrence of root on each line with ROOT [user9@localhost ~]$ sed 's/root/ROOT/' this is root this is ROOT ROOT is root ROOT is ROOT beetroot beetroot root root root ROOT root root If you want to replace all occurences of root with ROOT use /g [user9@localhost ~]$ sed 's/root/ROOT/g' this is root this is ROOT root is root ROOT is ROOT every occurrence of root will be replaced by root every occurrence of ROOT will be re