Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> tablespace copy and rename
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
Received on Wed Feb 09 2005 - 09:12:40 CST