Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Move 8i instances into 9R2 schemas

Re: Move 8i instances into 9R2 schemas

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 6 Jan 2005 10:26:09 -0800
Message-ID: <1105035969.923666.79210@c13g2000cwb.googlegroups.com>

Syltrem wrote:
> You could try an IMP SHOW=Y FULL=Y LOG=SOMEFILE.TXT
>
> Then edit the SOMEFILE.TXT and modify the grants with the correct
user names
> (as they have changed), extract those commands from the file and
execute
> them at the SQLPLUS prompt.
>
> Or you could use a SELECT 'GRANT ' || GRANTED_ROLE || ' TO ' ||
USERNAME
> ..... FROM USER_ROLE_PRIVS
> type of instructions in a spool file and execute them, but that would
> probably take you longer.
>
>

<snip>

Since it's a small database, you could also do text search and extract the GRANT statements using findstr.

Copy and run this from command prompt. Change EXP.DMP=Your dump file, OLDUSER=Original user name from source database, NEWUSER=New user name in target database. Open the generated .sql file in e.g. notepad and replace all occurances of OLDUSER with NEWUSER. You can run the .sql in sqlplus.

FOR /F "tokens=*" %A in ('findstr /b /i "grant" EXP.DMP^|findstr /i "OLDUSER"') do (

    echo %A;>>NEWUSER.sql
)

Regards
/Rauf Received on Thu Jan 06 2005 - 12:26:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US