Which is the table of the LOB?
HelloWhere I work, we have the following types of tablespace:
-SMALL_TBL (for tables)
-MEDIUM_TBL (for tables)
-SMALL_IDX (for the index)
-MEDIUM_IDX (for the index)
-MEDIUM_LOB (for type LOB data)
By running the following query:
Select the s.segment_name object,
trunc (o.created) created,
object_type s.segment_type,
tablespace s.tablespace_name,
Round(s.bytes/1024/1024) space_in_MB,.
s.extents number_of_extents
WHERE s user_segments, o object
where ((s.tablespace_name comme '% TBL %' et s.segment_type <> 'TABLE') OR)
(s.tablespace_name like '% IDX' and s.segment_type <>'INDEX') OR
(s.tablespace_name like 'LOB %' and s.segment_type not in ('LOBSEGMENT', 'LOBINDEX')))
and o.OBJECT_NAME = s.segment_name
s.bytes desc order;
I get a list of the objects created in the tablespace evil.
I was asked to move objects in the right tablespaces.
The only thing that I know how what the table on which it has been created a lob?
I mean the query above reports in the first column a list of business objects such as:
OBJECT...
SYS_LOB0001573693C00003$ $
SYS_LOB0001573613C00003$ $
SYS_LOB0001573657C00010$ $
...
I should change this type LOB data storage space by using a query like:
ALTER TABLE < table name >
MOVE TABLESPACE < tablesapce name for tables > storage (initial then the 4M 4 M)
LOB (< LOB name >) AS STORE)
< Name tablaspace Lob > TABLESPACE storage (initial then the 4M 4 M)
);
But for example how can I get the table that has a lob from $$ SYS_LOB0001573693C00003?
Thank you!
select owner,table_name,column_name from all_lobs where segment_name = 'SYS_LOB0001573693C00003$$';
You can use the users/all/dba_lobs depending on privileges that you have
Best regards
Maxim
Tags: Database
Similar Questions
-
List of PT TABLES, which contain the digital certificate
Team,
We have set up free sign certicate in our environment.
So, can someone share the list of the PT TABLES, which contain the digital certificate.
Because, we do not have to refresh the environment and I don't want to lose the digital certificate after the update.
Thank you
Take a look at the following. I did something similar in refresh scripts
- PSCERTDB - raw certificate data
- PSCERTDEFN - certificates
- PSCERTDEFNDEL - certificates delete record.
- PSCERTISSUER - the issuer of the certificate
-
table removed, but LOB appear, how do the cleaning?
table removed, but LOB appear again in sys.dba_segments, take a lot of space, how to clean the LOB segment?Then, you can be your RETENTION policy. You see for the segments of BUSINESS that they won't go to the TRASH as such. They remain in the LOB segment in order to be able to FLASHBACK. Look at the documentation... I don't know what version you're on, but check this one.
http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/AppDev.101/b10796/adlob_ta.htm#1015810
Check it out...
RETENTION
As an alternative to the PCTVERSION parameter, you can specify the RETENTION setting in the clause of the CREATE TABLE or ALTER TABLE statement LOB storage. In doing so, configure the LOB column to store old versions of LOB data for a period of time, rather than using a percentage of the table space. For example:CREATE TABLE ContainsLOB_tab (n NUMBER, c CLOB)
(c) STORE AS SEGNAME of LOB (TABLESPACE lobtbs1 CHUNK 4096
RETENTION
NOCACHE LOGGING
STORAGE (MAXEXTENTS 5)
*);*
The RETENTION setting is designed for use with the undo features of the database, such as Flashback Query of Versions. When a LOB column has the property of RETENTION set, old versions of LOB data are kept for the duration specified by the parameter UNDO_RETENTION.
Noted that in what concerns the RETENTION setting:
Undo SQL is not enabled for LOB columns as it is with other data types. You must set the property of RETENTION on a column LOB using SQL cancel the LOB data.
You cannot explicitly set the value of the RETENTION setting. The shelf life of determined by the parameter UNDO_RETENTION LOB versions.
Use of the RETENTION parameter is supported only in Automatic Undo Management mode. You must configure your table for use with automated cancel before you can configure RETENTION on a LOB column.
The LOB storage clause can specify RETENTION or PCTVERSION, but not both.
So your LOB is probably hanging out until you hit the UNDO_RETENTION... even while they will not be deleted but be reused "I think."
Concerning
Tim -
Calculate the free space of the lob segment / reclaim space?
Friends...
DB: 11 GR 2
OS: Linux
I am trying shrink lob segment and recover the free space between the business segments.
This area in Oracle DB is new to me so try to learn and to shrink the segment.
I went through various metalink doco (386341.1) but not be able to get answers for below...
Issues related to the:
1. how much free space is available in the lob segment?
2 can I assume 'no LOB DATA' as the free space currently and even will be recovered once the segment will be shrunk?
3. no disadvantage of using "ALTER TABLE... SHRINK SPACE.
4. is it true if storage segment is 100 GB as many redo will be generated when trying to alter table... shrink the space?
I'm following the steps below.
1 find Segment name-> sys_lob123
2. find the size of storage - > 100 GB
3. find the size of the LOB data-> 70
4. find the size of the data not LOB-> 30
2. the storage size
Select 'storage' from dba_extents bytes
where nom_segment = 'sys_lob123. '
100 GB
3. the size of the LOB
Select dbms_lob.getlength (col_lob) in the table_lob;
70 GB
4. the size of the LOB data not
100-70 = 30 GB (i.e. #3 - #2)
Thanks in advance and enjoy your time looking into this...
Use DBMS_REDEFINITION to reorganize the LOB segment, it is the best way to retrieve a LOB segment space. Also use the clause "MEANS of COMPRESS" and SECURE LEADER, creating the temp table. There is no reason that you can use the BASIC FILE. It's online process, which means that your app can stay up to... However, make sure that monitor you the database when executing redef, as it can cause conflicts and slow down your application, in which case you must kill the reorg...
If this process is not feasible or overwhelms you, "ALTER TABLE MOVE" is another option.
With 'Displacement of Alter table', you need to rebuild all indexes after you move the LOB segment. Don't forget this is an offline process and your application needs a time out while you do this.
Here is the query to list the 10 LOBs albums in your database-
fixed line 160
Col a20 PROPRIETARY format
Col TABLE_NAME format a30
Col COLUMN_NAME format a30
Col nom_segment format a30
size col 999 999 999 format
SELECT *.
FROM (SELECT b.owner,
b.table_name,
b.column_name,
a.segment_name,
SUM (a.bytes) / (1024 * 1024) "size".
FROM dba_segments a, b dba_lobs
WHERE a.segment_name LIKE '% SYS_LOB '.
AND a.segment_name = b.segment_name
AND a.owner NOT IN ('SYS', 'SYSTEM', 'GENERAL', "OUTLN")
B.owner GROUP,
b.table_name,
b.column_name,
a.segment_name
ORDER BY DESC 5)
WHERE ROWNUM<>
-
Question by adding the LOBs-ORA-06502: PL/SQL: digital error or value
Hello
I'm using Oracle 11 g.
I have a requirement in which I need to add LOBs and I must insert the LOB in a table column. I am facing problem when the data exceeds certain limits. My program works like the following:
(Please note that my program logic is given below, not the exact program)
DECLARE
final_html CLOB.
int_html CLOB.
v_str VARCHAR2 (32767).
i the number: = 0;
BEGIN
DBMS_LOB.CREATETEMPORARY (lob_loc = > int_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
DBMS_LOB.CREATETEMPORARY (lob_loc = > final_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
dbms_output. ENABLE (1000000);
FOR i 1,100 loop
v_str: = "< b >" |
"< style td =" "DRESSING: break-word" width = "50" > < font size = "2" > ' | "
I have | ' < / police > < table > ' |
"< /tr >";
DBMS_LOB. WriteAppend (lob_loc = > int_html, amount = > LENGTH (v_str), BUFFER = > v_str);
END LOOP;
dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
dbms_output.put_line (' the int_html :'|| is int_html).
final_html: = "< html >" | int_html | "< / html > ';
dbms_output.put_line (' the final_html :'|| is final_html).
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
DBMS_LOB. CLOSE (int_html);
DBMS_LOB. CLOSE (final_html);
DBMS_LOB. FREETEMPORARY (int_html);
DBMS_LOB. FREETEMPORARY (final_html);
END;
When the loop is made of lesser value, say FOR example, the loop i IN 1.10, the program works very well, but when the closure is done for values more I'm ' - 6502-ORA-06502: PL/SQL: digital error or value ' error message.
Please help me solve this problem.
Thanking you in advance.
Kind regards
SriCan you please specify what environment you run this?
I modified your code as follows
The code executed successfully until the length has been<= 32767="" i.e="" (="" until="" for="" i="" in="">=>
In addition, you must use the function APPEND to concatenate variables clob.
Please check the maximum size by default for varchar2 or dbms_output in your server since you get the error for just the loop in the range (FOR i IN 1,100).
And Yes, Siva comments are valid.
DECLARE
final_html CLOB.
int_html CLOB.
v_str VARCHAR2 (32767).i the number: = 0;
BEGIN
DBMS_LOB.CREATETEMPORARY (lob_loc-online int_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
DBMS_LOB.CREATETEMPORARY (lob_loc-online final_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
dbms_output. ENABLE (1000000);FOR i 1.1092 loop
v_str: = '
' || ';
'' || ' ||
I have | '
'DBMS_LOB. WriteAppend (lob_loc-int_html, amount => (v_str), BUFFER LENGTH-online v_str online);
END LOOP;
dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
Start
dbms_output.put_line (' the int_html :'|| is int_html).
dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
exception when others then
dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
end;
/*
Start
final_html: = ''|| int_html | »';
dbms_output.put_line (' the final_html :'|| is final_html).
exception when others then
dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
end; */EXCEPTION
WHILE OTHERS THENdbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
DBMS_LOB. CLOSE (int_html);
DBMS_LOB. CLOSE (final_html);
DBMS_LOB. FREETEMPORARY (int_html);
DBMS_LOB. FREETEMPORARY (final_html);END;
Published by: Gurnani houta July 29, 2011 03:11
Published by: Gurnani houta July 29, 2011 03:14
-
I am facing a problem with the beep.vi. I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound. Everything works fine except the sound alarm. It gives the table 1 d of type mismatch. I tried to fix this by placing it in a box structure. But it still does not work. If someone could help? Please find attached my VI. Best wishes to all visitors to the Forums of Discussion OR.
Ihab El-Sayed
published here: http://forums.ni.com/t5/LabVIEW/Playing-sound-based-on-exceeding-a-threshold-value-1D-array-data/m-p...
-
Displacement of the LOB segments.
Is there a a way to move LOB segment, keeping the segment of the table? The statement:
ALTER table < tab > move lob (< lob >) store as (tablespace < TBS >)
moves not only the LOB segment, but also table segments, so consumes a lot of resources, needs to rebuild indexes etc.
Thank you.
If you move the lob segment, then the data of the line must change because the lob is in a different place. There is no way around that. The row stores a pointer to LOB. Oracle has decided to implement this in a way that makes all change of rowid (you can't influence that).
So, as I said - it's life.
-
How to use the LOB data type?
I can't create a table with the LOB data type.
Do I need an additional parameter in sys.odbc.ini?
My dsn information is
[tpch]
Driver=/home/TimesTen/TimesTen/tt1121/lib/libtten.so
Data store = / home/timesten/TimesTen/tt1121/tpch/tpch
LogDir = / home/timesten/TimesTen/tt1121/tpch/logs
PermSize = 4096
TempSize = 2048
PLSQL = 1
LOB = 1
DatabaseCharacterSet = US7ASCII
-bash-4, $ 1 ttdaemonadmin-version
TimesTen Release 11.2.1.2.0
There is no LOB = 1 attribute; Please, delete it from your definition ODBC to avoid potential errors.
LOB support has been added in the major version 11.2.2 TimesTen. So you use 11.2.1 LOB is not available. If you want to use LOB data, then you must upgrade to 11.2.2.
Chris
-
How to make the sum of hours which is the varchar2 data type in oracle
Hi my table is like this
emp_ngtshthrs (empno number (10), nightshifthrs varchar2 (20));
now I want sum employee nightshifthrs how do the sum hours, it's my hours 01:00, 05:00, 08:00, 10:00, 07:00 and 09:00
I want the sum type varchar2 hours how to do? and I want to display the sum is greater than 24:00Well, first of all you have posted your question in the wrong forum. You should have posted your question in the forum SQL and PL/SQL .
The second problem I see is that you are being too generic when you have your employees enter their night shift hours worked. If you are able, I recommend that you change your table to record hours separately from minutes and make columns of type NUMBER instead of the VARCHAR2() type. Then, you can simply use arithmatic to total the hours and minutes worked.
If you are locked in your table and cannot change it, you can convert characters to numbers and then perform your basic arithmatic on values. For example:
1 with tab1 as ( 2 select 10 as empno, '01:00' as nightshifthrs from dual union all 3 select 10 as empno, '05:00' as nightshifthrs from dual union all 4 select 10 as empno, '08:00' as nightshifthrs from dual union all 5 select 10 as empno, '10:00' as nightshifthrs from dual union all 6 select 10 as empno, '07:00' as nightshifthrs from dual union all 7 select 10 as empno, '09:00' as nightshifthrs from dual) 8 select sum(to_number(replace(nightshifthrs,':','.'))) AS hours_worked 9* from tab1 SQL> / HOURS_WORKED ------------ 40 SQL>
Of course, if your users can and do enter the minutes, then which complicates the example I provided. You will need to convert the decimal minute, sum the amount, then convert the decimal time and add this to your hours. For example:
1 with tab1 as ( 2 select 10 as empno, '01:15' as nightshifthrs from dual union all 3 select 10 as empno, '05:00' as nightshifthrs from dual union all 4 select 10 as empno, '08:30' as nightshifthrs from dual union all 5 select 10 as empno, '10:00' as nightshifthrs from dual union all 6 select 10 as empno, '07:45' as nightshifthrs from dual union all 7 select 10 as empno, '09:00' as nightshifthrs from dual) 8 select sum(to_number(substr(nightshifthrs,1,2))) + SUM(to_number(SUBSTR(nightshifthrs,4,5)))/60 9* from tab1 SQL> / HOURS_WORKED ------------ 41.5 SQL>
I hope this helps.
Craig...
-
ORA-02327: cannot create indexes on the LOB data type expression
DB 10.2.0.4
DB 5.2
I am not able to move lobindex and lobsegment. While try occurs below error
SQL > ALTER INDEX dev. "" SYS_IL0000718396C00002$ $"REBUILD THE TABLESPACE DATA_TEMP;
ALTER INDEX dev. "" SYS_IL0000718396C00002$ $"REBUILD TABLESPACE DATA_TEMP
*
ERROR on line 1:
ORA-02327: cannot create indexes on the LOB data type expression
Thank you
Published by: user13382934 on October 16, 2012 14:05correct syntax is
ALTER TABLE.MOVE the LOB (
)
STORE AS (tablespace); Where
is a name of the / columns LOB, not the name of the segment. Moving type LOB data will move its indexes as well. -
Calling a database procedure which returns the array as output parameters
Hello
I wanted to call a procedure that returns "T_Disponibilidad_Diaria".
Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
INDEX OF DIRECTORY;
Type R_Disponibilidad_Diaria is {Record
}
Please suggest me the best way to convert this type of array complex java object
Thanks in advance
Concerning
VidyaBut what you can do...
Try to create a new stored procedure, which returns the type of the database object.
In this procedure, you can call the original procedure.
Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?) -
Move the LOB to a new tablespace
I want the users tablespace LOB to some other tablespace. But when I tried I got the error set-aside. I moved all the objects corresponding to the particular schema, but not the LOB. Can you please explain why Cant I move the LOB. And if you can explain that I want to know the importance of the lob indexex. Thank you in advance.
SQL > select TABLE_NAME, INDEX_NAME, TABLESPACE_NAME from dba_lobs where owner = 'PC_DOM ';
TABLESPACE_NAME INDEX_NAME TABLE_NAME
------------------------------ ------------------------------ ------------------------------
PCSF_DOMAIN SYS_IL0000077924C00002$ $ USERS
PCSF_CPU_USAGE_SUMMARY SYS_IL0000077933C00006$ $ USERS
PCSF_REPO_USAGE_SUMMARY SYS_IL0000077936C00005$ $ USERS
PCSF_USER SYS_IL0000077940C00002$ $ USERS
PCSF_GROUP SYS_IL0000077944C00002$ $ USERS
PCSF_ROLE SYS_IL0000077948C00002$ $ USERS
PCSF_DOMAIN_USER_PRIVILEGE SYS_IL0000077952C00002$ $ USERS
PCSF_DOMAIN_GROUP_PRIVILEGE SYS_IL0000077956C00002$ $ USERS
8 selected lines.
SQL > alter table PCSF_DOMAIN move lob (SYS_IL0000077924C00002$) store as (tablespace TS_PC_DOM);
ALTER table PCSF_DOMAIN move lob (SYS_IL0000077924C00002$) store as (tablespace TS_PC_DOM)
*
ERROR on line 1:
ORA-00942: table or view does not existDo not use segment name of LOB but about the name of the column in the table and qualify the name of the table with the owner of the table if you are not logged in as owner of the table:
Try:
alter table PC_DOM.PCSF_DOMAIN move lob (
) store as ( tablespace TS_PC_DOM ); Each LOB column is materialized with 2 segments:
-a LOB segment containing LOB data
-a LOB index that is a structure designed to facilitate access to the LOB data in the LOB segment.Edited by: P. Forstmann on 22 July. 2011 20:48
Edited by: P. Forstmann on 22 July. 2011 20:52
-
Which is the best for design: Layout Editor 11g vs Plugin Word
Hello
I need information about the design of the model which is the best to use the Layout Editor in BI 11g or plugin Word publisher.
In my workplace, we are unable to decide which one to use for the design template.
Tried on google but have not found any useful information.
Share your ideas.
Thanks in advance.The new layout BI Publisher Editor to create reports which have an available interactive output type. The interactive Viewer allows to popup details, tables scrollables, filtering the table, table sorting and filtering through the various components of the report.
So, if you are interested in providing this kind of functionality, you can design reports with the layout editor.
Take a look at designer's guide of reports 11g for more details. Also, take a look at this: http://blogs.oracle.com/xmlpublisher/2011/02/interactive_reporting_with_bi.html
Thank you!
BIPuser -
move the lob segment fails with invalid identifier
Why this fails:
SQL > desc APPLSYS. WF_INBOUND_TABLE
Name Null? Type
----------------------------------------- -------- ----------------------------
Q_NAME VARCHAR2 (30)
MSGID NOT NULL RAW (16)
CORRID'ART VARCHAR2 (128)
PRIORITY NUMBER
NUMBER OF THE STATE
TIMESTAMP DELAY (6)
NUMBER OF EXPIRY
TIME_MANAGER_INFO TIMESTAMP (6)
NUMBER OF LOCAL_ORDER_NO
NUMBER OF CHAIN_NO
NUMBER OF THE CSCN
DSCN NUMBER
ENQ_TIME TIMESTAMP (6)
NUMBER OF ENQ_UID
ENQ_TID VARCHAR2 (30)
DEQ_TIME TIMESTAMP (6)
NUMBER OF DEQ_UID
DEQ_TID VARCHAR2 (30)
NUMBER OF RETRY_COUNT
EXCEPTION_QSCHEMA VARCHAR2 (30)
EXCEPTION_QUEUE VARCHAR2 (30)
NUMBER OF STEP_NO
NUMBER OF RECIPIENT_KEY
DEQUEUE_MSGID RAW (16)
USER_DATA SYSTEM. WF_PAYLOAD_T
SENDER_NAME VARCHAR2 (30)
SENDER_ADDRESS VARCHAR2 (1024)
NUMBER OF SENDER_PROTOCOL
ANYDATA USER_PROP
SQL > alter table APPLSYS. WF_INBOUND_TABLE move TABLESPACE APPS_TS_TX_DATA;
Modified table.
SQL > ALTER TABLE APPLSYS. WF_INBOUND_TABLE MOVE LOB (USER_PROP) STORE DID (TABLESPACE APPS_TS_TX_DATA);
*
ERROR on line 1:
ORA-00904: "USER_PROP": invalid identifieruser600570 wrote:
Well, no matter what the type is be, how to move to this segment?The segment does not move when the corresponding table is moved to new tablespace?
At least that's what I see.SQL> select * from v$version ; 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 SQL> create table t nologging as select * from applsys.wf_inbound_table where 1 = 2 ; Table created. SQL> select dbms_metadata.get_ddl('TABLE','T') from dual ; DBMS_METADATA.GET_DDL('TABLE','T') -------------------------------------------------------------------------------- CREATE TABLE "APPS"."T" ( "Q_NAME" VARCHAR2(30), "MSGID" RAW(16), "CORRID" VARCHAR2(128), "PRIORITY" NUMBER, "STATE" NUMBER, "DELAY" TIMESTAMP (6), "EXPIRATION" NUMBER, "TIME_MANAGER_INFO" TIMESTAMP (6), "LOCAL_ORDER_NO" NUMBER, "CHAIN_NO" NUMBER, "CSCN" NUMBER, "DSCN" NUMBER, "ENQ_TIME" TIMESTAMP (6), "ENQ_UID" NUMBER, "ENQ_TID" VARCHAR2(30), "DEQ_TIME" TIMESTAMP (6), "DEQ_UID" NUMBER, "DEQ_TID" VARCHAR2(30), "RETRY_COUNT" NUMBER, "EXCEPTION_QSCHEMA" VARCHAR2(30), "EXCEPTION_QUEUE" VARCHAR2(30), "STEP_NO" NUMBER, "RECIPIENT_KEY" NUMBER, "DEQUEUE_MSGID" RAW(16), "USER_DATA" "SYSTEM"."WF_PAYLOAD_T" , "SENDER_NAME" VARCHAR2(30), "SENDER_ADDRESS" VARCHAR2(1024), "SENDER_PROTOCOL" NUMBER, "USER_PROP" "SYS"."ANYDATA" ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING STORAGE(INITIAL 40960 NEXT 40960 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "APPLSYSD" OPAQUE TYPE "USER_PROP" STORE AS LOB ( ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 CACHE STORAGE(INITIAL 40960 NEXT 40960 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) SQL> select owner, table_name, column_name, segment_name, tablespace_name from dba_lobs 2 where table_name = 'T' ; OWNER TABLE_NAME ------------------------------ ------------------------------ COLUMN_NAME ----------------------------------------------------------------------------------------------------------------------------------- SEGMENT_NAME TABLESPACE_NAME ------------------------------ ------------------------------ APPS T USER_PROP SYS_LOB0000365381C00035$$ APPLSYSD SQL> alter table t move tablespace APPLSYSX ; Table altered. SQL> select dbms_metadata.get_ddl('TABLE','T') from dual ; DBMS_METADATA.GET_DDL('TABLE','T') -------------------------------------------------------------------------------- CREATE TABLE "APPS"."T" ( "Q_NAME" VARCHAR2(30), "MSGID" RAW(16), "CORRID" VARCHAR2(128), "PRIORITY" NUMBER, "STATE" NUMBER, "DELAY" TIMESTAMP (6), "EXPIRATION" NUMBER, "TIME_MANAGER_INFO" TIMESTAMP (6), "LOCAL_ORDER_NO" NUMBER, "CHAIN_NO" NUMBER, "CSCN" NUMBER, "DSCN" NUMBER, "ENQ_TIME" TIMESTAMP (6), "ENQ_UID" NUMBER, "ENQ_TID" VARCHAR2(30), "DEQ_TIME" TIMESTAMP (6), "DEQ_UID" NUMBER, "DEQ_TID" VARCHAR2(30), "RETRY_COUNT" NUMBER, "EXCEPTION_QSCHEMA" VARCHAR2(30), "EXCEPTION_QUEUE" VARCHAR2(30), "STEP_NO" NUMBER, "RECIPIENT_KEY" NUMBER, "DEQUEUE_MSGID" RAW(16), "USER_DATA" "SYSTEM"."WF_PAYLOAD_T" , "SENDER_NAME" VARCHAR2(30), "SENDER_ADDRESS" VARCHAR2(1024), "SENDER_PROTOCOL" NUMBER, "USER_PROP" "SYS"."ANYDATA" ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING STORAGE(INITIAL 40960 NEXT 40960 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "APPLSYSX" OPAQUE TYPE "USER_PROP" STORE AS LOB ( ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 CACHE STORAGE(INITIAL 40960 NEXT 40960 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) SQL> select owner, table_name, column_name, segment_name, tablespace_name from dba_lobs 2 where table_name = 'T' ; OWNER TABLE_NAME ------------------------------ ------------------------------ COLUMN_NAME ----------------------------------------------------------------------------------------------------------------------------------- SEGMENT_NAME TABLESPACE_NAME ------------------------------ ------------------------------ APPS T USER_PROP SYS_LOB0000365381C00035$$ APPLSYSX SQL> drop table t purge ; Table dropped.
If you want to be able to move the segment to a different tablespace to the table, I guess that's not possible. Oracle only allows LOB to be stored in a separate tablespace as the corresponding table provided that they are defined as the LOBs explicitly during the creation of the table, unlike the LOB created by oracle internally because of the column datatype being ANYDATA as in this case.
-
I am trying to write a PL/SQL procedure that will move all my lob segments in a tablespace again (this is for when a dev environment is created... lots of storage & compaction of the things endure us in the production takes place then!)
I know that the SQL is:
But I want to build these declarations programmatically by querying views user_ or all_. I don't know where to start. If I look in WHERE USER_SEGMENTS, I see segments with names like SYS_LOB0000048001C00017$ $... but I don't know what the table in order to begin to construct the statement "alter table...". ». (In other words, I think I reason that the command ' alter table SYS_LOB0000048001C00017$ $ move lob... ") ("wouldn't be correct).alter table X move lob (name-of-lob) store as tablespace NEWTBS;
Similarly, the SQL will require me to know the name of the lob, I think, and that should be the name of the column in the table. But what view will allow me to extract this information, so I can complete my little building SQL?
Can someone point me in the right direction please?
Oh, and also: in WHERE USER_SEGMENTS, I see that I have «LOBSEGMENT "and types of segment"LOBINDEX"... assuming that the above SQL moves lob segments, how can I move the index business?»I think that you are looking for the table USER_LOBS (or ALL_LOBS or DBA_LOBS). Who has the TABLE_NAME, COLUMN_NAME and nom_segment. So I expect that you are looking for something like (not tested)
FOR x IN (SELECT * FROM user_lobs) LOOP EXECUTE IMMEDIATE 'ALTER TABLE ' || x.table_name || ' MOVE LOB (' || x.segment_name || ') STORE AS TABLESPACE newtbs'; END LOOP;
Justin
Published by: Justin Cave on October 7, 2009 12:03 AM
Fixed formatting
Maybe you are looking for
-
Mac programs show recent "bad" items
First of all, thank you for reading my question! I have difficulties to access the "recent items" when right click on native Mac programs (for example, a clip, Pages, Quicktime, etc.). The programs demonstrate quite recent items, but these "recent it
-
Ideas: I had problems with google before but everything was OK after uninstalling all programs of google Error messages like end of google, but that was before I change web browser safari because some time cannot open internet explore it, but so far,
-
Impossible to put my laptop as wifi hotspot network
Hello refugees, My laptop: HP G62 Notebook PC (purchased at Oman on 2010/10/10) Product number: WZ663EA #ABV OS: Windows 7 Home Basic - 64 bit Network card: Broadcom 4313 802.11 & Realtek PCIe FE Family Controller & Microsoft Virtual wifi Miniport ad
-
Pavilion g6 - B7D20UA #ABA: LEDs blink code... 7 times?
First of all, I know that when the problem started. It was the day after I bought it, and it was abandoned on floor 3 ft. I tried to use an external monitor, changed the LED screen, "well-known work" ram and hard drive and reset all connections, no
-
My wallpaper looks like 2 screens split into two?
original title: my wallpaper looks like 2 screens in half? Clues please it's driving me crazy My wallpaper looks like 2 screens split into two? If I put my background and it shows that the update but does not appear. Setting shows 2 monitors but sec