Function to create metadata
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Function to create metadata

  1. #1
    Join Date
    Oct 2002
    Location
    Breda, The Netherlands
    Posts
    317

    Question Function to create metadata

    Hello guys,

    I'm lost. I'm searching the web (google), Oracle-books and dbasupport.com for this, but no result... I know it is on this site, but I still can't find it

    The problem: I want to copy all users from one database, so I can introduce them into another db.

    In DBA Studio (Oracle 8.1.7.4.9) you can choose "Show Object code" and will provide you with the correct create script.

    I know there's some kind of DBMS_METADATA package that will return a create script. But I couldn't find it.

    Can someone enlighten me?

    Humble grasshopper hops around.... confused...
    An expert is one who knows more and more about less and less until he knows absolutely everything about nothing.

  2. #2
    Join Date
    Jan 2001
    Posts
    3,131
    Can't you use export/import with ROWS=N?

    MH
    I remember when this place was cool.

  3. #3
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    I think your looking for DBMS_METADATA.GET_DDL which was introduced in 9i

    HTH
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  4. #4
    Join Date
    Oct 2002
    Location
    Breda, The Netherlands
    Posts
    317
    That's why I couldn't find it... Thanks Jovery !!

    Mr. Hanky: well, that's worth a try. I can create a script that creates a batch file, that executes "imp user/passw@db fromuser=x touser=x rows=N" for each user...

    Thank's !!
    An expert is one who knows more and more about less and less until he knows absolutely everything about nothing.

  5. #5
    Join Date
    Oct 2002
    Location
    Breda, The Netherlands
    Posts
    317
    I have a loooooong list of users spooled in a text file.

    Is there a way to make a delimited horizontal list out of this 'vertical' list of names?

    Example:

    Now:
    JOHN
    LISA
    MARTIN

    Result:
    JOHN,LISA,MARTIN
    An expert is one who knows more and more about less and less until he knows absolutely everything about nothing.

  6. #6
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    Write and UTIL file.
    step 1) Read from file1 one which data like...
    JOHN
    LISA
    MARTIN
    step 2) write to file2... add COMMA to the value from file1.

    Just check UTIL_FILE package whether you can append (Iam nit sure).

    HTH
    Cheers!
    OraKid.

  7. #7
    Join Date
    Oct 2002
    Location
    Breda, The Netherlands
    Posts
    317
    Oke Thanks!
    An expert is one who knows more and more about less and less until he knows absolutely everything about nothing.

  8. #8
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,448
    awk '{ a=a"," $0 } END { print substr(a, 2) }' your_text_file

  9. #9
    Join Date
    Oct 2002
    Location
    Breda, The Netherlands
    Posts
    317
    Pando? What dialect are you talking?

    Furthermore: I tried something, but now I see that many users are only created so they can access the application. The users have no objects, but are granted select/insert/etc rights to access the application-schema. Great!

    Now I think to use to create a script from selecting DBA_USERS to create all those users at the other db.

    Question :

    How do I transport the password?

    The following statement fails:
    SELECT 'CREATE USER '||user_name||' IDENTIFIED BY '||password||';'
    FROM DBA_USERS;

    Is there a trick to create a users password by using the encrypted password in DBA_USERs?
    Last edited by efrijters; 09-11-2003 at 10:27 AM.
    An expert is one who knows more and more about less and less until he knows absolutely everything about nothing.

  10. #10
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    you can get the password by one method, but before populating into that table, you need to expire the acc & when login the user will have to enter new password. then you can capture old & new pass in the table using a function and assinging a profile.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width