Sie sind auf Seite 1von 3

DEBUGGING COLUMN LENGTH IN ORACLE

Author
JP Vijaykumar
Oracle DBA
Date
Sep 14th 2012
select * from gv$resource_limit where LIMIT_VALUE <> 'UNLIMITED';
INST
ID
----1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2

RESOURCE
CURRENT
MAX INITIAL
LIMIT
NAME
UTILIZATION UTILIZATION ALLOCATION VALUE
------------------------- ------------ ------------ ---------- ---------processes
49
251
500
500
sessions
61
267
555
555
enqueue_locks
379
472
7590
7590
enqueue_resources
378
457
3460 UNLIMITED
ges_procs
48
249
501
501
ges_ress
0
0
13600 UNLIMITED
ges_locks
0
0
19954 UNLIMITED
ges_cache_ress
1,224
13,355
0 UNLIMITED
ges_reg_msgs
123
1,896
1750 UNLIMITED
ges_big_msgs
48
1,115
1750 UNLIMITED
ges_rsv_msgs
0
0
1000
1000
gcs_resources
5,423,352
7,901,504
7397699
7397699
gcs_shadows
4,217,558
5,823,975
7397699
7397699
dml_locks
0
169
2440 UNLIMITED
temporary_table_locks
0
42 UNLIMITED UNLIMITED
transactions
10
85
610 UNLIMITED
branches
0
4
610 UNLIMITED
cmtcallbk
0
21
610 UNLIMITED
sort_segment_locks
0
38 UNLIMITED UNLIMITED
max_rollback_segments
57
61
610
65535
max_shared_servers
0
0 UNLIMITED UNLIMITED
parallel_max_servers
3
15
8
3600
processes
52
92
500
500
sessions
63
113
555
555
enqueue_locks
376
415
7590
7590
enqueue_resources
376
416
3460 UNLIMITED
ges_procs
51
90
501
501
ges_ress
0
0
13600 UNLIMITED
ges_locks
0
0
19954 UNLIMITED
ges_cache_ress
1,184
19,790
0 UNLIMITED
ges_reg_msgs
136
11,100
1750 UNLIMITED
ges_big_msgs
36
1,165
1750 UNLIMITED
ges_rsv_msgs
0
0
1000
1000
gcs_resources
1,906,693
6,858,250
7399870
7399870
gcs_shadows
875,058
5,364,060
7399870
7399870
dml_locks
0
68
2440 UNLIMITED
temporary_table_locks
0
3 UNLIMITED UNLIMITED
transactions
4
14
610 UNLIMITED
branches
0
4
610 UNLIMITED
cmtcallbk
0
3
610 UNLIMITED
sort_segment_locks
2
15 UNLIMITED UNLIMITED
max_rollback_segments
11
11
610
65535
max_shared_servers
0
0 UNLIMITED UNLIMITED
parallel_max_servers
3
15
8
3600

44 rows selected.
--The above query did not filter the rows as specified in my where condition.
"where LIMIT_VALUE <> 'UNLIMITED'"

desc gv$resource_limit
Name
Null?
----------------------------------------------------------------- ----------------------------------------------INST_ID
ER
RESOURCE_NAME
HAR2(30)
CURRENT_UTILIZATION
ER
MAX_UTILIZATION
ER
INITIAL_ALLOCATION
HAR2(10)
LIMIT_VALUE
HAR2(10)

Type
---NUMB
VARC
NUMB
NUMB
VARC
VARC

--The limit_value is VARCHAR2(10) data type


select limit_value,length(limit_value),length('UNLIMITED') from gv$resource_limi
t;
LIMIT
VALUE
LENGTH(LIMIT_VALUE) LENGTH('UNLIMITED')
---------- ------------------- ------------------500
10
9
555
10
9
7590
10
9
UNLIMITED
10
9
501
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
1000
10
9
7397699
10
9
7397699
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
65535
10
9
UNLIMITED
10
9
3600
10
9
500
10
9
555
10
9
7590
10
9
UNLIMITED
10
9
501
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
UNLIMITED
10
9
1000
10
9
7399870
10
9
7399870
10
9

UNLIMITED
UNLIMITED
UNLIMITED
UNLIMITED
UNLIMITED
UNLIMITED
65535
UNLIMITED
3600

10
10
10
10
10
10
10
10
10

9
9
9
9
9
9
9
9
9

44 rows selected.
--I checked the actual length of 'UNLIMITED' and the column_length of limit_valu
e
The actual length of the string 'UNLIMITED' is 9 characters long.
Where as the above select query is displaying the string length as 10.
There might be some extra spaces coming into the string value in the table.
select * from gv$resource_limit where LIMIT_VALUE <> ' UNLIMITED';
INST
ID
----2
2
2
2
2
2
2
2
2
1
1
1
1
1
1
1
1
1

RESOURCE
CURRENT
MAX INITIAL
LIMIT
NAME
UTILIZATION UTILIZATION ALLOCATION VALUE
------------------------- ------------ ------------ ---------- ---------processes
52
92
500
500
sessions
63
113
555
555
enqueue_locks
376
415
7590
7590
ges_procs
51
90
501
501
ges_rsv_msgs
0
0
1000
1000
gcs_resources
1,906,693
6,858,250
7399870
7399870
gcs_shadows
875,058
5,364,060
7399870
7399870
max_rollback_segments
11
11
610
65535
parallel_max_servers
3
15
8
3600
processes
50
251
500
500
sessions
62
267
555
555
enqueue_locks
378
472
7590
7590
ges_procs
49
249
501
501
ges_rsv_msgs
0
0
1000
1000
gcs_resources
5,423,352
7,901,504
7397699
7397699
gcs_shadows
4,217,601
5,823,975
7397699
7397699
max_rollback_segments
57
61
610
65535
parallel_max_servers
3
15
8
3600

18 rows selected.
--By using an extra space before the 'UNLIMITED' I could filter the colums
References:
http://www.dbasupport.com/oracle/scripts/Detailed/488.shtml
http://www.databasejournal.com/scripts/article.php/3800131/Debugging-Column-Leng
th.htm

Das könnte Ihnen auch gefallen