I/O Calibration -测试数据库性能

测试数据库系统性能步骤如下:

oracle@mmpt-SRJ:~> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue May 8 08:22:51 2018

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> 
SQL> 
SQL> startup
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size                  2217464 bytes
Variable Size             499124744 bytes
Database Buffers          281018368 bytes
Redo Buffers                2637824 bytes
Database mounted.
Database opened.
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> 
SQL> 
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    lat  INTEGER;
  3    iops INTEGER;
  4    mbps INTEGER;
  5  BEGIN
  6  -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (<DISKS>, <MAX_LATENCY>, iops, mbps, lat);
  7     DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);
  8   
  9    DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
 10    DBMS_OUTPUT.PUT_LINE ('latency  = ' || lat);
 11    dbms_output.put_line('max_mbps = ' || mbps);
 12  end;
 13  /
DECLARE
*
ERROR at line 1:
ORA-56708: Could not find any datafiles with asynchronous i/o capability
ORA-06512: at "SYS.DBMS_RMIN", line 456
ORA-06512: at "SYS.DBMS_RESOURCE_MANAGER", line 1285
ORA-06512: at line 7

SQL> show parameter filesystem

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      none
SQL> alter system set filesystemio_options=setall scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size                  2217464 bytes
Variable Size             499124744 bytes
Database Buffers          281018368 bytes
Redo Buffers                2637824 bytes
Database mounted.
Database opened.
SQL> 
SQL> 
SQL> COL NAME FORMAT A50
SQL> SELECT NAME,ASYNCH_IO FROM V$DATAFILE F,V$IOSTAT_FILE I
  2  WHERE  F.FILE#=I.FILE_NO
  3  AND    FILETYPE_NAME='Data File';

NAME                                               ASYNCH_IO
-------------------------------------------------- ---------
/fantlam/oracle/app/oracle/oradata/mmpt/system01.d ASYNC_ON
bf

/fantlam/oracle/app/oracle/oradata/mmpt/sysaux01.d ASYNC_ON
bf

/fantlam/oracle/app/oracle/oradata/mmpt/undotbs01. ASYNC_ON
dbf

/fantlam/oracle/app/oracle/oradata/mmpt/users01.db ASYNC_ON
f

NAME                                               ASYNCH_IO
-------------------------------------------------- ---------

SQL> col name for a60
SQL> SELECT NAME,ASYNCH_IO FROM V$DATAFILE F,V$IOSTAT_FILE I
  2  WHERE  F.FILE#=I.FILE_NO
  3  AND    FILETYPE_NAME='Data File';

NAME                                                         ASYNCH_IO
------------------------------------------------------------ ---------
/fantlam/oracle/app/oracle/oradata/mmpt/system01.dbf         ASYNC_ON
/fantlam/oracle/app/oracle/oradata/mmpt/sysaux01.dbf         ASYNC_ON
/fantlam/oracle/app/oracle/oradata/mmpt/undotbs01.dbf        ASYNC_ON
/fantlam/oracle/app/oracle/oradata/mmpt/users01.dbf          ASYNC_ON

SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    lat  INTEGER;
  3    iops INTEGER;
  4    mbps INTEGER;
  5  BEGIN
  6  -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (<DISKS>, <MAX_LATENCY>, iops, mbps, lat);
  7     DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);
  8   
  9    DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
 10    DBMS_OUTPUT.PUT_LINE ('latency  = ' || lat);
 11    dbms_output.put_line('max_mbps = ' || mbps);
 12  end;
 13  /
 ##看结果
max_iops = 6861
latency  = 0
max_mbps = 502

PL/SQL procedure successfully completed.

SQL> 

转载于:https://blog.51cto.com/roidba/2113820

