DBMS_Space
I have a partioned table named bUsers and name of partion is Partion1. How can I use DBMS_Space to get information. Please guide me.
Regards,
null
They are allocated to the segment, but have never been used.
If they have been used, but are now empty, they are no longer unformatted.
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
Using DBMS_SPACE.SPACE_USAGE
I have a partitioned table that contain one SECUREFILE column (Oracle 11.2.0.2 Linux 64bit).
I would like to check its space usage in order to check if the compression and deduplication will help us to reduce the CLOB column's size.
I've found the following note in metalink: How to Check Space Occupied by LOB Compression
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=861344.1
However, this link is refered to a regular table, not partitioned.
I've seen in the documentation of DBMS_SPACE.SPACE_USAGE that there is a partition name attribute, but I'm not seem to use the procedure correctly.
I'm trying to run the following code:
DECLARE
l_segment_size_blocks NUMBER;
l_segment_size_bytes NUMBER;
l_used_blocks NUMBER;
l_used_bytes NUMBER;
l_expired_blocks NUMBER;
l_expired_bytes NUMBER;
l_unexpired_blocks NUMBER;
l_unexpired_bytes NUMBER;
v_segname varchar2(30);
BEGIN
DBMS_SPACE.SPACE_USAGE(
segment_owner => 'LOG',
partition_name =>'PART_03_2009',
segment_name => ' [https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=861344.1|https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=861344.1] SECURITY_LOG',
segment_type => 'TABLE PARTITION',
segment_size_blocks => l_segment_size_blocks,
segment_size_bytes => l_segment_size_bytes,
used_blocks => l_used_blocks,
used_bytes => l_used_bytes,
expired_blocks => l_expired_blocks,
expired_bytes => l_expired_bytes,
unexpired_blocks => l_unexpired_blocks,
unexpired_bytes => l_unexpired_bytes
DBMS_OUTPUT.ENABLE;
DBMS_OUTPUT.PUT_LINE(' Segment Blocks = '||l_segment_size_blocks||' Bytes = '||l_segment_size_bytes);
DBMS_OUTPUT.PUT_LINE(' Used Blocks = '||l_used_blocks||' Bytes = '||l_used_bytes);
DBMS_OUTPUT.PUT_LINE(' Expired Blocks = '||l_expired_blocks||' Bytes = '||l_expired_bytes);
DBMS_OUTPUT.PUT_LINE(' Unexpired Blocks = '||l_unexpired_blocks||' Bytes = '||l_unexpired_bytes);
DBMS_OUTPUT.PUT_LINE('=============================================');
END;
And I get this error : ORA-03213: Invalid Lob Segment name for DBMS_SPACE package
Some information
select partition_name, interval, num_rows
from dba_tab_partitions where table_owner = 'LOG'
order by partition_position;
1 PART_03_2009 NO 1235667
2 PART_04_2009 NO 4621135
3 PART_05_2009 NO 1322246
4 PART_06_2009 NO 6442123
SELECT segment_name, partition_name, segment_type
FROM DBA_SEGMENTS
WHERE OWNER = 'LOG'
and segment_type in ('TABLE PARTITION','LOB PARTITION')
order by 2;
SECURITY_LOG PART_03_2009 TABLE PARTITION
SECURITY_LOG PART_04_2009 TABLE PARTITION
SECURITY_LOG PART_05_2009 TABLE PARTITION
SECURITY_LOG PART_06_2009 TABLE PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P495 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P498 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P519 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P523 LOB PARTITION
What am I doing wrong ? What should I change?
Thanks in advance,
Roni.Thank you for your link.
I understood from Kyte's example how to use it and now it works.
I used the table name and partition name of the table instead of the lob segment name and the lob segment partition name.
Can you please tell me if there is a query that correlates between the lob segment partition name and the table partition name?
I would like to know what is the lob segment partition name of the table partition 'PART_03_2009' (or what is the table partition name of lob segment partition SYS_LOB_P495) and so on.
In the DBA_SEGMENTS I didn't find any fields that can help me connect between the two.
Information from DBA_SEGMENTS
SELECT segment_name, partition_name, segment_type
FROM DBA_SEGMENTS
WHERE OWNER = 'LOG'
and segment_type in ('TABLE PARTITION','LOB PARTITION')
order by 2;
SECURITY_LOG PART_03_2009 TABLE PARTITION
SECURITY_LOG PART_04_2009 TABLE PARTITION
SECURITY_LOG PART_05_2009 TABLE PARTITION
SECURITY_LOG PART_06_2009 TABLE PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P495 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P498 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P519 LOB PARTITION
SYS_LOB0000048317C00014$$ SYS_LOB_P523 LOB PARTITION
This anonymous block worked:*
DECLARE
l_segment_size_blocks NUMBER;
l_segment_size_bytes NUMBER;
l_used_blocks NUMBER;
l_used_bytes NUMBER;
l_expired_blocks NUMBER;
l_expired_bytes NUMBER;
l_unexpired_blocks NUMBER;
l_unexpired_bytes NUMBER;
v_segname varchar2(30);
BEGIN
DBMS_SPACE.SPACE_USAGE(
segment_owner => 'LOG',
partition_name =>'*SYS_LOB_P495*',
segment_name => '*SYS_LOB0000048317C00014$$*',
segment_type => 'LOB PARTITION',
segment_size_blocks => l_segment_size_blocks,
segment_size_bytes => l_segment_size_bytes,
used_blocks => l_used_blocks,
used_bytes => l_used_bytes,
expired_blocks => l_expired_blocks,
expired_bytes => l_expired_bytes,
unexpired_blocks => l_unexpired_blocks,
unexpired_bytes => l_unexpired_bytes
DBMS_OUTPUT.ENABLE;
DBMS_OUTPUT.PUT_LINE(' Segment Blocks = '||l_segment_size_blocks||' Bytes = '||l_segment_size_bytes);
DBMS_OUTPUT.PUT_LINE(' Used Blocks = '||l_used_blocks||' Bytes = '||l_used_bytes);
DBMS_OUTPUT.PUT_LINE(' Expired Blocks = '||l_expired_blocks||' Bytes = '||l_expired_bytes);
DBMS_OUTPUT.PUT_LINE(' Unexpired Blocks = '||l_unexpired_blocks||' Bytes = '||l_unexpired_bytes);
DBMS_OUTPUT.PUT_LINE('=============================================');
END;
/ -
oracle 10.2.0.3
redhat 4.5
RAC environment.. 3 nodes
i am having alot of problems direct path sql loading data, so I ran an AWR to look at the waits and my top waits are
library cache lock
row cache locks
each has over 10,000 seconds of wait in the last 4 hours. No one is query the database, all I am doing is running direct path loads.
I then noticed this in my top queries.
I then tried to track down the job that is calling this since its says DBMS_SCHEDULER... i think its the auto_space_advisor_job.
My questions:
1. What is auto_space_advisor_job? Is this from the oem?
2. what could be calling a "Shrink" on the partitions that I am loading? We are not doing this manually.
3. Why would I have 0 executions and 0 CPU for something with 10,000 seconds of wait? Is it all physical IO? Why no executions?
4. Could those wait events be related to this?
5. any suggestions on what to check next? As I said no one else is doing anything in this database. We are just test loading data.
Elapsed CPU Elap per % Total
Time (s) Time (s) Executions Exec (s) DB Time SQL Id
10,554 0 0 N/A 48.7 6mcpb06rctk0x
Module: DBMS_SCHEDULER
call dbms_space.auto_space_advisor_job_proc ( )
10,554 0 0 N/A 48.7 6twm6ph3ytr24
Module: DBMS_SCHEDULER
alter table "MYUSER"."MYTABLE" modify partition "PART_2008042519" shrink space
CHECKThere is insufficient information in what you posted to be sure what the issue is but simple math shows that there are only 14,400 seconds in 4 hours so I would suggest you go to metalink and open an SR.
-
Hi ,
I try to execute the following anonymous block (as user sys) contained in the
Oracle® Database PL/SQL Packages and Types Reference
10g Release 2 (10.2)
Part Number B14258-01
The anonynous block is as follows....
SQL> variable unf number;
SQL> variable unfb number;
SQL> variable fs1 number;
SQL> variable fs1b number;
SQL> variable fs2 number;
SQL> variable fs2b number;
SQL> variable fs3 number;
SQL> variable fs3b number;
SQL> variable fs4 number;
SQL> variable fs4b number;
SQL> variable full number;
SQL> variable fullb number;
SQL>
SQL> begin
2 dbms_space.space_usage('U1','T',
3 'TABLE',
4 :unf, :unfb,
5 :fs1, :fs1b,
6 :fs2, :fs2b,
7 :fs3, :fs3b,
8 :fs4, :fs4b,
9 :full, :fullb);
10 end;
11 /
begin
*ERROR in line 1
ORA-00942 : table or view does not existWhat object may be missing.....????
I have created the database using DBCA 10g......
Thanks....
SimI cannot reproduce this issue with 10.2.0.2 (db also created with DBCA):
SQL> show user
USER est "SYS"
SQL> desc test.t;
Nom NULL ? Type
X NUMBER(38)
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for Linux: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production
SQL> variable unf number;
SQL> variable unfb number;
SQL> variable fs1 number;
SQL> variable fs1b number;
SQL> variable fs2 number;
SQL> variable fs2b number;
SQL> variable fs3 number;
SQL> variable fs3b number;
SQL> variable fs4 number;
SQL> variable fs4b number;
SQL> variable full number;
SQL> variable fullb number;
SQL>
SQL> begin
2 dbms_space.space_usage('TEST','T',
3 'TABLE',
4 :unf, :unfb,
5 :fs1, :fs1b,
6 :fs2, :fs2b,
7 :fs3, :fs3b,
8 :fs4, :fs4b,
9 :full, :fullb);
10 end;
11 /
Procedure PL/SQL terminee avec succes.It's not a role/ PL/SQL problem.
Message was edited by:
Pierre Forstmann -
Space Management - DBMS_SPACE.OBJECT_GROWTH_TREND - how to execute
I am exploring the use of the package DBMS_SPACE and in particular the function OBJECT_GROWTH_TREND.
I have two problems at the moment. I am only able to execute this function when I am logged in as SYS. I would like to run the function as another user but I can't quite work out which privileges I need to grant that user. The documentation says you must have 'SYS' privileges. Execute privilege is already granted to PUBLIC so I can't see that being the problem.
In a test database where I log on as SYS I am able to execute the function however in that environment the function only returns one row with the current size when what I am interested in is a future growth projection. Does anyone know why I would only get one row ? My Oracle version is 10 g Rel 2 and below is an example of the query I used to invoke the function:
select * from table(dbms_space.OBJECT_GROWTH_TREND ('HR','EMPLOYEES','TABLE',NULL,
TO_TIMESTAMP('2008-05-16 11:00:00','YYYY-MM-DD HH:MI:SS'), TO_TIMESTAMP ('2008-06-01 11:00:00', 'YYYY-MM-DD HH:MI:SS'), INTERVAL '1' DAY ))Hi,
I have some good notes on using object_growth_trend here:
http://www.oracle-training.cc/t_oracle_segment_growth_prediction.htm
Also, consider making your own growth monitor:
http://www.dba-oracle.com/te_table_monitoring.htm
You can also see the growth of the whole database with this Oracle growth tracking script. Below is a great script to display table size changes between two periods.
column "Percent of Total Disk Usage" justify right format 999.99
column "Space Used (MB)" justify right format 9,999,999.99
column "Total Object Size (MB)" justify right format 9,999,999.99
set linesize 150
set pages 80
set feedback off
select * from (select to_char(end_interval_time, 'MM/DD/YY') mydate, sum(space_used_delta) / 1024 / 1024 "Space used (MB)", avg(c.bytes) / 1024 / 1024 "Total Object Size (MB)",
round(sum(space_used_delta) / sum(c.bytes) * 100, 2) "Percent of Total Disk Usage"
from
dba_hist_snapshot sn,
dba_hist_seg_stat a,
dba_objects b,
dba_segments c
where begin_interval_time > trunc(sysdate) - &days_back
and sn.snap_id = a.snap_id
and b.object_id = a.obj#
and b.owner = c.owner
and b.object_name = c.segment_name
and c.segment_name = '&segment_name'
group by to_char(end_interval_time, 'MM/DD/YY'))
order by to_date(mydate, 'MM/DD/YY');
Hope this helps. . .
Donald K. Burleson
Oracle Press author
Author of "Oracle Tuning: The Definitive Reference":
http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm -
Dbms_space.unused_space
I have a database 8k block size. Tablespace initial extent is 40K.
I created a table
D1
CREATE TABLE D1
( RID NUMBER, TABLENAME VARCHAR2(30 BYTE)
Pct free = 10.
No data is currently inserted into the table.
However when I use dbms_space.unused_space
DBMS_SPACE.UNUSED_SPACE (
p_owner,
p_segname,
p_type,
l_total_blocks,
l_total_bytes,
l_unused_blocks,
l_unused_bytes,
l_last_used_extent_file_id,
l_last_used_extent_block_id,
l_last_used_block,
l_partition_name);
Unused space
l_total_blocks--> 5
l_total_bytes--> 40960
l_unused_blocks--> 2
l_unused_bytes--> 16384
l_last_used_extent_file_id--> 16
l_last_used_extent_block_id 497199
l_last_used_block--> 3
5 blocks are allocated 8k * 5 = 40k which is the initial extent size. But I get 2 blocks that are unused
How do we determine the amount of space oracle uses for table management?
Isn't 24K alot.
Thanks in advance for all the help.This amount of 'unused space' is meaningless, overall considering today databases can hold Tb and Oracle is ready to accept Eb. After the amount of unused blocks you are reporting I assume you are working on a locally managed tablespace with manual segment space management. have you tried this test on an automatic segment space managed tablespace?
Meaningless, unless you are planning to create thousands of tiny tables, and even in this case, from a practical perspective, the cost of storage is not the same as it used to be a decade ago.
~ Madrid
http://hrivera99.blogspot.com -
DBMS_SPACE throwing exception
Hi everyone,
I was wondering if anyone can help me ? I'm trying to see how much my table is growing by calling this:
SELECT *
FROM TABLE(DBMS_SPACE.object_growth_trend ('SCOTT','EMP','TABLE'))
ORDER BY timepoint;And I'm getting this issue:
ORA-01804: failure to initialize timezone information
ORA-06512: at "SYS.DBMS_SPACE", line 3062
ORA-06512: at "SYS.DBMS_SPACE", line 4230
ORA-06512: at line 1
01804. 00000 - "failure to initialize timezone information"
*Cause: The timezone information file was not properly read.
*Action: Please contact Oracle Customer Support.I'm on Oracle 10g
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production Does anyone know what's wrong?
Thanks for your help!ORA-1804 indicates that the database cannot load the time zone file it wants to use. This error will come up every time that a named time zone is used and the time zone file is not available or corrupt.
So simply follow
*Action: Please contact Oracle Customer Support. -
DBMS_SPACE ASA_RECO_ROW Record Type Definition
Hi All,
Do you have any idea where we can find the definition of the mentioned packages? Here is the description from Oracle:
DBMS_SPACE
Thats fine, but we would like to select it from data dictionary view.In GUI tools we are able to select metadata, but how in sqlplus?
thanks if somebody could help me
Kind regards
AttilaAnything else rather than: select dbms_metadata.get_ddl('PACKAGE_SPEC','DBMS_SPACE','SYS') from dual; ?
-
Dbms_space.object_growth_trend: ORA-22905
RDBMS: 10.1.0.5.0
SQL> SELECT * FROM TABLE(dbms_space.object_growth_trend('JO', 'TAB1', 'TABLE'));
SELECT * FROM TABLE(dbms_space.object_growth_trend('JO', 'TAB1', 'TABLE'))
ERROR at line 1:
ORA-22905: cannot access rows from a non-nested table itemWhy?RDBMS: 10.1.0.5.0
SQL> SELECT * FROM TABLE(dbms_space.object_growth_trend('JO', 'TAB1', 'TABLE'));
SELECT * FROM TABLE(dbms_space.object_growth_trend('JO', 'TAB1', 'TABLE'))
ERROR at line 1:
ORA-22905: cannot access rows from a non-nested table itemWhy? -
DBMS_SPACE.OBJECT_GROWTH_TREND returns ORA-14551
Hi,
When I used DBMS_SPACE.OBJECT_GROWTH_TREND, it ran successfully but ended with an error.
SQL> SELECT * FROM V$VERSION ;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> SHOW USER
USER is "SYS"
SQL> SELECT *
2 FROM
3 table(
4 DBMS_SPACE.OBJECT_GROWTH_TREND (
5 object_owner =>'HR',
6 object_name =>'NAMES',
7 object_type =>'TABLE',
8 partition_name =>NULL,
9 start_time =>NULL,
10 end_time =>NULL,
11 interval =>to_dsinterval('0 00:10:00') ,
12 skip_interpolated => 'FALSE',
13 timeout_seconds =>NULL,
14 single_datapoint_flag =>'TRUE')
15 )
16 /
TIMEPOINT SPACE_USAGE SPACE_ALLOC QUALITY
04-OCT-09 03.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.08.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.18.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.28.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.38.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.48.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 04.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 05.08.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 05.18.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 05.28.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 05.38.47.421000 PM 10443367 11534336 INTERPOLATED
TIMEPOINT SPACE_USAGE SPACE_ALLOC QUALITY
04-OCT-09 05.48.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 05.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.08.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.18.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.28.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.38.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.48.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 06.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 07.08.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 07.18.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 07.28.47.421000 PM 10443367 11534336 INTERPOLATED
TIMEPOINT SPACE_USAGE SPACE_ALLOC QUALITY
04-OCT-09 07.38.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 07.48.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 07.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.08.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.18.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.28.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.38.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.48.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 08.58.47.421000 PM 10443367 11534336 INTERPOLATED
04-OCT-09 09.08.47.421000 PM 10443367 11534336 PROJECTED
04-OCT-09 09.18.47.421000 PM 10443367 11534336 PROJECTED
TIMEPOINT SPACE_USAGE SPACE_ALLOC QUALITY
04-OCT-09 09.28.47.421000 PM 10443367 11534336 PROJECTED
04-OCT-09 09.38.47.421000 PM 10443367 11534336 PROJECTED
04-OCT-09 09.48.47.421000 PM 10443367 11534336 PROJECTED
36 rows selected.
EXCEPTION in chrow processing - code: -14551 msg: ORA-14551: cannot perform a
DML operation inside a query*
-- changed to another table for testing
SQL> ED
Wrote file afiedt.buf
1 SELECT *
2 FROM
3 table(
4 DBMS_SPACE.OBJECT_GROWTH_TREND (
5 object_owner =>'HR',
6 object_name =>'EMPLOYEES',
7 object_type =>'TABLE',
8 partition_name =>NULL,
9 start_time =>NULL,
10 end_time =>NULL,
11 interval =>to_dsinterval('0 00:10:00') ,
12 skip_interpolated => 'FALSE',
13 timeout_seconds =>NULL,
14 single_datapoint_flag =>'TRUE')
15* )
SQL> /
TIMEPOINT SPACE_USAGE SPACE_ALLOC QUALITY
04-OCT-09 04.09.20.343000 PM 12614 65536 GOOD
EXCEPTION in chrow processing - code: -14551 msg: ORA-14551: cannot perform a
DML operation inside a queryDECLARE
v_object_owner VARCHAR2 (30):='ME';
v_object_name VARCHAR2 (30):='ACCOUNTS';
v_object_type VARCHAR2 (30):='TABLE PARTITION';
v_partition_name VARCHAR2 (30):='PAF19960501';
v_objrefcursor sys_refcursor;
r_obj_trend DBMS_SPACE.object_growth_trend_row;
CURSOR c_parts (p_owner IN VARCHAR2, p_table IN VARCHAR2)
IS
SELECT table_owner, table_name, partition_name
FROM dba_tab_partitions
WHERE table_owner = p_owner AND table_name = p_table
order by partition_name;
BEGIN
FOR r IN c_parts ('ME', 'ACCOUNTS')
LOOP
v_objrefcursor :=
DBMS_SPACE.object_growth_trend_cur (
object_owner => v_object_owner,
object_name => v_object_name,
object_type => v_object_type,
partition_name => v_partition_name,
start_time => sysdate - 120,
end_time => sysdate + 30,
interval =>null,
skip_interpolated => 'FALSE',
timeout_seconds => 360
loop
FETCH v_objrefcursor INTO r_obj_trend;
exit when v_objrefcursor%notfound;
-- if r_obj_trend.SPACE_USAGE * 1.5 <= r_obj_trend.SPACE_ALLOC THEN
DBMS_OUTPUT.PUT_LINE( v_object_name ||' '||v_partition_name
|| ' '
|| r_obj_trend.timepoint
|| ' '
|| r_obj_trend.SPACE_USAGE
|| ' '
|| r_obj_trend.SPACE_ALLOC
|| ' '
|| r_obj_trend.quality);
-- end if;
END LOOP;
end loop;
CLOSE v_objrefcursor;
END;
EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
ACCOUNTS PAF19960501 18-DEC-09 06.49.07.857150 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 23-DEC-09 01.40.33.571436 AM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 27-DEC-09 08.31.59.285722 AM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
ACCOUNTS PAF19960501 17-JAN-10 06.49.07.857152 PM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 22-JAN-10 01.40.33.571438 AM 32768 196608 PROJECTED
ACCOUNTS PAF19960501 26-JAN-10 08.31.59.285724 AM 32768 196608 PROJECTED
EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
Maybe not the best example but as you can see,
for every switch to a different partition I get this EXCEPTION msg.
The output seems correct otherwise.
I can create the message several different ways!
Row# BANNER
1 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
2 PL/SQL Release 10.2.0.4.0 - Production
3 CORE 10.2.0.4.0 Production
4 TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
5 NLSRTL Version 10.2.0.4.0 - Production -
DBMS_SPACE.OBJECT_GROWTH_TREND without Diagnostics Pack
Hi ,
Can i use DBMS_SPACE.OBJECT_GROWTH_TREND without Diagnostics Pack? As per the docs this procedure uses AWR for information retrieval.
Also I've seen that there are multiple bugs related to this in <10.2.0.3. Can some one share their experiences with this option.
My objective here is to observe past object growth at database/object level. This seems to be the ONLY option provided by oracle for this.Any other hints apart from custom scripts.
Thanks
RaviThanks for the info Brain.
As per the licencing docs AWR is part of Diagnostics pack. I'm not supposed to access any AWR tables without proper licence. It also mentions set of packages which will use the AWR information and i'm not supposed to use those packages as well. But no where in the licencing document there is a information about DBMS_SPACE package.
Having said all this, licencing doc also mentions that there are few tables/view that start with DBA_HIST, which can be used WITHOUT licence.
I need to know if there is any clear YES or NO kind of information for my question. Any information you have will be highly helpful.
Thanks,
Ravi.M -
DBMS_SPACE(9i) for tablespace growth trend..?
Hello,
for 10G, dbms_space.object_growth_trend() can expect table's growth....
for 9i (9.2.0.6 in Sun9) database, is there any friend has experience know how to do for the following purpose:
1. How to expect tablespace growth? say, to accommodate new data for the next 30 days we have to increase tablespace A by X GB, tablespace B by Y GB, … etc
2. How to expect database level growth? say, we need XXX GB more to accommodate new data for the year YYYY
3, Is there any way to Initialize (if possible) Segment Advisor with the information about segment trends we have already collected in 9i
Thank you in advance
JerryHi..
AFAIK in 9i you can't find the Subprograms like object_growth_trend() package in dbms_space.
How to expect tablespace growth? I think that you will have to maintain a sheet of the tablespace usage.Daily you will need to maintain the tablespace size, used and free size of tablespace.Ans after few days of observation you can predict the approximate amount of size being filled up in a day.
You can use the below query to know the used and the free space in the tablespace.
select df.tablespace_name tspace,
df.bytes/(1024*1024) tot_ts_size,
(df.bytes/(1024*1024) -sum(fs.bytes)/(1024*1024)) Used_ts_size,
sum(fs.bytes)/(1024*1024) free_ts_size,
round(sum(fs.bytes)*100/df.bytes) free_pct,
round((df.bytes-sum(fs.bytes))*100/df.bytes) used_pct1
from dba_free_space fs, (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name ) df
where fs.tablespace_name = df.tablespace_name
group by df.tablespace_name, df.bytes
order by 1
2. How to expect database level growth? Again same, you need to maintain a sheet for it.Use the below query
select sum(bytes/1024/1024/1024) Physical_size_gb from dba_data_files;
select sum(bytes/1024/1024/1024) Actual_size_gb from dba_segments; 3, Is there any way to Initialize (if possible) Segment Advisor with the information about segment trends we have already collected in 9iNo.
HTH
Anand
Edited by: Anand... on Jan 6, 2009 4:17 AM -
Dbms_space.verify_shrink_candidate
Hi,
in 10gR2how can I find the table which can be shrinked using dbms_space.verify_shrink_candidate
Many thanks.Again a package function that is not documented :(
anyway, here is what i found out. I have garbled the table name and other information.
SQL> declare
2 x boolean;
3 begin
4 x := dbms_space.verify_shrink_candidate ('X','ABC','TABLE',100000000);
5 if x = true then
6 dbms_output.put_line ('yes');
7 else
8 dbms_output.put_line ('no');
9 end if;
10 end;
11 /
yes
PL/SQL procedure successfully completed. -
Dbms_space.space_usage
Hi,
I have installed Oracle 10g R2 on Win XP. Should I do something to be able to use dbms_space.space_usage package ?
Many thanks before.Hi,
Well, take a look:
SYS@ORACLE10> declare
2 l_fs1_bytes number;
3 l_fs2_bytes number;
4 l_fs3_bytes number;
5 l_fs4_bytes number;
6 l_fs1_blocks number;
7 l_fs2_blocks number;
8 l_fs3_blocks number;
9 l_fs4_blocks number;
10 l_full_bytes number;
11 l_full_blocks number;
12 l_unformatted_bytes number;
13 l_unformatted_blocks number;
14 begin
15 dbms_space.space_usage(
16 segment_owner => 'USER1',
17 segment_name => 'EMP',
18 segment_type => 'TABLE',
19 fs1_bytes => l_fs1_bytes,
20 fs1_blocks => l_fs1_blocks,
21 fs2_bytes => l_fs2_bytes,
22 fs2_blocks => l_fs2_blocks,
23 fs3_bytes => l_fs3_bytes,
24 fs3_blocks => l_fs3_blocks,
25 fs4_bytes => l_fs4_bytes,
26 fs4_blocks => l_fs4_blocks,
27 full_bytes => l_full_bytes,
28 full_blocks => l_full_blocks,
29 unformatted_blocks => l_unformatted_blocks,
30 unformatted_bytes => l_unformatted_bytes
31 );
32 dbms_output.put_line(' FS1 Blocks = '||l_fs1_blocks||' Bytes = '||l_fs1_bytes);
33 dbms_output.put_line(' FS2 Blocks = '||l_fs2_blocks||' Bytes = '||l_fs2_bytes);
34 dbms_output.put_line(' FS3 Blocks = '||l_fs3_blocks||' Bytes = '||l_fs3_bytes);
35 dbms_output.put_line(' FS4 Blocks = '||l_fs4_blocks||' Bytes = '||l_fs4_bytes);
36 dbms_output.put_line('Full Blocks = '||l_full_blocks||' Bytes = '||l_full_bytes);
37 end;
38 /
PL/SQL procedure successfully completed.
SYS@ORACLE10> set serveroutput on
SYS@ORACLE10> /
FS1 Blocks = 0 Bytes = 0
FS2 Blocks = 1 Bytes = 8192
FS3 Blocks = 0 Bytes = 0
FS4 Blocks = 4 Bytes = 32768
Full Blocks = 0 Bytes = 0
PL/SQL procedure successfully completed.Cheers -
Procedure uses DBMS_SPACE error
Hi ,
I use this Stored Procedure with DBMS_SPACE.SPACE_USAGE
( p_owner in varchar2,
p_name in varchar2,
p_type in varchar2 default 'TABLE' )
AS
l_unformatted_blocks number;
l_unformatted_bytes number;
l_fs1_blocks number;
l_fs1_bytes number;
l_fs2_blocks number;
l_fs2_bytes number;
l_fs3_blocks number;
l_fs3_bytes number;
l_fs4_blocks number;
l_fs4_bytes number;
l_full_blocks number;
l_full_bytes number;
PROCEDURE p( p_label in varchar2, p_num in number )
IS
BEGIN
dbms_output.put_line( rpad(p_label,50,'.') || p_num);
END;
BEGIN
dbms_space.space_usage
( segment_owner => p_owner,
segment_name => p_name,
segment_type => p_type,
unformatted_blocks => l_unformatted_blocks,
unformatted_bytes => l_unformatted_bytes,
fs1_blocks => l_fs1_blocks,
fs1_bytes => l_fs1_bytes,
fs2_blocks => l_fs2_blocks,
fs2_bytes => l_fs2_bytes,
fs3_blocks => l_fs3_blocks,
fs3_bytes => l_fs3_bytes,
fs4_blocks => l_fs4_blocks,
fs4_bytes => l_fs4_bytes,
full_blocks => l_full_blocks,
full_bytes => l_full_bytes );
p( 'Unformatted Blocks', l_unformatted_blocks);
p( 'Unformatted Bytes',l_unformatted_bytes);
p( 'FS1 Blocks',l_fs1_blocks);
p( 'FS1 Bytes',l_fs1_bytes);
P( 'FS2 Blocks',l_fs2_blocks);
P( 'FS2 Bytes',l_fs2_bytes);
P( 'FS3 Blocks',l_fs3_blocks);
P( 'FS3 Bytes',l_fs3_bytes);
p( 'FS4 Blocks',l_fs4_blocks);
p( 'FS4 Bytes',l_fs4_bytes);
P( 'Full Blocks',l_full_blocks);
P( 'Full Bytes',l_full_bytes);
END;
When I run the Procedure one time it works after that occurs the error:
SQL> show user
USER ist "HR"
exec show_used('HR','RACF','TABLE');
FEHLER in Zeile 1:
ORA-10614: Operation not allowed on this segment
ORA-06512: in "SYS.DBMS_SPACE", Zeile 97
ORA-06512: in "JOEFISH.SHOW_USED", Zeile 23
ORA-06512: in Zeile 1
Can anyone help?
Regards
MArcelORA-10614: Operation not allowed on this segment
Cause: This procedure can be used only on segments in tablespaces with AUTO SEGMENT SPACE MANAGEMENT.
Action: Recheck the segment name and type and re-issue the statement.
Bye, Aron
Maybe you are looking for
-
Error when trying to launch iTunes! Help!
Hi! I've tried to seek through the forums to find someone with the same error, but i haven't found anyone. Here's the problem: When i try to launch iTunes I get a Windows Error saying that iTunes har encountered a problem and has to quit. It's that k
-
Oracle 8i/9i and Red Hat Linux version
Hi, Does anyone know, which is the earliest version of Red Hat Linux supported by Oracle 8i or 9i? Regards
-
Blocking Multicast on Layer 2 switch
Cisco 2960, layer 2. trying to block inbound multicast from a single switchport. My CUCM to be exact. IGMP will not do what I need as I have phones trying to listen to Multicast MOH from the server, and Im trying to block it. Phones and server are
-
WebMail (Squirrel Mail) Doesn't allow login
I am taking a step-wise approach to securing mail. I just changed IMAP and SMTP to CRAM-MD5 and POP to APOP. After doing this, I was not able to login to WebMail any more. The user get's an invalid user name and/or password. I am not running OD (stan
-
Load javascript function into global scope
Hello forum, i send a lot of different scripts to IDS, but they often need to use the same functions i wrote. Is there a way to define such functions once, and to use them within subsequent scripts, without sending the function within that new script