久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術文章
文章詳情頁

如何加快ORACLE本地OCI的調用速度

瀏覽:5日期:2023-11-17 10:44:09
此文摘自 developers.sun.com 寫的很精采, 我自己試用了一下, 性能果然有所提高 developers.sun.com;;Technical Articles & Tips Cache OCI Calls to Improve Performance of 32-Bit or 64-Bit Oracle Clients By Nagendra Nagarajayya, October 2003;E-mail;;Printable Page;;Downloadend comment tag-->Contents:IntrodUCtion Identifying the Problem The Workaround: Cache oraus.msb in Memory Building cache_oraus.so How to Use cache_oraus.so How the Caching Works6.1;;Interposition of the open() Function Call6.2;;Interposition of the fcntl() Function Call6.3;;Interposition of the lseek(), read(), and close() Function Calls Performance Improvement7.1;;Without LD_PRELOAD and cache_oraus.so7.2;;With LD_PRELOAD and cache_oraus.soCaveat Conclusion Acknowledgments ReferencesA.;;Appendix: Test Programs and WrappersA1.;;READMEA2.;;cache_oraus.cA3.;;test.cA4.;;test.shA5.;;test1.shA6.;;test_v.cA7.;;test_v.shA8.;;c.shA9.;;c64.shA10.;;Cache_open_calls.c1. IntroductionIf you work with Oracle clients that make use of OCI (Oracle Call Interface), you may have noticed that the OCI driver in 8.1.7.x makes thousands of calls to translate messages from the oraus.msb file. This can degrade application performance by 5 percent or more (quite severely in some cases). This problem has been documented by Oracle under bug ID 2142623. The problem can be overcome by caching the oraus.msb file in memory, and translating the file Access and system calls to user calls and memory operations. The caching solution is dynamic, and code changes are not needed. The solution can improve the performance of the Oracle client application. Recently, this solution resulted in bringing down the application runtime from 15 minutes to a few seconds at a major customer – about 100x times performance improvement. The performance benefits can be seen in applications like sqlplus and Oracle clients (C and C++) making use of the OCI driver. Java technology-based applications using JDBC (native driver) should also see similar benefits. 2. Identifying the ProblemAn Oracle client application can be trussed on the Solaris Operating System (OS) to see the calls being made to this file -- 'truss' is a system utility available on the Solaris platform, and it can be used to trace system calls made by an application. A running Oracle client application can be trussed as follows: truss -p [oracle client pid]The truss command will show all the system calls being made by the application. The ones of interest are the open(), fcntl(), lseek(), read(), and close() calls. These calls are made by the OCI driver repeatedly to translate messages. Here is a truss snippet showing the problem calls: open('/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb', O_RDONLY) = 9fcntl(9, F_SETFD, 0x00000001) = 0lseek(9, 0, SEEK_SET) = 0read(9, '1513 '011303tt'.., 256) = 256lseek(9, 512, SEEK_SET) = 512read(9, '1C88 Y r ~ M'.., 512) = 512lseek(9, 1024, SEEK_SET) = 1024read(9, '18 $ 7 @ J V'.., 512) = 512lseek(9, 39936, SEEK_SET) = 39936read(9, 't0519 >051A'.., 512) = 512close(9)= 0These system calls can be eXPensive. The number of times these system calls are executed depends on the client application and the duration of the application run. 3. The Workaround: Cache oraus.msb in MemoryThe workaround is to cache the contents of the oraus.msb in memory and not make these system calls. This can be done dynamically by using the LD_PRELOAD technique available on the Solaris OE. (For further information, see the References section.) LD_PRELOAD is an environment variable on Solaris that allows shared libraries to be preloaded before an application begins execution. To make use of this technique, we need to build a shared library that will interpose on the open(), fcntl(), lseek(), read(), and close() calls. 4. Building cache_oraus.soThe shared library can be built with the Forte C compiler (now part of the Sun ONE Compiler Collection) using the following switches: 32-bit: cc -G -o cache_oraus.so -fast cache_oraus.c -l dl64-bit: cc -G -o cache_oraus.so -fast -xarch=v9a cache_oraus.c -l dl5. How to Use cache_oraus.soThe following environment variables need to be set to use the caching mechanism: export LD_PRELOAD=./cache_oraus.soexport oraus_msb_file=/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msbThis can be set in a shell script used to start the client application. 6. How the Caching WorksThe caching works by interposing the open(), fcntl(), lseek(), read(), and close() calls. The first time the application executes one of these calls, the control is first transferred to the interposed function code. 6.1 Interposition of the open() Function CallWhenever a file is opened, the control is transferred to the interposed open() from cache_oraus.so. The interposed open() checks to see if the file being opened is the oraus.msb (see STEP 3 in the following code example). If so, the file is opened, and memory mapped (STEP 5.1). The descriptor returned by open() is also cached. For all other opens, the control is transferred to the original libc.so (STEP 7). int open(const char *path, int oflag, mode_t mode) { static int(*fptr)() = 0; static char* msb_path;STEP 1 if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'open'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; }STEP 1.1 msb_path = (char*)getenv('oraus_msb_file'); }STEP 2 if (! msb_path) { msb_path = '/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb'; }STEP 3 if (strcmp(path, msb_path) == 0) {STEP 4 if (k_bm_fd == -1) { k_bm_fd = ((*fptr)(path, oflag, mode)); if (k_bm_fd <= 0) { perror(path); exit(1); }STEP 5 fstat(k_bm_fd, &k_bm_stat_buf);STEP 5.1 k_bm_buf = (char*)mmap((caddr_t) 0, k_bm_stat_buf.st_size, (PROT_READ), MAP_SHARED, k_bm_fd, 0); assert(k_bm_buf != MAP_FAILED); return k_bm_fd; } else {STEP 6 return k_bm_fd; } }STEP 7 return ((*fptr)(path, oflag, mode));}STEPSDescription1Use dlysym() to get a pointer to the original libc.so open() call, so that we can chain to it.1.1We use an environment variable, oraus_msb_file, to find the location of the oraus.msb file.2If this variable is not set, we use a default path.3We make sure the open call is related to the oraus_msb_file. For all other open calls, we chain to the original open() call.4We make sure this is the first time we are going through this code path as we want to map the file into memory only once. We open the file and cache the returned descriptor in k_bm_fd.5We get some information about the file itself, such as size.5.1The most important step: we map the file into memory.6We have already opened the file, and we return the cache descriptor.7For all other opens, the interpose gives control back to the original libc.so open() call. Table 1: open() Call 6.2 Interposition of the fcntl() Function CallA fcntl() call is made to change the file control parameters. The first time fcntl() is executed to change oraus.msb control parameters, the control is first transferred to the fcntl() in libc.so. The return value is cached, as well as returned back to the Oracle client (STEP 2). The next time fcntl() is executed, if the file descriptor matches the oraus.msb file descriptor, the cached return value is returned (STEP 3). The control is not transferred to fcntl() in libc.so. int fcntl(int fildes, int cmd, int arg) { static int ret; static int(*fptr)() = 0; char* path;STEP 1 if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'fcntl'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } }STEP 2 if (k_fcntl_bm_fd == -1) { if (fildes == k_bm_fd) { ret = ((*fptr)(fildes, cmd, arg)); k_fcntl_bm_fd = k_bm_fd; return ret }STEP 3 } else if (k_fcntl_bm_fd == fildes) { return ret; } STEP 4 return ((*fptr)(fildes, cmd, arg));}STEPSDescription1Use dlysym() to get a pointer to the original libc.so fcntl() call, so that we can chain to it.2We make sure this is the first time we are going through this code path as we want to execute fcntl() only once. We also make a copy of the open descriptor in k_fcntl_bm_fd.3If the fildes is equal to k_fcntl_bm_fd, then we just return the cached return value.4For all other opens, the interpose gives control back to the original libc.so fcntl() call.Table 2: fcntl() Call Back to Top 6.3 Interposition of the lseek(), read(), and close() Function CallsFor the lseek() call, if the file descriptor matches the cached oraus.msb file descriptor, the file offset is stored instead of calling the lseek() in libc.so (STEP L2). On a read() call, if the file descriptor matches the cached oraus.msb file descriptor, the file offset stored from the lseek() is used to index into the memory mapped oraus.msb data. A memcpy() is then executed (STEP R2). So an I/O call is now transformed to a simple memcpy() call. A close() on the cached file descriptor is ignored so that the cached file descriptor can be reused. off_t lseek(int fildes, off_t offset, int whence) { static off_t (*fptr)() = 0;STEP L1 if (fptr == 0) {fptr = (int (*)())dlsym(RTLD_NEXT, 'lseek'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } }STEP L2 if (fildes == k_bm_fd) { k_bm_offset = offset; return offset; }STEP L3 return ((*fptr)(fildes, offset, whence));}STEPSDescriptionL1Use dlysym() to get a pointer to the original libc.so lseek() call, so that we can chain to it. L2If the fildes is equal to k_bm_fd, then we keep track of the k_bm_offset so that we access this memory location. L3For all other opens, the interpose gives control back to the original libc.so lseek() call. Table 3: lseek() Call ssize_t read(int fildes, void *buf, size_t nbyte) { static ssize_t (*fptr)() = 0;STEP R1 if (fptr == 0) { fptr = (ssize_t (*)())dlsym(RTLD_NEXT, 'read'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %sn', dlerror()); return (0); } }STEP R2 if (fildes == k_bm_fd) { memcpy(buf, k_bm_buf+k_bm_offset, nbyte); return nbyte; }STEP R3 return ((*fptr)(fildes, buf, nbyte));}STEPSDescriptionR1Use dlysym() to get a pointer to the original libc.so read() call, so that we can chain to it.R2If the fildes is equal to k_bm_fd, then we use the stored k_bm_offset to access the right memory location, and do a memcpy().R3For all other opens, the interpose gives control back to the original libc.so read() call.Table 4: read() Call int close(int fildes) { static int(*fptr)() = 0;STEP C1 if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'close'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } }STEP C2 if (fildes == k_bm_fd) { return 0; }STEP C3 return ((*fptr)(fildes));}STEPSDescriptionC1Use dlysym() to get a pointer to the original libc.so close() call, so that we can chain to it.C2If the fildes is equal to k_bm_fd, then we justreturn 0 to signal a successful close, but without closing the file.C3For all other opens, the interpose gives control back to the originallibc.so close() call.Table 5: close() Call Back to Top 7. Performance ImprovementThe performance improvement comes from not executing the system calls. The multiple instances of open(),fcntl(),lseek(), read(), and close() to read the oraus.msb messages are transformed to user-level calls. Also, the I/O operation becomes a simple memory-to-memory transfer. To measure the performance gains, a test program mimicking an Oracle client's behavior was developed. The test program performs open(),lseek(), read(), and close() calls on the oraus.msb file 50,000 times. The test program showed a gain of about 1000%. However, in a real Oracle client application, this might translate to about a 2 percent-to-15 percent gain in performance. 7.1 Without LD_PRELOAD and cache_oraus.soTypeTime in SecondsReal5.633User0.010Sys0.014Table 6: ptime test.sh Back to Top 7.2 With LD_PRELOAD and cache_oraus.soTypeTime in SecondsReal0.462User0.010Sys0.013Table 7: ptime test.sh 8. CaveatThe preceding code is not multithreaded. For Oracle clients that are multithreaded, the write access to the cache variables needs to be mutex protected or synchronized. 9. ConclusionCaching the file oraus.msb in memory improves the performance of Oracle clients. Even though the performance gain observed in the test program is about 1000 percent, the gain when running a really big Oracle client application might not be more than 2 to 15 percent, due to other I/O contentions. This gain can be achieved without any code changes to the client application. 10. AcknowledgmentsI would like to thank Teresa Riege (Sun) and Thomas Yen (Kenan/BP billing platform, CSG Systems) for their contributions and help in testing this utility during the 2002 Kenan/BP study (see related article listed in References). I would also like to thank my colleagues at MDE (IPE) for supporting me during this project. I would like also to thank Ben Humphreys, technical support specialist, Sun, who made the 64-bit modifications to the code. 11. ReferencesNagendra Nagarajayya, S.R. Venkatramanan, 'Fast Sockets, An Interprocess Communication Library to Boost Application Performance' Sun Product Documentation site Oracle MetaLink (for news, problems, and bugs) CSG Kenan/BP Exceeds Billing Needs of Largest Telecom Service Providers in Scalability Test Appendix: Test Programs and WrappersThe Sample Code is being made available by Sun merely as a convenience to you. The Sample Code below is provided 'AS IS.' Sun makes no warranties of any kind whatsoever with respect to the Sample Code. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY WARRANTY OF NON-INFRINGEMENT OR IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE HEREBY DISCLAIMED AND EXCLUDED TO THE EXTENT ALLOWED BY APPLICABLE LAW. IN NO EVENT WILL SUN BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE THE SAMPLE CODE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. A1. README** Oct 02, 03* Nagendra Nagarajayya* MDE/IPE(CSI)* Sun Microsystems, Inc *set LD_PRELOAD within a wrapper to cache_oraus.so, and specifythe path to the oraus.msb file using the ENV variable, 'oraus_msb_file'.If the env is not specified, the following path is used,/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb.WARNING: The solution presented does not support multi-threaded clients, but should be very easy to do so. BTW, it could work as it is with MT threaded clients, but has not been tested.Example:export LD_PRELOAD=./cache_oraus.soexport oraus_msb_file=/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msbNote: cache_open_calls.c is similar to cache_oraus.c but caches only the open calls. It does not memory map the oraus.msb file.Compilation instructions:-------------------------Use the wrapper c.sh to compile cache_oraus.c. c.sh also compiles cache_open_calls.c, and the test programs. Use c64.sh to compile cache_oraus.c for 64 bit support.To test the library:--------------------Use, ptime test.sh, and ptime test1.sh.To verify if the library is reading the contents properly,use test_v.sh, and test_v.cA2. Cache_oraus.c/*Date: April 18, 2002Author: Nagendra NagarajayyaMDE/IPE/CSISun Microsystems, Inc.Date: October 02, 2003 Ben Humphreys Technical Support Specialist Sun Microsystems, Inc. Descr: made changes to source for 64 bit support Description: This caches oraus.msb file in memory and transforms I/O calls to the file to a read access.*//* The Sample Code is being made available by Sun merely as a convenience to you. The Sample Code below is provided 'AS IS.' Sun makes no warranties of any kind whatsoever with respect to the Sample Code. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY WARRANTY OF NON-INFRINGEMENT OR IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE HEREBY DISCLAIMED AND EXCLUDED TO THE EXTENT ALLOWED BY APPLICABLE LAW. IN NO EVENT WILL SUN BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE THE SAMPLE CODE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <dlfcn.h>#include <sys/types.h>#include <sys/stat.h>#include <assert.h>#include <sys/mman.h>#include <sys/int_types.h>static int k_fcntl_bm_fd = -1;static int k_bm_fd = -1;static int k_bm_offset = 0;static char* k_bm_buf ;static struct stat k_bm_stat_buf ;int fcntl(int fildes, int cmd, intptr_t arg) { static int ret; static ssize_t(*fptr)() = 0; char* path; if (fptr == 0) { fptr = (ssize_t (*)())dlsym(RTLD_NXT, 'fcntl'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } } if (k_fcntl_bm_fd == -1) { if (fildes == k_bm_fd) { ret = ((*fptr)(fildes, cmd, arg)); k_fcntl_bm_fd = k_bm_fd; return ret } } else if (k_fcntl_bm_fd == fildes) { return ret; } return ((*fptr)(fildes, cmd, arg));}off_t lseek(int fildes, off_t offset, int whence) { static off_t(*fptr)() = 0; if (fptr == 0) {fptr = (off_t (*)())dlsym(RTLD_NEXT, 'lseek'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } } if (fildes == k_bm_fd) { k_bm_offset = offset; return offset; }/* fprintf(stderr, 'offset=%d k_bm_offset=%dn', offset, k_bm_offset);*/ return ((*fptr)(fildes, offset, whence));}ssize_t read(int fildes, void *buf, size_t nbyte) { static ssize_t(*fptr)() = 0; if (fptr == 0) { fptr = (ssize_t (*)())dlsym(RTLD_NEXT, 'read'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %sn', dlerror()); return (0); } }/* fprintf(stderr, 'fildes = %d k_bm_fd = %d n', fildes, k_bm_fd);*/ if (fildes == k_bm_fd) { memcpy(buf, k_bm_buf+k_bm_offset, nbyte); return nbyte; } return ((*fptr)(fildes, buf, nbyte));}int open(const char *path, int oflag, mode_t mode) { static char* msb_path;static int(*fptr)() = 0; if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'open'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } msb_path = (char*)getenv('oraus_msb_file'); } if (! msb_path) { msb_path = '/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb'; } if (strcmp(path, msb_path) == 0) { if (k_bm_fd == -1) { k_bm_fd = ((*fptr)(path, oflag, mode)); if (k_bm_fd <= 0) { perror(path); exit(1); } fstat(k_bm_fd, &k_bm_stat_buf);/* fprintf(stderr, 'open the file %dn',k_bm_fd);*/ k_bm_buf = (char*)mmap((caddr_t) 0, k_bm_stat_buf.st_size, (PROT_READ),MAP_SHARED, k_bm_fd, 0); assert(k_bm_buf != MAP_FAILED); return k_bm_fd; } else { /* fprintf(stderr, 're-open the file %dn',k_bm_fd); */ return k_bm_fd; } } return ((*fptr)(path, oflag, mode));}int close(int fildes) {static int(*fptr)() = 0; if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'close'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } } if (fildes == k_bm_fd) {/* fprintf(stderr, 'close the file %dn',k_bm_fd);*/ return 0; } return ((*fptr)(fildes));}See README file for details on how to compile this program, and the environment needed to execute the Oracle client program. Appendixes A3-A6 explain a little more about the test programs.A3. test.cThis test program reads the oraus.msb file 50,000 times to mimic Oracle client application behavior. #include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <string.h>int fd = 0;int fd1 = 0;char buf[1024];char buf1[1024];int x1 = 0;int x2 = 0;int x3 = 0;int x4 = 0;int x5 = 0;int main() { int i; int r=-1; for (i=0; i<50000; i++) { fd = open('/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb', O_RDONLY);/* fd1 = open('/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb_1', O_RDONLY);*//* fprintf(stderr, 'fd = %d fd1 = %d n', fd, fd1);*/ r = fcntl(fd, F_SETFD); lseek(fd, 0, SEEK_SET); read(fd, &buf, 256);/* r = fcntl(fd1, F_SETFD); lseek(fd1, 0, SEEK_SET); read(fd1, &buf1, 256); x1 = memcmp(&buf1, &buf, 256); if (x1 != 0 ) { fprintf(stderr, 'x1 did not mach %dn', x1); }*/ lseek(fd, 512, SEEK_SET); read(fd, &buf, 512);/* lseek(fd1, 512, SEEK_SET); read(fd1, &buf1, 512); x2 = memcmp(&buf1, &buf, 512); if (x2 != 0 ) { fprintf(stderr, 'x2 did not mach %d n', x2); }*/ lseek(fd, 1024, SEEK_SET); read(fd, &buf, 512);/* lseek(fd1, 1024, SEEK_SET); read(fd1, &buf1, 512); x3 = memcmp(&buf1, &buf, 512); if (x3 != 0 ) { fprintf(stderr, 'x3 did not mach n'); }*/ lseek(fd, 39936, SEEK_SET); read(fd, &buf, 512);/* lseek(fd1, 39936, SEEK_SET); read(fd1, &buf1, 512); x4 = memcmp(&buf1, &buf, 512); if (x4 != 0 ) { fprintf(stderr, 'x4 did not mach n'); }*/ close(fd); /* close(fd1);*/ } }A4. test.shThis is a wrapper to execute the test program to show the performance gains of caching the contents of oraus.msb in memory. The LD_PRELOAD and oraus_msb_file environment variables point to cache_oraus.so and the oraus.msb file. #! /bin/bashexport oraus_msb_file=/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msbexport LD_PRELOAD=/usr/lib/cache_oraus.soexport LD_PRELOAD=./cache_oraus.sotime ./testA5. test1.shThis is a wrapper to execute the test program without the caching mechanism. #!/bin/bashtime ./testA6. test_v.cThis program was used to verify that the interposed calls work properly. #include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <string.h>int fd = 0;int fd1 = 0;char buf[1024];char buf1[1024];int x1 = 0;int x2 = 0;int x3 = 0;int x4 = 0;int x5 = 0;int main() { int i; int r=-1; for (i=0; i<50000; i++) { fd = open('/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb', O_RDONLY); fd1 = open('/ora/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb_1', O_RDONLY);/* fprintf(stderr, 'fd = %d fd1 = %d n', fd, fd1);*/ r = fcntl(fd, F_SETFD); lseek(fd, 0, SEEK_SET); read(fd, &buf, 256); r = fcntl(fd1, F_SETFD); lseek(fd1, 0, SEEK_SET); read(fd1, &buf1, 256); x1 = memcmp(&buf1, &buf, 256); if (x1 != 0 ) { fprintf(stderr, 'x1 did not mach %dn', x1); } lseek(fd, 512, SEEK_SET); read(fd, &buf, 512); lseek(fd1, 512, SEEK_SET); read(fd1, &buf1, 512); x2 = memcmp(&buf1, &buf, 512); if (x2 != 0 ) { fprintf(stderr, 'x2 did not mach %d n', x2); } lseek(fd, 1024, SEEK_SET); read(fd, &buf, 512); lseek(fd1, 1024, SEEK_SET); read(fd1, &buf1, 512); x3 = memcmp(&buf1, &buf, 512); if (x3 != 0 ) { fprintf(stderr, 'x3 did not mach n'); } lseek(fd, 39936, SEEK_SET); read(fd, &buf, 512); lseek(fd1, 39936, SEEK_SET); read(fd1, &buf1, 512); x4 = memcmp(&buf1, &buf, 512); if (x4 != 0 ) { fprintf(stderr, 'x4 did not mach n'); } close(fd); close(fd1); } }A7. test_v.shThis is a wrapper for testing test_v.c. #!/bin/bashexport LD_PRELOAD=/usr/lib/cache_oraus.soexport LD_PRELOAD=./cache_oraus.sotime ./test_vA8. c.sh#!/bin/bashPATH=/opt/SUNWspro/bin/:$PATHexport PATH;cc -fast -xarch=v8plusa -xdepend -xvector -xstrconst -xprefetch -G -o cache_open_calls.so cache_open_calls.c -ldlcc -fast -xdepend -xvector -xstrconst -xarch=v8plusa -xprefetch -G -o cache_oraus.so cache_oraus.c -ldlcc -fast -xstrconst -xvector -xdepend -xarch=v8plusa -xprefetch -o test test.c -ldlcc -fast -xstrconst -xvector -xdepend -xarch=v8plusa -xprefetch -o test_v test_v.c -ldl A9. c64.sh#!/bin/bash# Changes to source cache_oraus.c for 64 bit support was made # by Ben Humphreys PATH=/opt/SUNWspro/bin/:$PATHexport PATH;cc -fast -xarch=v9a -xcode=abs64 -xdepend -xvector -xstrconst -xprefetch -G -o cache_open_calls.so cache_open_calls.c -ldlcc -fast -xarch=v9a -xcode=abs64 -xdepend -xvector -xstrconst -xprefetch -G -o cache_oraus.so cache_oraus.c -ldlcc -fast -xarch=v9a -xcode=abs64 -xstrconst -xvector -xdepend -xprefetch -o test test.c -ldlcc -fast -xarch=v9a -xcode=abs64 -xstrconst -xvector -xdepend -xprefetch -o test_v test_v.c -ldl < name=A10> A10. Cache_open_calls.c/* Date: April 18, 02 Author: Nagendra Nagarajayya Description: Caches open, and close calls to oraus.msb file */#include <stdio.h>#include <unistd.h>#include <dlfcn.h>#include <string.h>#include <stdlib.h>static int k_bm_fd = -1;int open(const char *path, int oflag, mode_t mode) { static int (*fptr)() = 0; if (fptr == 0) {fptr = (int (*)())dlsym(RTLD_NEXT, 'open'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } } if (strcmp(path, '/oracle/app/oracle/product/8.1.7/rdbms/mesg/oraus.msb') == 0) { if (k_bm_fd == -1) { k_bm_fd = ((*fptr)(path, oflag, mode)); if (k_bm_fd <= 0) { perror(path); exit(1); } /* fstat(k_bm_fd, &k_bm_stat_buf); fprintf(stderr, 'open the file %dn',k_bm_fd);*/ return k_bm_fd; } else { /* fprintf(stderr, 're-open the file %dn',k_bm_fd); */ return k_bm_fd; } } return ((*fptr)(path, oflag, mode));}int close(int fildes) { static int (*fptr)() = 0; if (fptr == 0) { fptr = (int (*)())dlsym(RTLD_NEXT, 'close'); if (fptr == NULL) { fprintf(stderr, 'dlopen: %s n', dlerror()); return 0; } } if (fildes == k_bm_fd) {/* fprintf(stderr, 'close the file %dn',k_bm_fd);*/ return 0; } return ((*fptr)(fildes));}About the AuthorNagendra Nagarajayya has been at Sun for more than 9 years. A Staff Engineer in Market Development Engineering (MDE/IPE), he works with telco ISVs on architecture, performance tuning, sizing and scaling, benchmarking, porting, and so on. His interests include multithreading, concurrency and parallelism, HA, distributed computing, networking, and the Java and Solaris platforms.
標簽: Oracle 數據庫
主站蜘蛛池模板: 美女黄网| 日韩欧美二区 | 色小妹三区 | 在线亚洲成人 | 久久久久久久99精品免费观看 | 精品无人乱码一区二区三区 | 欧美日韩视频在线第一区 | 成人免费视频视频 | 亚洲性人人天天夜夜摸 | 国产99久久精品 | 欧美综合久久 | 国产毛片在线 | 久久一区二区三区四区 | 日韩视频一区二区三区四区 | 国产无区一区二区三麻豆 | 一区二区中文字幕 | 一区二区在线 | 九色网址 | 一级全毛片| 日日摸日日碰夜夜爽不卡dvd | 精品国产欧美一区二区三区成人 | 久久精品一区 | 一级片av| 老汉色影院 | 一区二区三区免费 | 91福利视频导航 | 欧美视频二区 | 天天澡天天狠天天天做 | 久久99er6热线精品首页蜜臀 | 国产精品精品 | 台湾佬亚洲色图 | 午夜影院在线 | 一区二区免费在线 | 亚洲成人精品在线观看 | 91久久久久久久久久久久久 | 国产一区二区在线播放 | 精品国产青草久久久久福利 | 国产精品美女久久久久久久网站 | 精品国产成人 | 日韩在线免费 | 欧美色视频在线观看 | 99成人精品 | www.日本三级 | 在线一区观看 | 亚洲乱码一区二区 | 亚洲一区二区视频在线观看 | 美女黄视频网站 | 国产精品二区三区 | 精品久久一区二区三区 | 成年视频在线观看福利资源 | 岛国av免费观看 | 免费国产一区二区 | 亚洲精品二区 | 国产老女人精品毛片久久 | 成人免费在线视频观看 | caoporn视频 | 成人网18免费网站 | 国产亚洲精品成人av久久影院 | 午夜在线小视频 | √新版天堂资源在线资源 | segui88久久综合9999 | 一区二区三区在线 | 一区二区视频免费 | segui88久久综合9999 | 欧美日韩精品久久久久 | 午夜电影福利 | 国产人免费人成免费视频 | 日韩精品一区二区三区第95 | 色黄视频在线观看 | 日本一区二区成人 | 一区二区三区国产好的精 | 激情久久av一区av二区av三区 | 四虎永久 | 午夜精品久久久久久久99黑人 | 在线成人一区 | 国产精品99久久久久久久vr | 成人久久18免费观看 | 午夜精品一区二区三区在线播放 | 久久天天躁狠狠躁夜夜躁2014 | 久久久久久久99精品免费观看 | 欧美日韩国产精品久久久久 | 久久小视频 | 精品国产污网站污在线观看15 | 日韩在线视频精品 | 欧美一区二区三区 | 黄色片毛片 | 日韩欧美在线一区 | 日韩免费av | 成人午夜sm精品久久久久久久 | 日本狠狠色| 久久欧美视频 | 综合 欧美 亚洲日本 | 色伊人久久 | 国产美女精品 | 亚洲成人中文字幕 | 国产精品夜色一区二区三区 | 欧美精品在线一区 | 91久久久久久久久久久久久 | 欧美一区二区伦理片 | 北条麻妃一区二区免费播放 | 日韩精品观看 | 美女一级 | 黄色直接看 | 久久久精品区 | 久久久精品日本 | 欧美一区二区三区精品 | 久久精品国产亚洲精品 | 欧美一区二区三区在线视频 | 99成人精品 | 国产精品视频久久久 | 日韩看片 | 91高清视频在线观看 | 久久久精品 | 香蕉久久一区二区不卡无毒影院 | 成人免费视频视频 | 亚洲国产精品一区二区第一页 | 国产精品久久久久久久久久99 | 精品欧美乱码久久久久久 | 久久久久久久国产 | 不卡视频一区 | 在线观看亚洲大片短视频 | 欧美性猛交一区二区三区精品 | 青青草在线免费视频 | 亚洲成人免费观看 | 99久久99久久精品国产片果冻 | 99re国产 | 欧美日韩久久久 | 最新免费av网站 | 91九色麻豆 | 久久综合久久综合久久综合 | a在线观看 | 日韩午夜在线 | 日本三级在线观看网站 | 欧洲毛片 | av一二三四 | 亚洲成人一区二区 | 精品日韩一区二区 | 亚洲精品一区二区在线 | 欧美日韩在线播放 | 精品一区二区三区免费看 | 操视频网站 | 亚洲视频自拍 | 亚洲成人一区二区三区 | 久久久国产精品 | 综合色九九 | 亚洲黄色片免费 | 蜜臀在线视频 | 最新伦理片 | 久久成人一区二区 | 日日噜 | 夜夜av| 欧美在线一级 | 激情小说综合网 | 亚洲一区视频 | 国产亚洲一区二区三区 | 午夜影视免费观看 | 成人免费一区二区三区视频软件 | 亚洲激情久久 | 特级丰满少妇一级aaaa爱毛片 | 91一区二区 | 成人午夜在线观看 | 久久这里只有精品首页 | 波多野吉衣网站 | 在线中文字幕视频 | 操操日 | 69热在线观看 | 在线看91 | 国产福利精品一区 | 日韩国产精品视频 | 天堂av一区二区 | 麻豆精品国产传媒 | 躁躁躁日躁夜夜躁 | 久久久一区二区三区 | 国产电影一区二区 | 午夜精品视频在线观看 | 日韩综合 | 天天干天天操 | 羞羞视频免费观看网站 | 羞羞视频在线观免费观看 | 男女视频在线免费观看 | 国产精品久久婷婷六月丁香 | 久久久久久久久久久久久久久久久久久 | 成人av片在线观看 | 亚洲久久 | 亚洲欧美日韩天堂 | 欧美一区二区三区免费在线观看 | 午夜一区二区三区在线观看 | 午夜免费福利影院 | 国产精品成人在线观看 | 美女扒开内裤让男人桶 | 午夜电影网址 | 国产亚洲在线 | 久久久精品 | 91精品在线播放 | 久久久久国产一区二区三区 | 一级在线看 | 羞羞视频网站在线看 | 国产亚洲欧美在线 | 欧美日韩在线免费 | 久久精品中文字幕一区 | av黄色一级片 | 午夜视频网址 | 求av网址 | 无码日韩精品一区二区免费 | 亚洲精品视频免费看 | 成人免费视频网站在线观看 | 国产成人综合在线 | 四虎最新入口 | 天天操天天玩 | 国产综合亚洲精品一区二 | 午夜精品久久久久久久男人的天堂 | 久久伊| 国产高清在线精品一区二区三区 | 男女深夜视频 | 99久久久国产精品 | 亚洲日本韩国在线观看 | 特级黄一级播放 | 香蕉久久久 | 久久久一区二区三区 | 高清一区二区 | 二区视频| av网站在线免费观看 | 羞羞视频网站 | 最近中文字幕免费观看 | 日韩中文字幕电影在线观看 | 免费黄色大片 | 岛国av一区 | 亚洲综合视频 | 欧美乱操 | 国产欧美日本 | 日韩视频欧美视频 | 50人群体交乱视频 | 狠狠狠干 | 亚洲一区久久久 | 日韩在线免费 | 最近免费中文字幕在线视频2 | 国产免费黄色大片 | 成人在线观看免费视频 | 亚洲成年 | 日韩五月 | 91精品国产综合久久久亚洲 | 国产一区在线视频 | 欧美日韩免费看 | 久久精品成人 | 精品福利在线视频 | 密色视频| 国产一级黄片毛片 | 亚洲欧美高清 | 97高清国语自产拍 | 国产精品久久久久久久久久久免费看 | 91精品视频一区 | 国产一区二区三区色淫影院 | 久久久久国产精品视频 | 国产精品一码二码三码在线 | 不卡一区| 99在线看 | 国产精品视频入口 | 国产欧美在线观看 | 亚洲自拍在线观看 | 伊人婷婷 | 黄色短视频在线观看 | 亚洲精品一区二三区不卡 | 欧美高清视频一区二区三区 | 九九综合| 欧美三级视频 | 日韩三级电影免费观看 | 亚洲国产在 | 国产成人精品一区二区三区四区 | 日韩在线观看一区二区 | 国产福利视频 | 精品在线不卡 | 青青草在线免费视频 | 蜜桃视频成人m3u8 | 91精产国品一二三区在线观看 | 日本男人的天堂 | 婷婷色av| 欧美日韩精品久久久久 | 国产成人久久精品一区二区三区 | 亚洲精品成人 | 国产一二在线 | 午夜爱视频 | 国产精品久久久久久一区二区三区 | 久久久久国产一区二区三区四区 | 天天舔天天干天天操 | 国产在线在线 | 国产欧美精品一区二区三区 | 日韩电影a | 国产成人精品午夜 | 亚洲精品久久久久久久久久久久久 | 国产一区二区三区久久久 | 狠狠干狠狠干 | av亚洲在线 | 日韩免费一级 | 91亚洲一区 | 久久久精品久久久 | 久久人人爽人人爽人人片亚洲 | 欧美性猛交xxxx黑人猛交 | 亚洲一区二区三区在线观看免费 | 天堂成人国产精品一区 | 久久青青 | 成人影院在线 | 久久爱综合网 | 欧美福利视频 | 久久久久久九九九九九九 | 99九九久久 | 一区二区三区精品视频免费看 | 国产一区二区三区久久久 | av免费网站 | 一区二区av | a视频在线观看免费 | 羞羞av在线 | 亚洲福利社区 | 剑来在线观看 | 国产色视频网站 | 欧美一级一 | 久久国产精品一区二区三区 | 日韩av一区二区三区在线观看 | 国产亚洲精品精品国产亚洲综合 | av在线视| 91av在线播放 | 欧美精品亚洲精品 | 91色在线观看 | 日韩成人在线一区 | 中文字幕_第2页_高清免费在线 | 亚洲精品一区二区在线观看 | 欧洲一区在线 | 99精品视频在线 | 亚洲欧美国产精品久久 | 日韩中文字幕av在线 | 国产一区二精品区在线 | 国产成人精品一区二区三区视频 | 国产偷久久9977 | 成人免费在线网址 | 国产在线一二 | 国产精品伦理 | 99亚洲| 日本欧美在线 | 伊人色综合久久天天五月婷 | 亚洲午夜在线 | 精品一区二区三区久久久 | 人一级毛片| 久久久亚洲一区二区三区 | 国产a区| 欧美日韩专区 | 亚洲综合欧美日韩 | 国产精品免费看 | 国产不卡免费视频 | 天天爱爱网 | av中文网 | 国产精品第一区 | 久久久亚洲 | 在线观看免费视频a | 成人精品在线视频 | 日韩av在线一区 | 精品国产乱码一区二区三区a | 青青草视频免费观看 | 日日操视频| 中文字幕在线观看 | 一区二区三区在线不卡 | 亚洲xx站 | 国产一区二区视频在线观看 | 色伊人| 欧洲亚洲视频 | 国产成人久久精品一区二区三区 | 欧美全黄| 国产电影一区二区 | 国产资源视频在线观看 | 午夜精品久久久久久久久 | 在线观看国产视频 | 91视频在线免费观看 | 毛片在线免费 | 日韩一区二区在线视频 | 免费一区二区三区 | 国产一区在线看 | 精品久久久久一区二区三区 | 久久午夜影院 | 色伊人网 | 久久久精品影院 | 拍拍无遮挡人做人爱视频免费观看 | 91精品国产综合久久香蕉922 | 久久久精品一区二区 | 激情图区在线观看 | 欧美成人a∨高清免费观看 在线视频成人 | 美日韩一区二区 | 中文字幕亚洲精品 | 97在线超碰 | 久久99精品国产99久久6尤 | 日韩一区三区 | 亚洲国产中文字幕 | 亚洲综合在线视频 | 中文字幕高清视频 | 亚洲一区二区三区四区五区中文 | 亚洲成a人| 天天干人人| 国精品一区二区三区 | 色无欲天天天影视综合网 | 成人午夜精品久久久久久久蜜臀 | 国产一区二区在线免费观看 | 久久久一| h视频在线免费观看 | 午夜男人的天堂 | 精品久久久久久久久久久久 | 99国产精品 | 国产日韩免费视频 | 欧美一级片在线观看 | 天天干夜操 | 美女视频黄又黄又免费 | 亚洲欧美中文日韩v在线观看 | 97超碰站 | 成人在线免费电影 | 久久夜视频 | 天天干天天操 | 亚洲高清视频在线观看 | 91极品在线 | 欧美激情高清 | 96自拍视频 | 在线视频成人 | 国产中文字幕一区 | 婷婷毛片| 奇米影视7777 | 国产一区二区三区久久久 | 国产一区影院 | 99久久日韩精品视频免费在线观看 | 欧美日韩国产在线观看 | 欧美日韩国产综合视频 | 亚洲成人日本 | 一区精品视频 | 国产精品久久久久久婷婷天堂 | 日韩爱爱视频 | 精品久 | 久久成人免费视频 | 久久人体 | 国产一区二区三区免费视频 | 精品久久中文字幕 | 视频一区二区三区在线观看 | 欧美一区二区三区视频在线观看 | 日韩av成人 | 一级特黄网站 | 亚洲一区二区三区在线 | 五月激情综合 | 国产精品久久久爽爽爽麻豆色哟哟 | 美欧一级片 | 成人美女免费网站视频 | 国产成人在线免费观看 | 国产精品久久国产精品 | 国产成人不卡 | 国产精品成人国产乱一区 | 亚洲视频一区二区三区 | 国产欧美精品一区二区 | 视频一区在线 | 一区二区三区久久 | 精品九九久久 | 四季久久免费一区二区三区四区 | 中文字幕亚洲二区 | a级毛片久久 | 亚洲精品视频在线观看免费视频 | 国产精品不卡 | 国产中文在线播放 | 亚洲视频免费 | 91久久国产综合久久 | 成人黄色免费 | 一本一道久久精品综合 | 在线观看成人网 | 人人99| 国产一级免费在线观看 | 91麻豆精品国产91久久久更新时间 | 久久精品a一级国产免视看成人 | 免费成人在线网站 | 毛片免费观看 | 免费av播放| 亚洲www视频 | 欧美一区免费 | 黄色国产| 日韩精品视频免费专区在线播放 | 成人午夜精品久久久久久久3d | 青青久久 | 国产精品久久久久久久久久久久久久 | 91精品久久久久久久久久 | 久久人人爽人人爽 | 日韩一区免费在线观看 | 国产一区91 | 美日韩一区二区三区 | 精品欧美一区二区三区久久久 | 不卡一区| 久久亚洲精品视频 | 精品久久久久久国产 | 成人无遮挡毛片免费看 | 中文字幕一区二区在线观看 | 成人高清在线 | 天天摸天天摸 | 国产精品免费一区二区三区四区 | 欧美精品一区二区三区在线播放 | 黄色片免费 | 国产1区在线观看 | 国产四区 | 日本日韩中文字幕 | 国产成人精品一区二区视频免费 | 国产精品久久久久久久久久99 | 妞干网av | 国产三级在线播放 | 久久国产精品影视 | 50人群体交乱视频 | 欧美午夜在线观看 | 艹逼逼视频 | 中文av一区 | 成人做爰9片免费视频 | 一区二区三 | 午夜精品久久久 | 不用播放器的毛片 | 久久国产精品免费一区二区三区 | 久草电影网 | 精品av| 国产高清在线精品一区二区三区 | 草久在线视频 | 欧美1区2区3区 | 精品国产乱码久久久久久久软件 | 日韩在线不卡 | 国产日韩欧美一区二区 | 成人在线观看中文字幕 | 亚洲第一天堂无码专区 | 五月婷婷综合久久 | 激情开心成人网 | 久久久精品网 | 国产精品综合 | 天天拍天天干天天操 | 毛片99 | 精品免费国产 | 一级片av| 国产第一亚洲 | 欧美久久久久久 | 日韩一区二区在线电影 | 亚洲精品久久一区二区三区 | 这里有精品在线视频 | 97国产一区二区精品久久呦 | 国产精品成人国产乱一区 | 成人免费视频在线观看 | 福利二区 | 久久久久国产精品www | 日韩三区 | 欧美日韩精品一区二区三区 | 国产精品一区二区三区免费 | www久久久 | 日韩三级在线免费观看 | 波多野结衣一区二区三区高清 | 欧美一级片在线 | 99久久99久久久精品色圆 | 成人av播放 | 日韩综合一区 | 成人在线免费网站 | 精品乱子伦一区二区三区 | 色偷偷噜噜噜亚洲男人 | 欧美激情一区二区三级高清视频 | 日韩欧美精品区 | 亚洲一区二区三区在线视频 | 精品福利av导航 | 日本久久久一区二区三区 | 国产精品一区2区 | 精品中文字幕一区二区三区 | 午夜国产一区 | 日韩一区二区三区在线观看 | 卡通动漫第一页 | 久久777| 韩国电影久久影院 | 欧美日韩大陆 | 蜜桃视频成人m3u8 | 日本妇人成熟免费视频 | 91免费在线看 | 中文字幕一区二区三区四区不卡 | 午夜精品久久久久久久久久久久 | 日韩欧美国产精品一区二区三区 | 欧美九九九 | 日韩精品一区二区三区在线 | 午夜精品一区二区三区免费视频 | 1区2区视频| 综合五月网 | 久久久久久久一区二区三区 | 51国产午夜精品免费视频 | 欧美日本一区 | 成人欧美一区二区三区在线观看 | 天天干人人 | 成人精品一区 | 亚洲国产成人av | 久久精品99国产精品日本 | 亚洲综合在线一区 | 伊人网网站 | av日韩一区| 一级a性色生活片久久毛片明星 | 99视频免费在线观看 | 日韩欧美成人一区二区三区 | 91久久久久久久久久久久久久 | 国产精品国产三级国产aⅴ中文 | 精品在线一区二区三区 | 午夜精品一区二区三区在线视频 | 一级毛片网 | 日本不卡高字幕在线2019 | 免费成人毛片 | 99精品国产高清一区二区麻豆 | 亚洲视频在线免费观看 | 欧美色图亚洲自拍 | 国产精品主播 | 久久一区 | 国产激情精品视频 | 精品久久一区 | 日本三级中文在线电影 | 国产成人在线一区二区 | 超碰3 | 日韩av在线不卡 | 夜夜骑天天射 | 91社区在线观看 | 青青草综合在线 | 奇米影视奇米色777欧美 | 一区二区免费在线播放 | 国产精品免费看 | 久久国产精品电影 | 欧美日韩国产综合在线 |