SQL$HELP72.HLB  —  DROP  DATABASE
    Deletes a database.

    When this statement executes in Oracle Rdb, SQL deletes all
    the database root and storage area files associated with the
    database.

    If you specify a repository path name in the DROP DATABASE
    statement or specify an alias for a database attached with the
    PATHNAME argument, SQL also deletes the repository directory that
    contains the database definitions.

                                 CAUTION

       Use the DROP DATABASE statement with care. You cannot use
       the ROLLBACK statement to cancel a DROP DATABASE statement.
       When you use this statement, SQL deletes the database root
       and storage area files, which include all data and all
       definitions.

1  –  Environment

    You can use the DROP DATABASE statement:

    o  In interactive SQL

    o  Embedded in host language programs to be precompiled

    o  As part of a procedure in an SQL module

    o  In dynamic SQL as a statement to be dynamically executed

2  –  Format

  (B)0DROP DATABASE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk     
   lqqqqqqqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj     
   tq> ALIAS <alias> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>  
   tq> FILENAME 'db-attach-spec' qqqqqqwqwqqqqqqqqqqqqqqqqqqqqqqwqj     
   mq> PATHNAME <path-name> qqqqqqqqqqqj mq> literal-user-auth qj       
                                                                        

  (B)0 db-attach-spec =                   
                                          
  qqwqqqqqqqqqqqqqqqqwq> <file-spec> qqq> 
    mq> <node-spec> qj                    
                                          

  (B)0node-spec =                               
                                            
  qwq> <nodename> qwqqqqqqqqqqqqqqqqqqqwqwq>
   x               mq> <access-string> j x  
   mqqqqqqqqqqqqqqqqqq :: <qqqqqqqqqqqqqqj  

  (B)0access-string =                       
                                        
  qwq> " <user-name> <password> " qqwq> 
   mq> " <VMS-proxy-user-name> " qqqj   
                                        

  (B)0literal-user-auth =                                       
                                                            
  qqq> USER '<username>' qwqqqqqqqqqqqqqqqqqqqqqqqqwqq>     
                          mq> USING '<password>'  qj        
                                                            

3  –  Arguments

3.1  –  ALIAS alias

    Specifies the alias for an attached database. The DROP DATABASE
    statement deletes the database and all database root and storage
    area files associated with the alias.

    If the database was declared with the PATHNAME argument, the DROP
    DATABASE statement also deletes the repository directory that
    contains the database definitions.

3.2  –  FILENAME

    Specifies a quoted string containing full or partial information
    needed to access a database. An attach specification contains the
    file specification of the .rdb file.

    The DROP DATABASE statement deletes the database and all
    database system files associated with the database root file
    specification. If you use a partial file specification, SQL uses
    the standard defaults. The DROP DATABASE statement deletes only
    the database files, whether or not there is also a repository
    directory containing database definitions.

3.3  –  literal-user-auth

    Specifies the user name and password for access to databases,
    particularly remote database.

    This literal lets you explicitly provide user name and password
    information in the DROP DATABASE statement.

3.4  –  PATHNAME

    Specifies a full or relative repository path name for the
    repository directory where the database definitions are stored.
    Use a path name instead of a file specification to delete the
    repository database definitions from the repository along with
    the database root and storage area files. See also the DROP
    PATHNAME statement.

3.5  –  USER username

    Defines a character string literal that specifies the operating
    system user name that the database system uses for privilege
    checking.

3.6  –  USING password

    Defines a character string literal that specifies the user's
    password for the user name specified in the USER clause.

4  –  Examples

    Example 1: Deleting files only

    The following statement deletes the database system files for
    the database associated with the database personnel.rdb. If this
    database also had definitions stored in a repository directory,
    this DROP DATABASE statement would not delete those definitions.

    SQL> DROP DATABASE FILENAME personnel;

    Example 2: Deleting files and repository definitions

    To delete database files and repository definitions, you
    must specify a repository path name in the DROP DATABASE
    statement. This statement deletes the repository directory
    CDD$TOP.ACCOUNTING.PERSONNEL in addition to all database root
    and storage area files associated with it.

    SQL> DROP DATABASE PATHNAME CDD$TOP.ACCOUNTING.PERSONNEL;
Close Help