此查询是否获取所有值,包括null,而该参数在Table中不可用。
select name,display_value
from v$spparameter where nvl(name,'null') in(
'memory_target','sga_target','pga_aggregate_target','pga_aggregate_limit','db_cache_size',
'shared_pool_size','large_pool_size','result_cache_max_size','processes',
'session_cached_cursors','open_cursors','db_securefile','cpu_count',
'parallel_max_servers','job_queue_processes','log_buffer','_b_tree_bitmap_plans',
'use_large_pages','audit_trail','nls_sort','plsql_code_type','resource_manager_plan',
'shared_servers','max_shared_servers','dispatchers','event','undo_retention',
'_highthreshold_undoretention','parallel_adaptive_multi_user','parallel_force_local',
'db_files','db_performance_profile','_srvntfn_max_concurrent_jobs',
'_optimizer_use_feedback','optimizer_dsdir_usage_control',
'_sql_plan_directive_mgmt_control','_fix_control','global_txn_processes',
'_disable_autotune_gtx', '_ges_server_processes','sga_max_size',
'_securefiles_concurrency_estimate','streams_pool_size')
order by name;
答案 0 :(得分:1)
您可以尝试将OR name is null
添加到位置。
因为SQL
NULL
不是值。您需要使用IS NULL
来获取它。
select name,display_value
from v$spparameter
where
name in('memory_target','sga_target','pga_aggregate_target','pga_aggregate_limit','db_cache_size','shared_pool_size','large_pool_size','result_cache_max_size','processes','session_cached_cursors','open_cursors','db_securefile','cpu_count','parallel_max_servers','job_queue_processes','log_buffer','_b_tree_bitmap_plans','use_large_pages','audit_trail','nls_sort','plsql_code_type','resource_manager_plan','shared_servers','max_shared_servers','dispatchers','event','undo_retention','_highthreshold_undoretention','parallel_adaptive_multi_user','parallel_force_local','db_files','db_performance_profile','_srvntfn_max_concurrent_jobs','_optimizer_use_feedback','_optimizer_dsdir_usage_control','_sql_plan_directive_mgmt_control','_fix_control','global_txn_processes','_disable_autotune_gtx', '_ges_server_processes','sga_max_size','_securefiles_concurrency_estimate','streams_pool_size')
OR
name is null
order by name;
答案 1 :(得分:1)
差不多。您正在将null值转换为字符串'null',但是忘记了将其包含在“ in”列表中。只需在列表中添加“ null”即可。
select name,display_value
from v$spparameter where nvl(name,'null') in('null',
'memory_target','sga_target','pga_aggregate_target','pga_aggregate_limit','db_cache_size',
'shared_pool_size','large_pool_size','result_cache_max_size','processes',
'session_cached_cursors','open_cursors','db_securefile','cpu_count',
'parallel_max_servers','job_queue_processes','log_buffer','_b_tree_bitmap_plans',
'use_large_pages','audit_trail','nls_sort','plsql_code_type','resource_manager_plan',
'shared_servers','max_shared_servers','dispatchers','event','undo_retention',
'_highthreshold_undoretention','parallel_adaptive_multi_user','parallel_force_local',
'db_files','db_performance_profile','_srvntfn_max_concurrent_jobs',
'_optimizer_use_feedback','optimizer_dsdir_usage_control',
'_sql_plan_directive_mgmt_control','_fix_control','global_txn_processes',
'_disable_autotune_gtx', '_ges_server_processes','sga_max_size',
'_securefiles_concurrency_estimate','streams_pool_size')
order by name;