.comment-link {margin-left:.6em;}

Tuesday, September 05, 2006

Exportando usuários e senhas

As vezes precisamos fazer um export/import e levar os usuários e senha (originais). Para isso, há um pequeno truque usando o arquivo de import, veja exemplo:

ops$marcio@YODA10G> !exp / file=users.dmp full=y

Export: Release 10.2.0.2.0 - Production on Fri Aug 18 20:04:48 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)

About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting PUBLIC type synonyms <<<<<-------- FIZ UM CTRL-c AQUI.
EXP-00008: ORACLE error 1013 encountered ORA-01013:
user requested cancel of current operation
EXP-00000: Export terminated unsuccessfully

ops$marcio@YODA10G> !strings users.dmp | grep -i ops$marcio

CREATE USER "OPS$MARCIO" IDENTIFIED BY VALUES '780383AD56F94137' DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP"
GRANT UNLIMITED TABLESPACE TO "OPS$MARCIO"
GRANT "DBA" TO "OPS$MARCIO"
ALTER USER "OPS$MARCIO" DEFAULT ROLE ALL

Labels:


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?