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

Thread: trouble running script to create new DB

  1. #1
    Join Date
    Apr 2001
    Posts
    257

    trouble running script to create new DB

    Platform: Oracle 9.2.0.4 on Windows 2000 Server

    I used DBCA to generated a set of scripts to create the DB. Since I am connecting via PCAnywhere, I have to run the scripts instead of having DBCA to create DB to avoid possible troubles. However, when I ran the script at command prompt, after a while, it stopped with output as below, it looks like it's prompting me for input. Is this normal? Please note that following the output below, I appended the postDBCreation.sql script generated by DBCA. There is no "exit" at the end thus it got stuck, I think. Will I miss something if I simply type exit to finish? I notice if I type exit, it never launches the listener.

    Thanks,

    -------------- OUTPUT --------------
    SQL>
    SQL> Rem =====================================================================
    SQL> Rem Run component validation procedure
    SQL> Rem =====================================================================
    SQL>
    SQL> EXECUTE dbms_registry.validate_components;

    PL/SQL procedure successfully completed.

    SQL>
    SQL> Rem ===========================================================================
    SQL> Rem END utlrp.sql
    SQL> Rem ===========================================================================
    SQL> shutdown ;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> connect SYS/change_on_install as SYSDBA
    Connected to an idle instance.
    SQL> set echo on
    SQL> spool c:\oracle\ora92\assistants\dbca\logs\postDBCreation.log
    SQL> create spfile='c:\oracle\ora92\database\spfilesil.ora' FROM pfile='c:\oracle\admin\sil\scripts\init.ora';

    File created.

    SQL> startup ;
    ORACLE instance started.

    Total System Global Area 764486628 bytes
    Fixed Size 455652 bytes
    Variable Size 553648128 bytes
    Database Buffers 209715200 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    Database opened.
    SQL>

    ---------------- postDBCreation.sql -----------------
    connect SYS/change_on_install as SYSDBA
    set echo on
    spool c:\oracle\ora92\assistants\dbca\logs\postDBCreation.log
    @c:\oracle\ora92\rdbms\admin\utlrp.sql;
    shutdown ;
    connect SYS/change_on_install as SYSDBA
    set echo on
    spool c:\oracle\ora92\assistants\dbca\logs\postDBCreation.log
    create spfile='c:\oracle\ora92\database\spfilesilicon1.ora' FROM pfile='c:\oracle\admin\silicon1\scripts\init.ora';
    startup ;

  2. #2
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    I see startup is the last command in your script.
    And the database has been started up after finishing the script. What for are you waiting it to do now??
    Sanjay G.
    Oracle Certified Professional 8i, 9i.

    "The degree of normality in a database is inversely proportional to that of its DBA"

  3. #3
    Join Date
    Apr 2001
    Posts
    257
    The script postDBCreation.sql is supposed to have an "exit" at the end but my DBCA generated script did not. That's why it "hung" there. I did another DB creation script generation via DBCA and notice it now has "exit" as the last command in the postDBCreation.sql script. Apparently for some reason, the first time it generated the script, it did not append "exit" at the end.

    Is DBCA really reliable?

  4. #4
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by a128
    Is DBCA really reliable?
    Very much
    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"

  5. #5
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Originally posted by abhaysk
    Very much
    Not as reliable as running scripts at command line, IMHO.
    Sanjay G.
    Oracle Certified Professional 8i, 9i.

    "The degree of normality in a database is inversely proportional to that of its DBA"

  6. #6
    Join Date
    Apr 2001
    Posts
    257
    I think I know why my scripts from first attempt did not work: when I went through DBCA, at the end of dialog box, I chose create DB and generate scripts. After the scripts were generated, DBCA went ahead and create the DB. However, it failed with ORA error (even though this was done at the console, as I tried it one another system) so I aborted. The abort caused init.ora disppeared from the scripts directory and it seems postDBCreations.sql's "exit" disappeared.

    The lesson: It may be ok to use dbca to create scripts, but run the scripts manually as Sanjay suggested.

    Thanks guys!

  7. #7
    Join Date
    Apr 2001
    Posts
    257
    I do have one more question:

    After the DB is created, what's the most efficient way to go through the creation log to ensure things are ok? If I grep ORA-, I _should_ look at the lines preceeding the ORA- to ensure those "XXX does not exist" errors are legitimate because the scripts attempt to drop the objects before creating them. However, this is quite tedious. Any better way to do this?

    Thanks,

  8. #8
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by SANJAY_G
    Not as reliable as running scripts at command line, IMHO.
    Sanjay :

    By very much I mean, generating scripts is pretty relaible. Yes offcourse running those scripts command line is the best because you can know where you want your files/what config/and so, accordingly you can edit the scripts and run.

    BTW, a128 posted if DBCA was relaible for DB script generation, so was my post, as he was maily concerned why script didnt contain "EXIT"..
    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