Renaming a tablespace in 8.1.7
I know there's no way to do it via the SQL Plus command line but I'm told there's an unsupported backdoor way. Anyone know how?
I'm not talking about renaming a data file, I need to change the actual tablespace name.
Thanks for any info,
Ted
you can do the following:
1. export all objects in your tablespace, by using option tables=(x,y,...)
2. drop your tablespace including contents
3. create new tablespace with a desired name using the same datafiles names (you can physically delete them first or use a REUSE option)
4. create objects you exported in the new tablespace.
5. perform your import
By creating objects first, you guarantee that export will populate tables in the tablespace you need.
This is just a general plan, you have to clarify and confirm all details.
Similar Messages
-
hi
I have a tablespace and wanted to rename it:
alter tablespace oldttbs rename TO newttbs;
create user newttbs identified by newttbs default tablespace newttbs
grant unlimited tablespace to newttbs
However, I noticed that the owner is still the old one (named also oldttbs).
So now I have this situation:
select distinct owner,TABLESPACE_NAME from dba_segments where owner in ('oldttbs','newttbs');
OWNER TABLESPACE_NAME
newttbs newttbs
oldttbs newttbs
the new tablespace (owner newttbs) has some empty tables.
Can you please advise?You are mixing up owners and tablespaces.
There is no tight relation between them.
A database consist of multiple tablespaces.
An owner can store objects in multiple tablespaces.
There is no rule: owner=tablespace.
So when you renamed the tablespace, the result is owner oldtbbs (very bad name) is now storing his objects in tablespace newtbbs.
What you see right now is what you asked.
You have an existing user 'oldtbbs' who stores his objects in tablespace newttbs.
You have a newly created user 'newttbs' who also store his objects in tablespace newttbs.
If you really want a separate tablespace for every user, you should have created a new tablespace apart from oldttbs,
Also granting unlimited tablespace privilige is a very bad thing to do.
This allows the user to create objects in any tablespace, including SYSTEM.
You should have created the user thus
create user newttbs identified by newttbs default tablespace newttbs quota unlimited on newttbs.
Guess you are in dire need of reading the Concepts Manual.
Sybrand Bakker
Senior Oracle DBA -
Renaming a Tablespace and Schema in Oracle 9i
hi,
i have the following scenario
1') Schema with name X attached with a default tablespace whos name also is X.
i want to now move to Schema with name Y attached with a default tablespace whos name is Y. but i want the data to be same as that of point 1)
Can anyone provide me help in doing that.
Vesion of Oracle being used is Oracle 9i Release 2 with Windows 2000
Thanks in AdvanceUnfortunately, there is no facility for renaming schemas or tablespaces in Oracle 9i. There are such options in 10g, but that probably doesn't help you much.
Depending on the amount of data we're talking about, it may be easiest to do a schema-level export and import using the fromuser and touser commands.
Justin -
Renaming a tablespace through Datapump
Hi.
I have a tablespace X in my source and I want to import it in to another DB and rename it to Y VIA data pump. Do I have to use the REMAP_DATAFILE & REMAP_TABLESPACE parameters or will the REMAP_TABLESPACE do it for me?
I my datafile has the name of the tbs in it so I would like to change it as well so I assume you would need both. Just wanted confirmation. Something like this?
impdp /
directory=DATA_PUMP_DIR
dumpfile= 'TEST.dmp'
transport_datafiles= C:\x
REMAP_TABLESPACE= X:Yor
impdp /
directory=DATA_PUMP_DIR
dumpfile= 'TEST.dmp'
transport_datafiles= C:\x
REMAP_DATAFILE=X.dbf:Y.dbf
REMAP_TABLESPACE= X:Yand I am using ASM with OMF. so my actual datafilename is something like this +DATA/x.284.715018095
Edited by: Gunners on Mar 31, 2010 11:02 AM
Edited by: Gunners on Mar 31, 2010 11:03 AMI was thinking this...doubt it though, lol
REMAP_DATAFILE=+DATA:+DATA
Cause when I create my tablespace or name a file, I never actually do. Just do a simple
create tablespace X datafile '+DATA' size 100M.....;it generates for us '+DATA/[dbname]/datafile/x.317.657819225' -
I have a dump file from a 9i Oracle database with tablespace USERDEL_DATA but my database in 11g has tablespace USER_DEL_DATA. I don't want to name the tablespace what it is called in the 9i database because the naming convention is not consistent with what I have been naming the tablespaces. There needs to be a '_' between USER and DEL.
The problem I have is that, each time I try importing to 11g database, some tables that probably have USERDEL_DATA as their default tablespace in the 9i database would not import into the 11g database. Is there any parameter (I haven't found one yet) using native import (i.e. imp) to remap_tablespace? I know with impdp, I would be able to remap tablespace easily but this dump file is from a 9i database and impdp would not work on it. Please help.
Thank you for your assistance.The old exp/imp utilities have a tablespace transport mode, sort of like the end goal, but maybe not quite exactly.
>> tables that probably have USERDEL_DATA as their default tablespace
That's not quite accurate, users have a default tablespace, used for table creation when a tablespace isn't specified in the DDL.
What we've done when an export file has tablespaces that disagree with the tablespace names in the import target, go ahead and create the disagreeable tablepspace, and set the target schema(s) user(s) to have zero quota on the "bad" named tablespace. The IGNORE=Y imp setting will end up putting the tables into the user default tablespace, as long as the user(s) haven't picked up the unlimited tablespace system privilege somehow/somewhere.
So when import is done, just drop the bad tablespace [including contents and datafiles]; and Problem Solved.
>> the naming convention is not consistent
Not seeing a problem there. Its got a name, tablespace(s) have to have one. Don't care what its called, just do have to know about it for backup/recovery, that would be the critical bit.. -
Can we rename Oracle username & tablespace name in 11g R2
- We have Oracle tablespace name "TULIP"
- We have Oracle username "TULIP"
Default tablespace for use TULIP is TULIP.
- Now can we rename tablespace TULIP to TULIP_NEW ?
- Now can we rename username TULIP to TULIP_NEW ?
Can this be done online when the database is running ?
If NOT please give me the steps involved.
Thanks
BristolYes you can rename a tablespace.
ALTER TABLESPACE <tablespace_x> RENAME TO <tablespace_y>;As far as renaming the schema there is no command for that. One approach would be to export the data and re-import using the REMAP_SCHEMA (for Data Pump) option. -
Droping and renaming tablespace druing hot user managed backup
Will dropping and renaming of tablespace will have any effect if hot user managed backup of that db is in progress ?
thanks in advanceHowever, you will encounter a more serious issue because of the way DROP TABLESPACE works.
Even if the DROP fails, the "INCLUDING CONTENTS" causes all segments to be dropped !!
SQL> drop table ASSM_TABLE purge;
Table dropped.
SQL> create table ASSM_TABLE (pk_col number not null, descr_col varchar2(30)) tablespace ASSM_TBS;
Table created.
SQL> create unique index ASSM_TABLE_PK on ASSM_TABLE (pk_col) tablespace ASSM_TBS;
Index created.
SQL> select segment_name, segment_type from user_segments where tablespace_name = 'ASSM_TBS';
SEGMENT_NAME SEGMENT_TYPE
ASSM_TABLE_PK INDEX
ASSM_TABLE TABLE
SQL> insert into ASSM_TABLE select rownum, 'ABCD ' || rownum from dual connect by level < 10;
9 rows created.
SQL> commit;
Commit complete.
SQL>
SQL> connect / as sysdba
Connected.
SQL>
SQL> alter tablespace ASSM_TBS begin backup;
Tablespace altered.
SQL> drop tablespace ASSM_TBS including contents and datafiles;
drop tablespace ASSM_TBS including contents and datafiles
ERROR at line 1:
ORA-01150: cannot prevent writes - file 7 has online backup set
ORA-01110: data file 7:
'filename'
SQL> connect hemant/hemant
Connected.
SQL> select segment_name, segment_type from user_segments where tablespace_name = 'ASSM_TBS';
no rows selected
SQL> alter tablespace ASSM_TBS end backup
2 /
Tablespace altered.
SQL>The DROP TABLESPACE failed but the contents did get dropped !
Hemant K Chitale
Edited by: Hemant K Chitale on Oct 7, 2011 2:41 PM -
Hi All
I would like to rename tablespace A to B , but when I do it tables after rename tablespace have columns tablespace_name.dba_tabkles in A . Is possibility to change it into without move ?
thank You
BranoWe need not do any thing, it gets renamed
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
SQL> create table demorename(i number) tablespace DEMO;
Table created.
SQL> create index demorenameidx on demorename(i) tablespace demo;
Index created.
SQL> select segment_name,tablespace_name from dba_segments where tablespace_name='DEMO';
SEGMENT_NAME TABLESPACE_NAME
DEMORENAME DEMO
DEMORENAMEIDX DEMO
SQL> select tablespace_name from dba_tables where table_name='DEMORENAME';
TABLESPACE_NAME
DEMO
SQL> alter tablespace demo rename to dem01; -----------------------------> Rename of tablespace
Tablespace altered.
SQL> select tablespace_name from dba_tables where table_name='DEMORENAME';
TABLESPACE_NAME
DEM01
SQL> select segment_name,tablespace_name from dba_segments where tablespace_name='DEM01';
SEGMENT_NAME TABLESPACE_NAME
DEMORENAME DEM01
DEMORENAMEIDX DEM01
Edited by: vreddy on Sep 28, 2012 7:40 AM -
ALTER TABLESPACE X RENAME TO Y
Hi all!
I want to know if i can apply an "alter tablespace rename to" sentence without stop the normal activity off the database or it's necessary stop the users access to the affected tablespace.
Thanks folks!!
JordiActually there should be no issues with performance as
When you rename a tablespace the database updates all references to the tablespace name in the data dictionary, control file, and (online) datafile headers. The database does not change the tablespace ID so if this tablespace were, for example, the default tablespace for a user, then the renamed tablespace would show as the default tablespace for the user in the DBA_USERS view.
so there are no inserts or physical data move going on. Just all references are updated. -
Is it possible to rename dictionary managed tablespace in oracle 10g?
Hi,
Assume my system tablespace is dictionary managed in oracle 10g and one of my permanent tablespace is dictionary managed.
Pls let me know that permanent dictionary managed tablespace can be renamed or not using rename tablespace command or only locally managed tablespaces can be renamed?
thanks,
DBHi Guys,
thanks for the replies.
As suggested, i created a database with dictionary managed system tablespace and users tablespace .
I was able to rename users tablespace to users_test.
Eventhough dictionary managed tablespace is deprecated in oracle 10g, it will be better if they just add a line in the 10gR2 documentation under renaming tablespaces section that dictionary managed tablespaces also can be renamed.
SQL> alter tablespace users rename to users_test;
Tablespace altered.
SQL> select tablespace_name,extent_management from dba_tablespaces;
TABLESPACE_NAME EXTENT_MAN
SYSTEM DICTIONARY
UNDOTBS1 LOCAL
SYSAUX LOCAL
TEMP LOCAL
USERS_TEST DICTIONARY
SQL> select * from v$instance;
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION
1 dictest XXXXXX 10.2.0.1.0 -
Snapshot too old error during drop tablespace
Hi Experts
When we are doing BW reorg and steps followed are
1. created a newtablespace with source tablespace TABART class reference.
2. Export the source tablespace to the filesystem level.
3. DROP the source tablespace now.
4. Rename the new tablespace to source tablespace name.
5. Import
Here in the third step i have received snapshot too old error.
BR0301E SQL error -604 at location BrSqlExecute-1, SQL statement:
'/* BRSPACE */ drop tablespace PSAPADSOLD including contents and datafiles cascade constraints'
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number 0 with name "SYSTEM" too small
BR1017E Execution of SQL statement 'drop tablespace PSAPADSOLD including contents and datafiles cascade constraints' failed
so i tried to rename the tablespace and set to offline and tried to import only 240 tables were imported compared to 24057 tables.Still the PSAPADS - Source tablespace shows 65000 elements.
my queries:
1. After Export of the tablespace how come the Source tablespace retain the tables.
2. why i could not able to drop the tablespace
I had increased the UNDO_RETENTION to 86400 my oracle version is 10.2.04.
Source table space PSAPADS is 80 GB and has only 30 GB data and the remaining are free.
PSAPUNDO was 17GB in size.
Kinldy suggest
Regards
BalaHi Stefa
Thanks for your reply.
how to find the System undo is still active.How to track which Undo which is active and their steps.
As per the metalink note our PSAPUNDO is Locally Managed Tablepsace hence the second workaround is applicable..
How to validate this will not give a problem again while i am doing reorganization.
When i checked a sap note 1039060 this note is applicable to windows i dont how it can be impleneted.
Whether any merge fix will help on this
Regards
Bala -
Error while backing up a tablespace
All,
Please see below. I have a tablespace named INDEX. When I am trying to put it in backup mode, I am getting an error.
SQL> select tablespace_name from dba_tablespaces where tablespace_name like 'IND%';
TABLESPACE_NAME
INDEX
INDEX_PROD
SQL> alter tablespace index begin backup;
alter tablespace index begin backup
ERROR at line 1:
ORA-02140: invalid tablespace name
The above error is not coming for INDEX_PROD tablespace, just only for INDEX tablespace.
Oracle Release - 10.2.0.1.0
OS - HP-UX 11.11
Any suggestion is helpful and appreciated.
Regards.Rachu wrote:
Thanks again, so I can still keep this name as the tablespace name and the backup is valid with
alter tablespace "INDEX" begin backup;
AND
alter tablespace "INDEX" end backup;
or should I change the name of the tablespace. I shall preferably change the name, I think.
Regards, R.Dear Rachu,
why you are still using user managed backup, simplify your backup using RMAN.
if you would like your can rename the tablespace INDEX and create a new like INDEX_TBS like that
eg:-
ALTER TABLESPACE users RENAME TO usersts;
refer:-renaming tablespace
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tspaces.htm#i1009261 -
Specify tablespace when creating Oracle tables?
I am migrating from MS SQLServer 6.5 to Oracle 9.0.1.2. Whenever I run the OMWB process to load the table data into the destination Oracle database, OMWB creates a tablespace named after my SQLServer database name. This is fine; however, the datafile always ends up in the ORACLE_HOME/dbs directory. Even if I use OMFs, it still creates the datafile for this tablespace in ORACLE_HOME/dbs. Is there any way to specify the tablespace and/or user?
NOTE: OMWB is executed on NT 4.0. Oracle repository and destination database is on Solaris 2.6. I don't think those facts matter for this question, but I want to specify because the O/S field above only allows for one selection.
Thanks!Reid,
if you expand the tablespace folder in the Oracle Model UI and select the tablespace in question you will note that on the
right-hand-side of the Migration Workbench UI a property pane appears with a General and Storage tab. On the General
tab you will see a list box with column headings including File Name and File Directory. If you select the tablespace name
under the File Name column, you will note that you can change the name of the tablespace file. If you select the File Directory
column for the tablespace in question, you will be able to specify a destination directory for the dbf file. If you use this method
then please remember to choose the Apply button at the bottom of the property pane to save any changes you might make.
Note that you can also rename the Tablespace itself by selecting the tablespace in question from the Tablespaces folder
and choosing Object-Rename from the menu - then simply type in your preferred name.
An alternative is to use the Tablespace discoverer option which can be found under the Tools menu in the Migration Workbench.
This enables you to use the tablespaces currently available in an existing Oracle 8i or 9i database.
I hope this helps,
Regards,
Tom - Team OMWB. -
Import of a tablespace using a tablespace different name
Hi,
i'm trying to import a transportable tablespace into the same database it was exported from, but using a different name; the import utility fails saying that it can't find the original tablespace.
The parameters used during export and import are:
exp 'sys/pwd@host as sysdba'
transport_tablespace=yes
tablespaces=test_tbs
direct=yes
triggers=no
constraints=no
buffer=100000
file=test_tbs.dmp
imp 'sys/pwd@host as sysdba'
transport_tablespace=yes
tablespaces=test_tbs
file=test_tbs.dmp
buffer=100000
datafiles='test_tbs.dbf'
Both tools are spawned as child processes of my application.
Is there any way to import a tablespace with a new name or to rename the tablespace after import. Needless to say, that I can't predict the new name at export time.
What I basically want to do, is to imitate the "Attach/Detach Database" feature of mssql.
Thanks in advance
HeikoYou can't rename tablespace with transport_tablespace features. Read the piece of information extracted from the metalink note : 103013.1
Transported tablespaces are plugged in in a read-only configuration, however the file header also stores the tablespace name, so any attempt to rename it would require an update to the file header. Similarly at unplug time there is a requirement that the tablespace is in read only mode and the same restrictions therefore apply - you can't 'RENAME' a tablespace, because you might only be taking a copy of the datafile. -
Hi,
How do you rename a tablespace. For example form DATA_O1 to PES_DATA?
Also how do I change the default tablespace?
Thanks.Hello,
{180,000.00 + 130,000.00 + (10,000.00 *5) = 360GB }
In you system, you need 360Gb total in your drive where you have SAPDATAn directory when all of your datafiles reaches its max size.
If you have still have 320 GB free space, there should not any problem till you extend any Tablespace. But please verify if you have 320Gb free now or if total size of drive is 320 GB ??
(Also, I assume you do not have anything other than this SAPDATAn in that drive which will grow and eat disk space)
What you need to understand is, you should have as much of space in drive as much you are having all datafiles in that drive after it reaches its max size.(If you create datafiles with autoexted yes, initial size of file on disk will be less and will b gradually extended as needed)
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/1b/d20f6fe45a9e43b1856ea1b52c9612/frameset.htm
thanks
ashish
Maybe you are looking for
-
How do I print a pdf document in large type
I need to print the following document: http://www.mta.info/maps/service_guide_web_Jun10.pdf I set the viewing size to 150%, but when I print the document it comes out too small to read. How do I get the document to print in the size I s
-
Hi There - We are facing AS2 connection problem with one of our customers. Following is scenario. Problem Scenario – We BizTalk 2010 server with which we are trying to connect one of our customer’s bank for secure communication. Our UAT box has b
-
Is there any module in ABAP which requires almost zero percent of coding?
Hi all, i just wanted to know if there is any module in ABAP which has zero percent of coding apart from functional modules like SD MM etc? Regards Sanjeev
-
Will the new aluminum apple remote work with my macbook a1181 or should I buy an older white model?
-
Partial Cancellation of Material Document.
Hi all.... My client is having one requirement, we have project system & user wanted to return material from site to project stock, for eg. 10 quantity of material is issued to the user for internal consumption with 221Q, after one month user consume