在创建一个ORACLE数据库后,查询时使用order by时内存空间不足,进行内存的调整: 1)支持大内存的设置: cd $ORACLE_HOME/rdbms/lib cp ksms.s ksms.s.bak genksms -s 0x12000000 >ksms.s make -f ins_rdbms.mk ksms.o make -f ins_rdbms.mk ioracle 2)查看内存情况: 如果知道参数名,直接用 show parameter xxxx即可,如: SQL> show parameter large_pool_size; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ large_pool_size big integer 520093696 如果不知道参数名,直接从v$parameter表读取: SQL> select name, value, description from v$parameter where name like '%size' 为了效果好看,可以用set linesize xxx 设置每行的字符 再用col 列名 format 列长来设置一些列的显示, 最后将结果的分页设置大一点,如: SQL> set linesize 500 SQL> select name, value, description from v$parameter where name like '%size'; SQL> col name format a32 SQL> col value format a50 SQL> set pagesize 50 查询结果如下: NAME VALUE DESCRIPTION -------------------------------- --------------- ---------------------------------------------------------------- shared_pool_size 134217728 size in bytes of shared pool sga_max_size 1074862160 max total SGA size shared_pool_reserved_size 6710886 size in bytes of reserved area of shared pool large_pool_size 520093696 size in bytes of the large allocation pool java_pool_size 268435456 size in bytes of the Java pool java_max_sessionspace_size 0 max allowed size in bytes of a Java sessionspace db_block_size 8192 Size of database block in bytes db_keep_cache_size 0 Size of KEEP buffer pool for standard block size buffers db_recycle_cache_size 0 Size of RECYCLE buffer pool for standard block size buffers db_2k_cache_size 0 Size of cache for 2K buffers db_4k_cache_size 0 Size of cache for 4K buffers db_8k_cache_size 0 Size of cache for 8K buffers db_16k_cache_size 0 Size of cache for 16K buffers db_32k_cache_size 0 Size of cache for 32K buffers db_cache_size 134217728 Size of DEFAULT buffer pool for standard block size buffers global_context_pool_size Global Application Context Pool Size in Bytes create_bitmap_area_size 8388608 size of create bitmap buffer for bitmap index bitmap_merge_area_size 1048576 maximum memory allow for BITMAP MERGE parallel_execution_message_size 2148 message buffer size for parallel execution hash_area_size 200000000 size of in-memory hash work area max_dump_file_size UNLIMITED Maximum size (blocks) of dump file oracle_trace_collection_size 5242880 Oracle TRACE collection file max. size object_cache_optimal_size 102400 optimal size of the user session's object cache in bytes sort_area_size 100000000 size of in-memory sort work area sort_area_retained_size 0 size of in-memory sort work area retained between fetch calls olap_page_pool_size 33554432 size of the olap page pool in bytes 3)调整设置 SQL >alter system set sga_max_size=1544624768 scope=spfile; 4)重启数据库 5)重新设置其它内存参数: SQL >alter system set db_buffer_size=536870912 scope=both; SQL >alter system set large_pool_size=536870912 scope=both; 新设置生效,分配给数据库的内存变大。