niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Tools
tablespace copy and rename
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
DA Morgan
*nix forums Guru


Joined: 06 Mar 2005
Posts: 1042

PostPosted: Wed Feb 09, 2005 10:47 pm    Post subject: Re: tablespace copy and rename Reply with quote

Klaus Baumgart wrote:

Quote:
How can I rename a tablespace without copying the database.
Also I have to change the Database User and Schemaname

I would like to do this simelar to the SQL-Server features.

copy Files
cp ALT_NAME NEW_NAME

EXEC sp_attach_db @dbname=N'NEW_NAME',
@filename1= N'E:\db\NEW_NAME.mdf',
@filename2= N'E:\db\NEW_NAME.ldf'



EXEC sp_addlogin 'NEW_NAME', 'NEW_NAME', 'NEW_NAME'
GO
USE NEW_NAME
GO
EXEC sp_grantdbaccess 'NEW_NAME', 'NEW_NAME'
GO
EXEC sp_addrolemember 'db_owner', 'NEW_NAME'
GO
USE NEW_NAME
GO
EXEC sp_revokedbaccess 'NEW_NAME'
GO
EXEC sp_changedbowner 'NEW_NAME'
GO

What on earth are you doing? This is an Oracle group. Or do you
think Oracle is a subsidiary of Microsoft?

Here we read documentation.
Here versions matter.
So begin your education at: http://tahiti.oracle.com and also
check out Morgan's Library at http://www.psoug.org. The answers
are there and easy to find.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
Back to top
Klaus Baumgart
*nix forums beginner


Joined: 09 Feb 2005
Posts: 3

PostPosted: Wed Feb 09, 2005 2:14 pm    Post subject: tablespace copy and rename Reply with quote

How can I rename a tablespace without copying the database.
Also I have to change the Database User and Schemaname

I would like to do this simelar to the SQL-Server features.

copy Files
cp ALT_NAME NEW_NAME

EXEC sp_attach_db @dbname=N'NEW_NAME',
@filename1= N'E:\db\NEW_NAME.mdf',
@filename2= N'E:\db\NEW_NAME.ldf'



EXEC sp_addlogin 'NEW_NAME', 'NEW_NAME', 'NEW_NAME'
GO
USE NEW_NAME
GO
EXEC sp_grantdbaccess 'NEW_NAME', 'NEW_NAME'
GO
EXEC sp_addrolemember 'db_owner', 'NEW_NAME'
GO
USE NEW_NAME
GO
EXEC sp_revokedbaccess 'NEW_NAME'
GO
EXEC sp_changedbowner 'NEW_NAME'
GO
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 12:55 am | All times are GMT
navigation Forum index » Databases » Oracle » Tools
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Transporting Dictionary Managed Tablespace to 10g thtsang_yh@yahoo.com.hk Server 1 Fri Jul 21, 2006 4:24 am
No new posts Question about using copy constructor of parent class? LJB C++ 4 Thu Jul 20, 2006 9:32 pm
No new posts Copy CD to disk + copy disk to CD + reuse Hugo Vanwoerkom Debian 2 Wed Jul 19, 2006 2:20 pm
No new posts error when rename pointer names ehabaziz2001@gmail.com C 3 Mon Jul 17, 2006 10:09 pm
No new posts vtable pointers and default copy constructors.. Martijn van Buul C++ 5 Mon Jul 17, 2006 9:13 pm

Advertising | Power Rangers | Credit Cards | Credit Cards | Mobile Phone
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3388s ][ Queries: 20 (0.2258s) ][ GZIP on - Debug on ]