|
|
|
|
|
|
| Author |
Message |
DA Morgan *nix forums Guru
Joined: 06 Mar 2005
Posts: 1042
|
Posted: Wed Feb 09, 2005 10:47 pm Post subject:
Re: tablespace copy and rename
|
|
|
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
|
Posted: Wed Feb 09, 2005 2:14 pm Post subject:
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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 12:55 am | All times are GMT
|
|
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
|
|