sql script
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: sql script

  1. #1
    Join Date
    May 2002
    Posts
    232
    heloo dear friends,I need to create a sql script ,it contains 20 tables and indexes.plss give me script example how to create that script in sunsolaris.When i will execuite that script then imm all tables must be created.
    plss help me
    kavitha

  2. #2
    Join Date
    May 2002
    Posts
    232

    urgent

    heloo dear friends,I need to create a sql script ,it contains 20 tables and indexes.plss give me script example how to create that script in sunsolaris.When i will execuite that script then imm all tables must be created.
    plss help me
    kavitha

  3. #3
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175

    Cool

    If you are using Oracle 9i, then it is easy. You can use DBMS_METADATA package.

    Example is shown here:
    http://www.dbaclick.com/cgi-bin/ib3/...t=ST;f=17;t=11


    For more cool ideas check the latest Oracle DBA forums:
    http://www.dbaclick.com/cgi-bin/ib3/ikonboard.cgi

    Hope that helps,



    --clio_usa
    Senior Oracle DBA

  4. #4
    Join Date
    May 2002
    Posts
    232

    urgent

    Hii friend i did not get the exact syntax from http://www.dbaclick.com,suppose i have 2 want to execuite 2 tables at a time,so can u give code for that.
    thanks
    kavitha

  5. #5
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175
    OK.

    Start the spooling and change the query from the link to:

    SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
    FROM USER_ALL_TABLES u
    WHERE u.nested='NO'
    AND (u.iot_type is null or u.iot_type='IOT')
    AND table_name IN ('TABLE_1','TABLE_2','TABLE_3', ..............);

    Stop the sooling to get the DDL in text file. If you setup LINESIZE, PAGESIZE, HEADING, etc you can get clear SQL. The run it from shell scripts in UNIX.

    You could use DBA_TABLES and limit by OWNER in the where clause. It is up to your needs to change the query. The idea is still the same...

    You have to put some efforts to compile all that of course. Like to show how to catch the fish, not to serve the cooked one...




    --clio_usa
    Senior Oracle DBA

    Check the latest Oracle DBA forums:
    http://www.dbaclick.com/cgi-bin/ib3/ikonboard.cgi


  6. #6
    Join Date
    Dec 2001
    Location
    SAN FRANCISCO, CA
    Posts
    306
    for clio_usa

    i just wanted to know whether dba click.com and dbasupport.com belong to same organization.

    Eat , Drink & Enjoy life -

    pravin_kini@hotmail.com

  7. #7
    Join Date
    May 2002
    Location
    California, USA
    Posts
    175

    Cool

    pravin,

    http://www.dbaclick.com has no assosiations with http://www.dbasupport.com or any dbaxxxxx sites.

    Thank you for your interest !

    --clio_usa


  8. #8
    Join Date
    Dec 2001
    Location
    SAN FRANCISCO, CA
    Posts
    306


    encourage members to use this dba_support_ forum for all answers , if u do a search on any topic u can get all answers.

    instead of relying on other web site forums such as dba.click for all answers.

    -- Pravin

    Eat , Drink & Enjoy life -

    pravin_kini@hotmail.com

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