kaleojyt@JYT:~/calibration/catkin_ws$ catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 Base path: /home/kaleojyt/calibration/catkin_ws Source space: /home/kaleojyt/calibration/catkin_ws/src Build space: /home/kaleojyt/calibration/catkin_ws/build Devel space: /home/kaleojyt/calibration/catkin_ws/devel Install space: /home/kaleojyt/calibration/catkin_ws/install Creating symlink "/home/kaleojyt/calibration/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/noetic/share/catkin/cmake/toplevel.cmake" #### #### Running command: "cmake /home/kaleojyt/calibration/catkin_ws/src -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCATKIN_DEVEL_PREFIX=/home/kaleojyt/calibration/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/kaleojyt/calibration/catkin_ws/install -G Unix Makefiles" in "/home/kaleojyt/calibration/catkin_ws/build" #### -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: /home/kaleojyt/calibration/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Found PY_em: /usr/lib/python3/dist-packages/em.py -- Using empy: /usr/lib/python3/dist-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/kaleojyt/calibration/catkin_ws/build/test_results -- Forcing gtest/gmock from source, though one was otherwise available. -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") -- Found Threads: TRUE -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.12 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - code_utils -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'code_utils' -- ==> add_subdirectory(code_utils) -- Found OpenCV: /usr (found version "4.2.0") -- Found BLAS: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so -- Found AMD headers in: /usr/include/suitesparse -- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so -- Found CAMD headers in: /usr/include/suitesparse -- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so -- Found CCOLAMD headers in: /usr/include/suitesparse -- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so -- Found CHOLMOD headers in: /usr/include/suitesparse -- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so -- Found COLAMD headers in: /usr/include/suitesparse -- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so -- Found SPQR headers in: /usr/include/suitesparse -- Found SPQR library: /usr/lib/x86_64-linux-gnu/libspqr.so -- Found Config headers in: /usr/include/suitesparse -- Found Config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so -- Found Intel Thread Building Blocks (TBB) library (2020.1 / 11101) include location: . Assuming SuiteSparseQR was compiled with TBB. -- Looking for shm_open in rt -- Looking for shm_open in rt - found -- Adding librt to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing). -- Could NOT find METIS (missing: METIS_INCLUDE_DIR METIS_LIBRARY) -- Found SuiteSparse: /usr/include/suitesparse (found suitable version "5.7.1", minimum required is "5.7.1") found components: AMD CAMD CCOLAMD CHOLMOD COLAMD SPQR Config -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/lib/cmake/eigen3 -- Found required Ceres dependency: glog -- Found required Ceres dependency: gflags -- Found Ceres version: 2.2.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations] -- Configuring done CMake Warning (dev) at code_utils/CMakeLists.txt:35 (add_library): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "pnp" links to target "CUDA::cublas" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at code_utils/CMakeLists.txt:35 (add_library): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "pnp" links to target "CUDA::cudart" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at code_utils/CMakeLists.txt:35 (add_library): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "pnp" links to target "CUDA::cusolver" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at code_utils/CMakeLists.txt:35 (add_library): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "pnp" links to target "CUDA::cusparse" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /home/kaleojyt/calibration/catkin_ws/build #### #### Running command: "make -j32 -l32" in "/home/kaleojyt/calibration/catkin_ws/build" #### Scanning dependencies of target matIO_test Scanning dependencies of target sumpixel_test Scanning dependencies of target pnp Scanning dependencies of target polynomial Scanning dependencies of target cv_utils [ 7%] Building CXX object code_utils/CMakeFiles/polynomial.dir/src/math_utils/Polynomial.cpp.o [ 15%] Building CXX object code_utils/CMakeFiles/sumpixel_test.dir/src/sumpixel_test.cpp.o [ 23%] Building CXX object code_utils/CMakeFiles/matIO_test.dir/src/mat_io_test.cpp.o [ 30%] Building CXX object code_utils/CMakeFiles/pnp.dir/src/cv_utils/dlt/dlt.cpp.o [ 38%] Building CXX object code_utils/CMakeFiles/cv_utils.dir/src/cv_utils.cc.o [ 46%] Building CXX object code_utils/CMakeFiles/pnp.dir/src/cv_utils/pnp/pnp.cpp.o [ 53%] Building CXX object code_utils/CMakeFiles/pnp.dir/src/cv_utils/pnp/nonlinearpnp.cpp.o [ 61%] Building CXX object code_utils/CMakeFiles/pnp.dir/src/cv_utils/pnp/linearpnp.cpp.o [ 69%] Linking CXX static library /home/kaleojyt/calibration/catkin_ws/devel/lib/libcv_utils.a [ 69%] Built target cv_utils [ 76%] Linking CXX executable /home/kaleojyt/calibration/catkin_ws/devel/lib/code_utils/sumpixel_test [ 84%] Linking CXX executable /home/kaleojyt/calibration/catkin_ws/devel/lib/code_utils/matIO_test [ 84%] Built target sumpixel_test [ 84%] Built target matIO_test /home/kaleojyt/calibration/catkin_ws/src/code_utils/src/math_utils/Polynomial.cpp: In member function ‘double math_utils::Polynomial::getOneRealRoot(double, double, double)’: /home/kaleojyt/calibration/catkin_ws/src/code_utils/src/math_utils/Polynomial.cpp:64:25: warning: control reaches end of non-void function [-Wreturn-type] 64 | eigen_utils::Vector realRoots, imagRoots; | ^~~~~~~~~ [ 92%] Linking CXX static library /home/kaleojyt/calibration/catkin_ws/devel/lib/libpolynomial.a [ 92%] Built target polynomial [100%] Linking CXX shared library /home/kaleojyt/calibration/catkin_ws/devel/lib/libpnp.so /usr/bin/ld: 找不到 -lCUDA::cusolver /usr/bin/ld: 找不到 -lCUDA::cusparse collect2: error: ld returned 1 exit status make[2]: *** [code_utils/CMakeFiles/pnp.dir/build.make:192:/home/kaleojyt/calibration/catkin_ws/devel/lib/libpnp.so] 错误 1 make[1]: *** [CMakeFiles/Makefile2:804:code_utils/CMakeFiles/pnp.dir/all] 错误 2 make: *** [Makefile:141:all] 错误 2 Invoking "make -j32 -l32" failed
07-12
<think>我们正在处理一个catkin_make构建失败的问题。从日志中可以看出,构建过程中在链接libpnp.so时出现了错误: /usr/bin/ld: 找不到 -lCUDA::cusolver /usr/bin/ld: 找不到 -lCUDA::cusparse collect2: error: ld returned 1 exit status 这表明链接器无法找到名为`CUDA::cusolver`和`CUDA::cusparse`的。这些是CUDA工具包的一部分。错误的原因可能是系统没有安装CUDA,或者CMake在查找CUDA时没有正确设置这些导入的目标。 此外,在CMake配置阶段,我们已经看到了一些警告,例如: Target "pnp" links to target "CUDA::cublas" but the target was not found. ...(类似的其他几个CUDA::*目标) 这进一步说明CMake在配置时没有找到CUDA,或者没有正确导入这些目标。 解决方案: 1. 确保系统已经安装了CUDA工具包。可以通过运行`nvcc --version`来检查。 2. 如果CUDA已经安装,那么可能是CMake没有找到它。可以尝试在CMake命令中显式指定CUDA_TOOLKIT_ROOT_DIR,例如: `catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda` 3. 如果项目并不需要CUDA,那么需要修改code_utils的CMakeLists.txt,去掉对CUDA的依赖。但是根据错误信息,项目中的pnp目标链接了这些CUDA,所以如果不需要,应该修改代码。 但是,从日志中我们也可以看到,Ceres被找到了,并且Ceres的组件中包含了SuiteSparse等,但没有提到CUDA。因此,可能是项目中的pnp模块要求使用CUDA,但系统没有安装。 因此,步骤可能是: - 安装CUDA工具包(如果系统支持并需要GPU加速)。 - 或者,如果不想使用CUDA,修改code_utils的CMakeLists.txt,移除对CUDA::cusolver和CUDA::cusparse等的链接。 由于错误发生在链接阶段,且之前配置阶段已经警告了这些目标没有找到,所以安装CUDA可能是最直接的解决方案。 如果用户没有GPU或不想安装CUDA,则需要修改CMakeLists.txt,将依赖CUDA的部分条件化或者移除。 根据日志,我们还可以注意到在配置Ceres时,Ceres的组件中并没有CUDA,所以可能是项目中的pnp模块单独使用了CUDA。 具体到code_utils的CMakeLists.txt(在构建日志中,我们看到了add_library(pnp ...)并且链接了这些CUDA目标),需要检查该文件,看是否有条件判断是否找到CUDA,如果没有找到则跳过这些链接。如果没有这样的判断,则需要修改。 但是,由于我们无法直接修改用户的CMakeLists.txt,所以需要提供建议。 因此,回答将分为两个方向: 1. 安装CUDA并确保CMake能够找到它。 2. 修改code_utils的CMakeLists.txt,移除对CUDA的依赖(如果不需要)。 由于用户可能没有GPU,因此第二个方法可能更通用。 如何修改CMakeLists.txt? 在code_utils的CMakeLists.txt中,找到链接CUDA的部分(可能是target_link_libraries(pnp ...)),然后移除CUDA::cusolver, CUDA::cusparse等。但是,注意可能还有其他CUDA::开头的,比如CUDA::cublas, CUDA::cudart等。 但是,移除后可能会影响pnp模块的功能(如果它确实需要CUDA的话)。所以需要权衡。 另外,在日志中我们看到,在配置阶段,CMake就已经警告了这些目标没有找到,但配置还是完成了(生成阶段成功)。所以,我们可以尝试在CMakeLists.txt中,在链接这些之前检查CUDA是否被找到。例如: ```cmake find_package(CUDA REQUIRED) # 或者不要求,然后根据情况添加 ``` 但是,原CMakeLists.txt可能没有这样做,而是直接使用了目标名。正确的做法是,在链接之前,确保这些目标存在。如果CUDA没有安装,那么这些目标是不存在的。 因此,我们可以修改CMakeLists.txt,在链接之前检查CUDA,并且只有在找到CUDA时才链接这些。例如: ```cmake find_package(CUDA QUIET) if(CUDA_FOUND) target_link_libraries(pnp ... CUDA::cusolver CUDA::cusparse ...) else() # 可以链接其他替代,或者不链接 target_link_libraries(pnp ... ) # 去掉CUDA endif() ``` 但是,具体如何修改取决于项目。如果项目必须使用CUDA,那么用户必须安装CUDA。 总结回答: 构建失败的原因是链接器找不到CUDA相关的(cusolver和cusparse)。解决方法是: 1. 安装CUDA工具包(如果系统有NVIDIA GPU并且需要GPU加速)。 2. 如果不想安装CUDA,则需要修改code_utils的CMakeLists.txt,移除对CUDA的依赖。具体做法是找到链接这些的地方(target_link_libraries中关于CUDA::*的部分),将其移除或条件化。 另外,在构建日志中还有一个警告: /home/kaleojyt/calibration/catkin_ws/src/code_utils/src/math_utils/Polynomial.cpp:64:25: warning: control reaches end of non-void function [-Wreturn-type] 这个警告表示函数可能没有返回值就结束了,需要修复代码以避免未定义行为。但这个警告不是导致构建失败的原因,构建失败是由链接错误引起的。 现在,根据要求,在回答后提出3-5个相关问题。</think>### 问题分析及解决方案 您的 `catkin_make` 构建失败,主要错误是链接阶段找不到 CUDA 相关: ``` /usr/bin/ld: 找不到 -lCUDA::cusolver /usr/bin/ld: 找不到 -lCUDA::cusparse ``` 这表明 CMake 配置时未正确找到 CUDA 工具包,导致链接器无法定位 `cusolver` 和 `cusparse` 。同时存在 CMake 策略警告(CMP0028)和代码警告(控制流未返回)。 ### 解决步骤 1. **验证 CUDA 安装** ```bash nvcc --version # 检查 CUDA 是否安装 ls /usr/local/cuda/lib64 # 确认文件存在 ``` 2. **修正 CMake 配置** - 在 `code_utils/CMakeLists.txt` 中显式指定 CUDA 路径: ```cmake find_package(CUDA REQUIRED) include_directories(${CUDA_INCLUDE_DIRS}) link_directories(${CUDA_LIBRARY_DIRS}) ``` - 修改目标链接方式(替换 `CUDA::*`): ```cmake target_link_libraries(pnp ${CUDA_cusolver_LIBRARY} ${CUDA_cusparse_LIBRARY} # 其他依赖... ) ``` 3. **修复代码警告** 在 `Polynomial.cpp` 中确保函数 `getOneRealRoot()` 在所有分支都有返回值: ```cpp double getOneRealRoot(...) { // ... 计算逻辑 if (realRootsFound) return root; else return 0.0; // 添加默认返回值 } ``` 4. **重新构建** ```bash catkin clean # 清理构建 catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda ``` ### 关键原因 - CUDA 未正确配置或路径未暴露给 CMake - CMake 目标链接语法不兼容(`CUDA::` 命名空间需显式支持) - 代码存在未定义行为(无返回值函数)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值