Moving tables to a new default tablespace
I want to move all the tables owned by a user (OUTLN) to a new tablespace.
I know that if I make an export file of that schema and then I make an import after deleting the tables and changing the default tablespace of that schema I should solve the problem (as suggested from documentation), but it isn't so.
The tablespace of the tables after the import remains the same.
Why?
Thank you
I want to move all the tables owned by a user (OUTLN) to a new tablespace.
I know that if I make an export file of that schema and then I make an import after deleting the tables and changing the default tablespace of that schema I should solve the problem (as suggested from documentation), but it isn't so.
The tablespace of the tables after the import remains the same.
Why? If you are concerned about importing large number of tables to a different tablespace, you can do it in this way. After exporting the tables, import them to a .sql file. In other words, tables does not get imported by this method to the database but the "create table" script is generated for the tables. Then you can edit this .sql file using any text editor, replace all the tablespace names with the tablespace name you want. Then run the script. Remember to remove the "Rem" comment words. The following syntax will help you to do this.
c:\>imp80 scott/tiger file=c:\tabledump.dmp indexfile=c:\tablecreate.sql full=y
Here, though we say "indexfile", it generates full create table script.
In order to import the data, re-run the import without indexfile option and with ignore=y option.
Hope this will help.
Regards,
R. Magesh.
Similar Messages
-
Can we change the default tablespace of a table?
Hi All,
Can we change the default tablespace for any TABLE while it contains any data? If yes, how it works? If no, any workaround?
Thanx,
Zaafinstead of moving your table after the import you could:
1)execute an import with the parameter ROWS = N
2)move the empty tables to the correct tablespace
3)execute an impot with ROWS = Y and IGNORE = Y
This way you will only have to move empty tables which will probably be much faster also there is no need to rebuild the indexes. -
Oracle 11gR2 Partition tables not creating in default user tablespace
Hi all:
Not sure if i'm missing something or overlooked but when i create a partition table in a user schema, it is not creating in the schema's default tablespace instead creating with no assigned to any and using SYSTEM tablesspace.
create user dgp identified by dgp default tablespace dgp temporary tablespace temp;
grant connect, resource to dgp;select USERNAME,DEFAULT_TABLESPACE from dba_users where username ='DGP';
USERNAME DEFAULT_TABLESPACE
DGP DG
select table_name, tablespace_name, partitioned from all_tables where owner='DGP';
TABLE_NAME TABLESPACE_NAME PAR
AUDITLOG_P2 DG NO
AUDITLOG_P YES
This is the partition script i used --i also gave the tablespace name:
CREATE TABLE dgp.AUDITLOG_P(
entry_time DATE,
username VARCHAR2(14),
groupname VARCHAR2(100),
ip VARCHAR2(15),
command VARCHAR2(15),
directory VARCHAR2(300)
PARTITION BY RANGE (entry_time)
partition P_PAST VALUES LESS THAN (TO_DATE('2010-01-01','YYYY-MM-DD')),
tablespace DG;
============
What is it i'm missing? Anything different with Oracle 11gR2 on the partition creations?
Thanks for your help..
Regards,
AshYes, i tried using the schema login adn creating the table as well as system with schemaname prefix....
this is what i get from the below
SQL> select def_tablespace_name from dba_part_tables where table_name ='AUDITLOG_P';
DEF_TABLESPACE_NAME
DG
SQL> select partition_name, tablespace_name from dba_tab_partitions where table_name='AUDITLOG_P';
PARTITION_NAME TABLESPACE_NAME
P_PAST DG
P_20100101 DG
P_20100102 DG
P_20100103 DG
P_20100104 DG
P_20100105 DG
P_20100106 DG
P_20100107 DG
P_20100108 DG
P_20100109 DG
P_20100110 DG
P_20100111 DG
P_20100112 DG
P_20100113 DG
P_20100114 DG
P_20100115 DG
P_20100116 DG
P_20100117 DG
P_20100118 DG
P_20100119 DG
P_20100120 DG
P_20100121 DG
P_20100122 DG
P_20100123 DG
P_20100124 DG
P_20100125 DG
P_20100126 DG
P_20100127 DG
P_20100128 DG
P_20100129 DG
P_FUTURE DG
31 rows selected. -
Migrating a large table containing clobs to a new dedicated tablespace.
Hi All
I am seeking some advice on something.
I have a Oracle 10g live database with a table used for auditing purposes, this table has 5.8 million rows and contains clob data. When I last performed a full export of this table using data pump the dump file was around 40GB in size and as you can imagine took a long amount of time to complete.
This table is currently located within the main data table space, with that in mind I am looking at moving this table to a new dedicated table space onto dedicated hard disks. Theory being this will allow easier DBA administration regarding separate rman backups of this new table space and improve performance on the main data table space, writes to the audit table will now be on separate disks in a dedicated table space. I have a test system that is a complete copy of live I can use to test this.
Can anyone advise the best way to achieve the transfer of the audit table to the new table space, I intend to create a new table space of the same size on the located on separate dedicated disks.
Option 1
I Presume there are two main options, a full data export of the table and then reimport into the new table space ensuring to rebuild index's? While doing so I presume the database would need to be inaccessible to users? otherwise inserts will be done to the source table I am trying to migrate to the new table space? I think I would need to take the system offline while doing this anyway as the system would perform alot slower while the export is taking place.
Option 2
Use the alter table move table space feature? I am new to the DBA role so I have little knowledge on this function.
Please can you advise which of the above would be the best cause of action, or if deed there is any other options/solutions I am not aware of?
Many Thanks in advance.Actually, most queries are using an index range scan or index full scan.
But, just for the sake of this discussion, here is the simple query I mentioned.
Note that my concern is of the chained or migrated rows, and how to resolve them.
But if my table contains 520 columns, how can I get around intra-block chaining?
The question also still remains how can I tell the difference between row chaining, row migration, and intra-block chaining and which is it that is showing up in dba_tables.chained_cnt?
simple query:
SELECT C536870916,COUNT(T2179.C536881135)
FROM aradmin.T2179
WHERE ((T2179.C536871037 = 'Trouble') AND ((T2179.C536870944 = 'New')
OR (T2179.C536870944 = 'Assigned') OR (T2179.C536870944 = 'On Hold')))
GROUP BY C536870916
ORDER BY C536870916
Explain plan for simple query is:
SELECT STATEMENT
SORT GROUP BY NOSORT
TABLE ACCESS BY INDEX ROWID
INDEX FULL SCAN
Also, on this table of 520 columns, there are already 61 indexes, of which 20 are LOB indexes, and one FB index. All others are normal indexes.
My thinking on moving the table is that I would have to rebuild each and every index, however, I'm not sure how to rebuild LOB or FB indexes.
So, back to my original question: can I safely "move" a table containing several CLOB columns and also how do I rebuild the LOB indexes?
Thanks. -
Create new user with default tablespace
I have created a new tablespace, now i want to create new user but i cannot mention default tablespace and temporary tablespace for the new user.
how to do this in oracle xe ???That's right. Additionally, you can use assistant to perform this task. In the near future you may want to have the SQL Reference handy: http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
As well as the specific XE Reference manuals: http://www.oracle.com/pls/xe102/homepage?remark=tahiti
HR Madrid -
BC4J temporary tables - default tablespace
I have database Oracle database 9i. I have created database user by CREATE USER "DBUSER" PROFILE "DEFAULT" IDENTIFIED BY "dbuser" DEFAULT TABLESPACE "MYTABLESPACE" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
So I expect all tables are created inside ORDBS tablespace. They do - but only my application tables. BC4J temporary tables (PCOLL_CONTROL, ...) are created inside "USERS" tablespace, not MYTABLESPACE nor TEMP.
Why? I don't want they are created inside users but don't know how to change it...
Any idea?
Thank you very much for any comment
Jan Pechanec
PS. I use JDeveloper 9.0.3.4Hi Steve/Nick,
I am facing a similar kind of problem in oracle 9iAS(90220). A few days back there was a lot of user activity in one of the application modules and 7 PS_<app.module.name(s)> tables were created with around 7GB of size which eventually filled up the entire tablespace(100%). I spoke to the developers about the attributes that need to be set for Row spill over feature discussed in this forum but they said after lots of testing they have set those values and cannot be changed.
Could you please suggest me how can I ensure that, next time any application module specific PS_ tables will get created I can route them to different tablespace based on the module name. (I donot want to move them after they are created, to a different tablespace) Please let me know asap so that I can implement it and avert any future problems.
Thanks & regards,
Ramana -
Table created by datapump imp/exp, change default tablespace?
Is there a way, without changing the users default tablespace, to force the table created by data pump import or export to go to a different tablespace than the users default? Our policy is that users must declare the tablespace they want an object created in, therefore the users tablespace is very small (6M), so if they accidently created an object in this TS it would fail. When we run expdp, this default tablespace fills up and export fails. I can't find a parameter in the documentation on giving an alternative tablespace for this table.
When you run expdp, it creates a table under the user you logged in as. This table is used to keep track of the datapump process. I am looking for a way to direct datapump to create this table in a specific tablespace instead of the users default.
-
Problem in Creating a table with Default Tablespace
Hi All,
1) Can anybody plz tell me the syntax to move a table from one tablespace to another.
2) Also, plz tell me the Syntax of when creating a table specifying the tablespace name also.
Regards1) Alter table <table_name> move tablespace <tablespace_name>
2) example of create table is given below
CREATE TABLE emp123
( employee_id NUMBER(6)
TABLESPACE <tablespace_name>
STORAGE (INITIAL 600
NEXT 600
MINEXTENTS 2
MAXEXTENTS 100 );
Read following doc for more details
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
Cheer,
Virag -
Moving table columns is very slow
In my application moving table columns is very slow, with the rendering of table cells dragging behind the rendering of the table cell (using Java 1.5). I use a custom table cell renderer that subclasses a JPanel and contains a JTextField.
I checked I was overriding all the methods that DefaultTableCellRenderer does for performance reasons and found I wasnt overiding validate() and invalidate(), over-riding these the table column performance is now ok, but the cells are now not rendered correctly.
I also put a System.out.println into getTableRendererComponent() and found that even if I only move a column slightly the getTableRendererComponent() is called for every cell displayed rather than just the cells within the column moved/columns either side of it which is what i expect.
Any ideas what i should do. My own vague idea is to put some code into validate() and invalidate() to only call super implemntaions when really need to, but dont know how to work this out.Hi, thanks for your help - ive created a full test case, code below. I have reworked the code so I dont need to do a removeAll() but the issues remaining are:
1. If I override validate() with an empty method nothing is displayed in the grid
2. The renderer is alot slower than the using default renderer even though ive removed stuff like borders.
The code below has validate without the empty method.
(My real renderer is a bit more complicated, and I do require to use a JPanel)
import com.jthink.jaikoz.settings.LAF;
import com.jthink.jaikoz.table.ID3Cell;
import javax.swing.*;
import javax.swing.table.*;
import java.util.Vector;
import java.awt.*;
public class SlowColumnMoveTest
public static void main(String args[])
new SlowColumnMoveTest();
public SlowColumnMoveTest()
Vector colNames = new Vector();
colNames.add("col0");
colNames.add("col1");
colNames.add("col2");
colNames.add("col3");
colNames.add("col4");
colNames.add("col5");
colNames.add("col6");
colNames.add("col7");
colNames.add("col8");
colNames.add("col9");
Vector data = new Vector();
for (int i = 0; i < 500; i++)
Vector v = new Vector();
v.add(i);
for (int j = 1; j < 10; j++)
v.add(String.valueOf((i + 1) * (j + 1)));
data.add(v);
JTable table = new JTable(new DefaultTableModel(data, colNames));
table.getColumnModel().setColumnSelectionAllowed(true);
table.setDefaultRenderer(Object.class, new SlowRenderer());
JFrame frame = new JFrame("SlowColumnMoveTest");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JScrollPane scrollPane = new JScrollPane(table);
frame.add(scrollPane);
frame.pack();
frame.setVisible(true);
static class SlowRenderer extends JPanel implements TableCellRenderer
private static String PROPERTY_TABLE_BGCOLOUR = "Table.background";
private static String PROPERTY_TABLE_FGCOLOUR = "Table.foreground";
private static String PROPERTY_TABLE_SELECTION_BGCOLOUR = "Table.selectionBackground";
private static String PROPERTY_TABLE_SELECTION_FGCOLOUR = "Table.selectionForeground";
protected static Color tableBGColour = null;
protected static Color tableFGColour = null;
protected static Color selectionBGColour = null;
protected static Color selectionFGColour = null;
static
tableBGColour = UIManager.getColor(PROPERTY_TABLE_BGCOLOUR);
tableFGColour = UIManager.getColor(PROPERTY_TABLE_FGCOLOUR);
selectionBGColour = UIManager.getColor(PROPERTY_TABLE_SELECTION_BGCOLOUR);
selectionFGColour = UIManager.getColor(PROPERTY_TABLE_SELECTION_FGCOLOUR);
protected JTextField text;
public SlowRenderer()
text = new JTextField();
text.setBorder(null);
text.setOpaque(false);
text.setForeground(tableFGColour);
setOpaque(true);
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.add(text);
public Component getTableCellRendererComponent(final JTable table,
final Object value,
final boolean isSelected,
final boolean hasFocus,
final int row,
final int column)
//System.out.println("rendering:col:"+column+":row:"+row);
text.setVisible(true);
text.setText(value.toString());
if (isSelected)
text.setForeground(selectionFGColour);
this.setBackground(selectionBGColour);
else
text.setForeground(tableFGColour);
this.setBackground(tableBGColour);
return this;
@Override
public final boolean isOpaque()
return true;
@Override
public void invalidate()
//System.out.println("invvalidate");
//super.invalidate();
@Override
public void validate()
//System.out.println("validate");
super.validate();
@Override
public void revalidate()
@Override
public void repaint(long tm, int x, int y, int width, int height)
@Override
public void repaint(Rectangle r)
@Override
public void repaint()
@Override
protected final void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue)
@Override
public final void firePropertyChange(final String propertyName, final boolean oldValue, final boolean newValue)
private static final class UIResource
extends DefaultTableCellRenderer
implements javax.swing.plaf.UIResource
} -
I created a new user. I wanted to attach this user to a default tablespace. After I gave the command, "ALTER USER DEFAULT TABLESPACE rent QUOTA UNLIMITED ON rent;", the Oracle SQl Developer gave a command succeeded message. But when I tried to access a table within that tablespace, I couldn't. I was only able to access the table in the tablespace using the full qualification.
1) SELECT * FROM rent; -- failed
2) SELECT * FROM halibut.rent; -- succeeded
1) should work, since I attached the default tablespace to that user. How to overcome this problem?
I use Oracle SQL Developer version 1.1.2.25 and Oracle 10g Standard Edition.I assume that you have given quota to that user using sysdba user only.
1) SELECT * FROM rent; -- failed
2) SELECT * FROM halibut.rent; -- succeeded
1 one has to fail because rent table exist in halibut schema.Giving quota unlimited doesn't mean you can access everything in that tbs owned by other user also.It just allow to use all space on that tbs.This is basic of oracle DBA dear. -
Things to do after move tables and indexes to another tablespace
dear friends.
last night i move indexes and tables from tbs1 to tbs2.
I checked:
- valid objects, everything is ok.
- indexes and tables was move ok.
Anything else that i must to check ???
Pls, could you help me ???
Really thanks.
chijarthanks to answers my friends
is correct, i was moved tables: alter table <OWNER.TABLE> move tablespace <NEW TBS>; and my indx: ALTER INDEX <OWNER.INDEX> rebuild tablespace <NEW TBS>...
i wanted to know what things i must to do after i applied that movement.
I forgeted recollect statistics, but i recently do it, thanks to you.
So... its appears that i did it ok. !!!
Thanks
cesar. -
DATABASE IMPORT IN THE DEFAULT TABLESPACE OF USER
Hi,
I have exported database into a dump file ,the exported database was using the system table space.
Now i am trying to import database from the above dump file into the new user which has default table space specified, but its the import is happening in system table space rather then the default tablespace.
On the command prompt command i am running this command to import:
imp user/password@netservicename file=filename fromuser=x1 touser=xyz ignore=yYou have to create the table in the tablespace you want before importing the datas in.
Do you know the ALTER TABLE MOVE command to move a table from one tablespace to another ?
Fred -
I can't find where to darken GRID lines on a table in the new Pages. I can make the outline more bold, but not the grid lines within the table. Is there a way to do this? The default grid lines are far too faint.
Yeah, the Help is missing a little.
If you select the block of cells that you want to change, then in the Format inspector:
Select the Cell tab
Expand the Border section
Set a line type
Set a line width
Choose a line color
Choose one of the nine options for which borders get the new settings -
Use of DEFAULT tablespace while re-enabling constraint
Using 8.1.7.2.
While trying to re-enable a constraint on a table, we hit a ORA-01630. According to the error message, Oracle was trying to use the DEFAULT tablespace (USERS) instead of the TEMPORARY tablespace (TEMP) to do the work.
Why would Oracle use a tablespace other than TEMP to do work that needed temporary space?
[email protected]What is the 'temporary_tablespace' value when you query user_users as this user?
Oracle will use the tablespace that is specified as the users TEMPORARY_TABLESPACE for all sorts. If that tablespace does not exists, it uses SYSTEM. -
How to resize the DEFAULT tablespace...
When I use "Portal Configuration Assistant" to Install Oracle Portal, I got an alert from step 5 of 6 :
"The Portal Configuration Assistant has halted because it has detected that the amount of free space available in the Default tablespace is less than 150M...."
How could I do in next step?
Thanks in advance!
Regards,
Eric
nullEric,
To fix the problem, log into SQLPLUS as MANAGER
increase the table size by giving
ALTER TABLESPACE <name> ADDFILE '<fullpathfilename>' SIZE <value e.g 50M>
null
Maybe you are looking for
-
Multiple Apache on same machine
I am trying to run two apaches on the same machine. I have installed each in their own home directory. I get the following error when I try to bring up the second listener. it looks like a permission error on a dynamic file in the /tmp directory. the
-
Do I need to install something in server to enable iPad user to use SAP?
I know that at client side, mobile user just need to have SAP Business One mobile application installed in the iPad. But how about the server side, is it necessary for the Administrator to install something? If it is, what is to install & how to obta
-
WUC-24: Error reading URL when running WeubUtil form in Linux
We finally managed to successfully run a form (10g R2) to read from an Excel sheet in the Linux machine. Now issue is just as the form loads we get this error WUC-24: Error reading URL http://192.168.x.xx:7778/forms/webutil/testwebutil.dllJava consol
-
Does anyone know when the new iPad will be released?
-
I have two questions regarding replicated applications. I have setup a replication group with 4 nodes (1 master, 3 replica nodes) using Berkeley DB JE 4.0.103. I am using Direct Persistence Layer (DPL) java API, specifically com.sleepycat.je.rep.Repl