Change Tablespace of a table with LONG column
I have a 9i database that I have just gotten control of. At this point there is just one big dictionary managed tablespace for everything created by users. I am trying to move to multiple locally managed tablespaces with fixed extent sizes but I have run into a problem.
I have one table with one LONG datatype column. Apparently there is a huge amount of work involved to change the code if I make it a BLOB so that is out.
At this point I would like to change the tablespace of this table but I can't move it the normal way because of the LONG column. I have found mention of being able to do this with "COPY" but I can't find any documentation on the "COPY" command in the 9i Docs.
Any help would be appreciated,
Chris S.
Chris-
Can't you create your new table ahead of time in your new tablespace?
You could then use a statement like:
COPY FROM old/your_password@olddb TO new/your_password@newdb -
REPLACE NEWTABLE -
USING SELECT * FROM OLDTABLE;
Similar Messages
-
Exporting a table with Long datatype col. name
Hello,
I need help exporting a table, One of the column is long datatype.
How can I do this without using Export Util?
Is it possible.
(If someone has a solution then PLEASE Email
me)
URGENT.
Thanks.
Pankaj Patel.Just wanted to find out, if you already solved this problem. I have a similar issue with long column. I am trying to sql dump a table with long column that will be imported into another database(probably using sql*load), but the spooled file puts the data from the long column in separate lines 80 char long and not on a single line. I have set the long to 64000 and linesize to 32000. Wrap is on too.
null -
Error inserting a row into a table with identity column using cfgrid on change
I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
update table (xxx,xxx,xxx)
values (uu,uuu,uu)
My component
<!--- Edit a Media Type --->
<cffunction name="cfn_MediaType_Update" access="remote">
<cfargument name="gridaction" type="string" required="yes">
<cfargument name="gridrow" type="struct" required="yes">
<cfargument name="gridchanged" type="struct" required="yes">
<!--- Local variables --->
<cfset var colname="">
<cfset var value="">
<!--- Process gridaction --->
<cfswitch expression="#ARGUMENTS.gridaction#">
<!--- Process updates --->
<cfcase value="U">
<!--- Get column name and value --->
<cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
<cfset value=ARGUMENTS.gridchanged[colname]>
<!--- Perform actual update --->
<cfquery datasource="#application.dsn#">
UPDATE SP.MediaType
SET #colname# = '#value#'
WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
</cfquery>
</cfcase>
<!--- Process deletes --->
<cfcase value="D">
<!--- Perform actual delete --->
<cfquery datasource="#application.dsn#">
update SP.MediaType
set Deleted=1
WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
</cfquery>
</cfcase>
<cfcase value="I">
<!--- Get column name and value --->
<cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
<cfset value=ARGUMENTS.gridchanged[colname]>
<!--- Perform actual update --->
<cfquery datasource="#application.dsn#">
insert into SP.MediaType (#colname#)
Values ('#value#')
</cfquery>
</cfcase>
</cfswitch>
</cffunction>
my table
mediatype:
mediatypeid primary key,identity
mediatypename
my code is
<cfform method="post" name="GridExampleForm">
<cfgrid format="html" name="grid_Tables2" pagesize="3" selectmode="edit" width="800px"
delete="yes"
insert="yes"
bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
{cfgridrow},
{cfgridchanged})">
<cfgridcolumn name="MediaTypeID" header="ID" display="no"/>
<cfgridcolumn name="MediaTypeName" header="Media Type" />
</cfgrid>
</cfform>
on insert I get the following error message ajax logging error message
http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
{"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
ThanksIs this with the Travel database or another database?
If it's another database then make sure your columns
allow nulls. To check this in the Server Navigator, expand
your DataSource down to the column.
Select the column and view the Is Nullable property
in the Property Sheet
If still no luck, check out a tutorial, like Performing Inserts, ...
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
John -
Error while importing a table with BLOB column
Hi,
I am having a table with BLOB column. When I export such a table it gets exported correctly, but when I import the same in different schema having different tablespace it throws error
IMP-00017: following statement failed with ORACLE error 959:
"CREATE TABLE "CMM_PARTY_DOC" ("PDOC_DOC_ID" VARCHAR2(10), "PDOC_PTY_ID" VAR"
"CHAR2(10), "PDOC_DOCDTL_ID" VARCHAR2(10), "PDOC_DOC_DESC" VARCHAR2(100), "P"
"DOC_DOC_DTL_DESC" VARCHAR2(100), "PDOC_RCVD_YN" VARCHAR2(1), "PDOC_UPLOAD_D"
"ATA" BLOB, "PDOC_UPD_USER" VARCHAR2(10), "PDOC_UPD_DATE" DATE, "PDOC_CRE_US"
"ER" VARCHAR2(10) NOT NULL ENABLE, "PDOC_CRE_DATE" DATE NOT NULL ENABLE) PC"
"TFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS"
" 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TS_AGIMSAPPOLOLIVE030"
"4" LOGGING NOCOMPRESS LOB ("PDOC_UPLOAD_DATA") STORE AS (TABLESPACE "TS_AG"
"IMSAPPOLOLIVE0304" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE L"
"OGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEF"
"AULT))"
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'TS_AGIMSAPPOLOLIVE0304' does not exist
I used the import command as follows :
imp <user/pwd@conn> file=<dmpfile.dmp> fromuser=<fromuser> touser=<touser> log=<logfile.log>
What can I do so that this table gets imported correctly?
Also tell me "whether the BLOB is stored in different tablespace than the default tablespace of the user?"
Thanks in advance.Hello,
U can either
1) create a tablespace with the same name in destination where you are trying to import.
2) get the ddl of the table, modify the tablespace name to reflect the existing tablespace name in destination and run the ddl in the destination database, and run your import command with option ignore=y--> which will ignore all the create errors.
Regards,
Vinay -
Convert a table with one column to panelList with outputText
Hi,
I have a table with one column, I would like to change it to use panelList to present it instead. What will be the syntax for panelList?
<af:table value="#{bindings.ItasUiRuleParamsVO2.collectionModel}"
var="row"
rows="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
emptyText="#{bindings.ItasUiRuleParamsVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.ItasUiRuleParamsVO2.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasUiRuleParamsVO2.collectionModel.makeCurrent}"
rowSelection="single" id="t2"
partialTriggers="::t1">
<af:column sortProperty="RuleName" sortable="true"
headerText="#{bindings.ItasUiRuleParamsVO2.hints.RuleName.label}"
id="c11">
<af:outputText value="#{row.RuleName}"
id="ot11"/>
</af:column>
</af:table>
I tried this:
<af:panelList id="pl1">
<af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}">
<af:outputText value="#{item.RuleName}" id="ot14"/>
</af:forEach>
</af:panelList>
but the error say:
javax.servlet.jsp.JspException: "items" must point to a List or array
at org.apache.myfaces.trinidadinternal.taglib.ForEachTag.doStartTag(ForEachTag.java:136)
Any ideas?
Thanks
-Mina<af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}" var="row">
<af:outputText value="#{row.RuleName}" />
</af:forEach>
and make sure the table binding is still in place in your pagedef (or binding tab) -
In a recent project I've had the need of a Java Swing table with frozen columns.
After a long research at the Swing forum at java.sun.org and google I found out that
1. Currently there is no proper Open Source solution
2. All the postings at sun are good concepts, but far away from solutions
3. The only (for me )acceptable commercial solution is the JCTable from Quest (formerly KGroup)
Since I want to have full control over the source code of the table, I decided to collect all the tips from this forums and write my own table.
Here is the my first result:
http://jroller.com/resources/kriede/CoolTable.java
The main idea is to have two tables, one for the locked columns (=fixed columns = frozen columns) and one for the scrollable columns. With all the tips from this forum it was more or less a puzzle to make it work pretty. The next task will be to provide a JTable-like interface, meaning to write delegate/adapter methods to the API of the two nested JTable instances.The FixedColumnExample from the link that you provided doesn't work with JDK 1.3 or higher.
Anyway, putting a seperate table for the fixed columns into the row header is the first step to solve the problem of fixed columns.
The next problem is to synchonize the scrolling behaviour of the two tables. The FixedColumnExample tries to do it by overwriting the valueChange method (maybe this was working with JDK 1.8), but with JDK 1.2 or higher it is recommended to use ChangeListeners. That's what I am doing, as also described here: http://www.chka.de/swing/components/JScrollPane-bugfix.html.
Another problem is navigation with the tab or arrow keys: The default actions for those events move the selection only within one JTable. It would be nicer, if e.g. the tab key moves the selection within one row across both, the fixed and the scrollable columns.
Those problems and some more are solved in the CoolTable sample:
http://jroller.com/resources/kriede/CoolTable.java
Please try it out and send comments. -
Exporting Table with CLOB Columns
Hello All,
I am trying to export table with clob columns with no luck. It errors saying EXP-00011TABLE do not exist.
I can query the table and the owner is same as what i am exporting it from.
Please let me know.An 8.0.6 client definitely changes things. Other posters have already posted links to information on what versions of exp and imp can be used to move data between versions.
I will just add that if you were using a client to do the export then if the client version is less than the target database version you can upgrade the client or better yet if possilbe use the target database export utility to perform the export.
I will not criticize the existance of an 8.0.6 system as we had a parent company dump a brand new 8.0.3 application on us less than two years ago. We have since been allowed to update the database and pro*c modules to 9.2.0.6.
If the target database is really 8.0.3 then I suggest you consider using dbms_metadata to generate the DDL, if needed, and SQLPlus to extact the data into delimited files that you can then reload via sqlldr. This would allow you to move the data with some potential adjustments for any 10g only features in the code.
HTH -- Mark D Powell -- -
While talking with a friend, he was telling me that sometimes he uses tables with 300 columns which will only be accessed once for information extraction. For me this is a bit strange because 300 columns looks like a lot of columns for me...
Having tables with so many columns is a common practice in Data Warehousing? If yes, can you explain me on which situations this can happen and how often?
RegardsWe have tables with cca 150 columns.
You need to know that we are not talking about relational systems that are normalized. Its common practise when bilding data warehouse. Number of columns in your tables will depend on complexity and size of your warehouse, and number, size and complexity of your source systems.
Point is that even now, when data warehouse is "finished", we still add/remove columns as warehouse changes as the source systems change. -
Dropping a column in composite xmltype table with virtual column
Hello,
i found some interesting behavior. I have a table with xmltype column and a virtual column. If i drop a column, which has an index smaller than the index for the xmltype column, than the virtual column reference for xmltype column is not changed.
select * from v$version;
drop table t_xml purge;
create table t_xml( c1 number,
c2 number,
cxml xmltype,
c3 number,
xmlflag number as (nvl2(cxml,1,0)));
select * from t_xml;
alter table t_xml drop column c2;
select * from t_xml; The 2nd select will result in error:
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> alter table t_xml drop column c2;
Tabelle wurde geändert.
SQL>
SQL> select * from t_xml;
select * from t_xml
FEHLER in Zeile 1:
ORA-00904: "SYS_NC00004$": ungültiger BezeichnerNow the virtual column xmlflag references still the old hidden column for cxml (SYS_NC00004$). It not references the new hidden column, which is now SYS_NC00003$.
I think, it is a bug! Can someone inform oracle? I have no access to metalink.Hi,
Please try this code:
loop at int_inv into wa_inv.
lv_count = lv_count + 1.
AT END OF posnr. <------- The field you want to sum..
gs_total-posnr = wa_inv-posnr.
gs_total-cov_total = lv_count.
APPEND gs_total TO gt_total.
CLEAR : gs_total,
lv_count,
wa_inv.
ENDAT.
ENDLOOP. -
Troubles when trying to transfer a table with hierarchical column to a tree
In WD for ABAP, I encounter many troubles when trying to transfer a table with hierarchical column to an actual tree. In my UI, the tree is in the left pane and the detail for a node is in the right.
1. With hierarchical table, I can bind the dataSource of the table directly to the context node in View which is mapped to a context node in component controller which is a DDIC structure. But with a tree, is it possible to map the dataSource of the tree or node in tree to context node in component controller?
2. With hierarchical table, when lead selection changed, the detail info in the right pane will change automatically. But with a tree, it seems to have to be implemented via action by myself.
Can anyone give some suggestions to overcome these troubles?Wei,
<i>With tree table, the dataSource of the table is just bound to the context node ORG_UNIT</i>
Hmmm... You said, that this node resides in component controller, not in view controller. Or does it?
Any recursive node that can be displayed with tree table can be displayed with tree as well. Period.
1. Create tree and bind data source to the same node as table data source.
2. Create tree node type and bind it to the same node again.
3. Create one additional calculated attribute in forementioned node (type boolean) that inverts/negates attribute for table column "hasChildren" to tree node "isLeaf".
4. That's all.
VS -
ASSM and table with LOB column
I have a tablespace created with ASSM option. I've heard about that tables with LOB columns can't take the advantage of ASSM.
I made a test : create a table T with BLOB column in a ASSM tablespace. I succeeded!
Now I have some questions:
1. Since the segments of table T can't use ASSM to manage its blocks, what's the actrual approach? The traditional freelists??
2. Will there be some bad impacts on the usage of the tablespace if table T becomes larger and larger and is used frequently?
Thanks in advance.Can you explain what you mean by #1 because I believe it is incorrect and it does not make sense in my personal opinion. You can create a table in an ASSM tablespace that has a LOB column from 9iR2 on I believe (could be wrong). LOBs don't follow the traditional PCTFREE/PCTUSED scenario. They allocate data in what are called "chunks" that you can define at the time you create the table. In fact I think the new SECUREFILE LOBs actually require ASSM tablespaces.
HTH! -
Hi!
I have to export table with lob column (3 GB is the size of lob segment) and then drop that lob column from table. Table has about 350k rows.
(I was thinking) - I have to:
1. create new tablespace
2. create copy of my table with CTAS in new tablespace
3. alter new table to be NOLOGGING
4. insert all rows from original table with APPEND hint
5. export copy of table using transport tablespace feature
6. drop newly created tablespace
7. drop lob column and rebuild original table
DB is Oracle 9.2.0.6.0.
UNDO tablespace limited on 2GB with retention 10800 secs.
When I tried to insert rows to new table with /*+append*/ hint operation was very very slow so I canceled it.
How much time should I expect for this operation to complete?
Is my UNDO sufficient enough to avoid snapshot too old?
What do you think?
Thanks for your answers!
Regards,
Marko SuticI've seen that document before I posted this question.
Still I don't know what should I do. Look at this document - Doc ID: 281461.1
From that document:
FIX
Although the performance of the export cannot be improved directly, possible
alternative solutions are:
+1. If not required, do not use LOB columns.+
or:
+2. Use Transport Tablespace export instead of full/user/table level export.+
or:
+3. Upgrade to Oracle10g and use Export DataPump and Import DataPump.+
I just have to speed up CTAS little more somehow (maybe using parallel processing).
Anyway thanks for suggestion.
Regards,
Marko -
Hi,
I have a proble. How to move a table with LOB colum? How to create a table with LOB column by specifying another tablespace for LOB column?
Please help me.
Regards,
MathewWhat is it that you are not able to find?
The link that I provided was answer to your second question. -
Find size of table with XMLTYPE column STORE AS BINARY XML
Hi,
I have a table with structure as:
CREATE TABLE XML_TABLE_1
ID NUMBER NOT NULL,
SOURCE VARCHAR2(255 CHAR) NOT NULL,
XML_TEXT SYS.XMLTYPE,
CREATION_DATE TIMESTAMP(6) NOT NULL
XMLTYPE XML_TEXT STORE AS BINARY XML (
TABLESPACE Tablespace1_LOB
DISABLE STORAGE IN ROW
CHUNK 16384
RETENTION
CACHE READS
NOLOGGING)
ALLOW NONSCHEMA
DISALLOW ANYSCHEMA
TABLESPACE Tablespace2_DATA
- So HOW do I find the total size occupied by this table. Does BINARY storage work as LOB storage. i.e. I need to consider USER_LOBS as well for this.
OR foll. will work
select segment_name as tablename, sum(bytes/ (1024 * 1024 * 1024 )) as tablesize_in_GB
From dba_segments
where segment_name = 'XML_TABLE_1'
and OWNER = 'SCHEMANAME'
group by segment_name ;
- Also if I am copying it to another table of same structure as:
Insert /*+ append */ into XML_TABLE_2 Select * from XML_TABLE_1.
Then how much space in ROllbackSegment do I need. Is it equal to the size of the table XML_TABLE_1?
Thanks..I think foll query calculates it right while including the LOB storage as:
SELECT SUM(bytes)/1024/1024/1024 gb
FROM dba_segments
WHERE (owner = 'SCHEMA_NAME' and
segment_name = 'TABLE_NAME')
OR (owner, segment_name) IN (
SELECT owner, segment_name
FROM dba_lobs
WHERE owner = 'SCHEMA_NAME'
AND table_name = 'TABLE_NAME')
It's 80 GB for our Table with XMLType Column.
But for the second point:
Do we need 80GB of UNDO/ROLLBACK Segment for performing:
Insert /*+ append */ into TableName1 Select * from TableName;
Thanks.. -
HOW TO CREATE A TABLE WITH 800 COLUMNS?
I have to create a table with 800 columns.I know the create statement to create a table but it will take more time.
So tell me the other method.If you really think that you have to store 800 values for a given entity, it would be a wise idea if you store you information in columnar fashion. Make a main table and a attribute table, keep the primary identifier in the main table and store other attributes in the attribute table where you can keep the primary key of the first table as foreign key (not necessary) to maintain the relationship.
eg.
emp_id
emp_name
dob
city
state
country
pincode
1
Mr X
01/01/1990
ABC
ZXC
MMM
12345
Can be stored as
Main Table
emp_id
emp_name
1
Mr X
Attribute Table
attr_id
emp_id
attr_nam
attr_value
1
1
dob
01/01/1990
2
1
city
ABC
3
1
state
ZXC
4
1
country
MMM
5
1
pincode
12345
Creating table with large number of columns is bad design as suggested by other Gurus.
Thanks
Maybe you are looking for
-
We have a public SSL certificate that allows for Active Directory sync with LDAPS on port 636 with our email smart host. This was working fine and suddenly stopped working and we are now getting SChannel errors Event ID 36869. There were no changes m
-
I have only just gone wireless and now my trusted ATV has access to the internet! All good stuff, YouTube works fine, syncing all works fine but when I click on Movie Trailers I get a message saying 'Downloading trailers' with a spinning wheel which
-
Does OSX do "backward compatibility to Acrobat Reader version 6"?
I need to prepare a PDF file from my Pages document, and it required to provide "backward compatibility to Acrobat Reader version 6." Apparently this is something Acrobat Distiller can do but I don't have that app. How can I get Pages to make such a
-
Why is the Printer drive not a printer driver
do the people at hp understand what a printer drivers is ? at my company we can install new printer if they use a "STANDER WINDOWS DRIVER" we can not execute an *.exe file we have to call tech support to get this done and open a ticket. your making
-
Spent 2 days googling, trying, restoring. Is it possible to have Win7 and extra ntfs partition?