Drop database

Hi,
in 11G R2
to drop database, it should be in restrict mode. How to put it in strict :
alter database mount restricted
Thank you.

Kuljeet Pal Singh wrote:
shutdown abort;
startup mount exclusive restrict;
drop database;Instead of shut abort, you can start with force :)
startup force mount exclusive restrict;

Similar Messages

  • Unable to drop database user

    Hi All,
    I am unable to drop database user and getting the folllowing error:
    " must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables "
    I find 3 table with AQ prefix in the schema but unable to drop these table even by using "sys" user.
    Any idea how can I do that ?
    Regards,

    Hi,
    select object_name,object_type from dba_objects where owner='USERNAME' and object_name like '%AQ%';TO drop the queue table, login as the owner and
    exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'PASTE_THE_OBJECT_NAME_FROM_ABOVE',force =>TRUE);Anand

  • Drag and dropping database objects in Jdev

    I evaluated Visual Cafe and deciding wheather to go with VC or JDev. One of the cool things I noticed in VC is that one can drag and drop database objects in the form using DBNavigator. I haven't seen anything similar in JDev 3.1. Does this or something similar exist in JDev?
    Regards,
    Mark

    Mark,
    Yes, the DB Navigator in Visual Cafe may provide a nice simple look at the database Tables - but so does JDeveloper's Database Navigator - VC may excel in the Drag and Drop functionality - but this is not the real objective. Let me explain...
    When creating a real enterprise level application in Visual Cafe, you begin to discover that DB Navigator along with it's nifty Drag & Drop is no match for JDeveloper's unprecedented level of database integration. JDeveloper's Database related integration includes (but not limited to):
    - JDevelopers Database Navigator
    - Integrated SQLJ environment
    - Tight Business Components for Java (BC4J) integration
    - Wizard driven Form generation (thin & thick)
    - DAC Controls / InfoSwing components
    - Named Connections / Connection Manager
    - WebBeans / JSP Element Wizard
    The closest thing in JDeveloper to what you are referring to in VC is JDeveloper's support for the Design mode which allows you to design both graphical and non-graphical elements. In particular, JDeveloper allows you to design your InfoSwing and InfoProducer components using the Designer - by selecting the component (JavaBean) from the Component Palette and then [Dragging Optional] Dropping it on either the Design Canvas or the Structure pane (lower pane of Navigator window).
    For non-visual elements (such as InfoProducer elements), the Structure pane allows for Creation via Drag & Drop and allows for property setting by using the Property Inspector (Since it is a JavaBean...).
    There are many reasons why JDeveloper provides a much richer and more productive development environment than Visual Cafe. Most have to do with seeking a complete enterprise level solution. JDeveloper adresses the enterprise level application developers needs directly with integration of elements from Tools & Wizards to the integration of a complete application development framework - Oracle Business Components for Java - No other tool can provide you with such a rich and productive development environment.
    John - JDeveloper Team
    null

  • Drop database link

    I'm having trouble dropping a database link. In SQLPlus I get:
    SQL> SELECT db_link FROM USER_DB_LINKS where db_link like 'PROD%';
    DB_LINK
    PROD.CBS.STATE.OR.US
    PROD.CBS.STATE.OR.US
    PROD_DB.CBS.STATE.OR.US
    PROD_RI.CBS.STATE.OR.US
    SQL> drop database link PROD_RI.CBS.STATE.OR.US;
    drop database link PROD_RI.CBS.STATE.OR.US
    ERROR at line 1:
    ORA-02084: database name is missing a component
    This is the method identified in the 10g manual: http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10739/ds_admin.htm#sthref3729
    When I try to drop the same link using OEM, I get the message:
    ORA-02024: database link not found
    In the case of OEM, I'm logging on as a different user then the owner of the link. In the case of SQLPlus, I get the same error whether or not I'm logged in as the owner of the db link, or myself.
    Thanks,
    Chuck

    Using the quotes worked:
    drop database link "PROD_RI.CBS.STATE.OR.US";
    but only if I own the database link. How, as the DBA, can I get rid of a link that someone else created (our DEV system is littered with experiemental links).
    The same above doesn't work if it's owned by someone else:
    SQL> DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US";
    DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US"
    ERROR at line 1:
    ORA-02024: database link not found
    I tried changing the schema context to no avail either:
    SQL> DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US";
    DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US"
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Thanks,
    Chuck

  • Drop database link & ORA-02082 Error

    Hello,
    I have created db link. Now, I would like to DROP it but I got "ORA-02082 a loopback database link must have a connection qualifier".
    I have tried every possible combination but without success.
    Thanks for help
    sasa

    Hello Barbara,
    I agree with you that if db link exist I should be able to drop it. If you look into my first reply there is complete select from user_db_links. Select from dba_db_links are the same because I haven't any others db links. I try to drop the db link as owner or as sys. I do not need to think about drop with name "qwer.cscargo.cz" because is wrong (our inner domain is "in.cscargo.cz"). The only difference among others db links is that qwer have "current_user".
    DB_LINK USERNAME HOST
    CARGODB.IN.CSCARGO.CZ CARGO_ADM cargodb
    LMDB.IN.CSCARGO.CZ CARGO_ADM lmdb
    QWER.IN.CSCARGO.CZ CURRENT_USER speisdb
    SPEISDB.IN.CSCARGO.CZ CARGO_ADM speisdb_rac
    There could be one problem. I created the db link when my db have name "speisdb". I rename my db (using rman - duplicate db) to "speisdev". Could be this source of problems?
    Here is output of your drop script:
    drop database link qwer
    ERROR at line 1:
    ORA-02082: a loopback database link must have a connection qualifier
    drop database link qwer.cscargo.cz
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.in.cscargo.cz
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop database link qwer@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.in.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop public database link qwer
    ERROR at line 1:
    ORA-02082: a loopback database link must have a connection qualifier
    drop public database link qwer.cscargo.cz
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.in.cscargo.cz
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop public database link qwer@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.in.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02084: database name is missing a component
    Thanks SASA

  • Drop database deletes the alert log

    Hi DBA's ,
    I ran into a strange situation i never faced before.
    We have a Oracle database version 11.2.0.3.0.
    This is dev db which i had to refresh from production via rman.
    After the  drop database command finished all the contents of my trace folder dissapered including the alert log.
    Has anyone faced this situation before or help me understand what happened

    himmy, if you are dropping the database why would you need the old alert.log or any other diagnostic directory files?  Ideally if you drop a database there should be no record of it left on the system when the drop completes.  Why is this a problem?
    If you are refreshing the database from production then instead of dropping the database and creating a new database via rman restore perhaps you should be using either the export/import transportable tablespace feature to move the files or traditional export/import of the data.
    HTH -- Mark D Powell --

  • Steps to drop database in RAC

    Hi
    I m kinda new in RAC environment.I drop database by DROP DATABASE; but other files still left behind like in CRS repository. Here are some issues that I have to deal with:
    . delete all parameter file or password file etc from $ORALCE_HOME/dbs
    . remove detail from /etc/oratab
    . drop ASM diskgroup
    i have to put these steps in .sql script. it would be appreciated if you tell me these three steps. thanks

    When you are dropping a RAC database you need to remember the layers of configuration that support that object. Or, if you don't want to peel back the layers one at a time use DBCA to simplify the process. I still use DBCA because it resolves these dependency issues for me.
    The top most layer in a Cluster Database Configuration is the Cluster Managed Database services (Grid, dbca, or srvctl typically used for maintenance)
    The next layer from the top is the Cluster database and it's instances (Grid, dbca, srvctl, or sqlplus used for maintenance)
    Below the Cluster database is the shared storage. This is typically a cluster file system (ASM, ocfs, QFS, VxFS, etc...) In the case of ASM (grid, dbca, srvctl, or sqlplus may be used for maintenance) other cluster file systems have their own maintenance tools.
    A peer at the level of shared storage is the clusterware Node Apps. These processes (ons,gsd,vip and listener) provide the high availability framework for Oracle Clusterware. Clusterware requires shared storage for Cluster Registry and Voting Disks (raw or cluster file system)
    (srvctl and/or crs_* for maintenance
    (oracle or OSDBA above this level)
    (root or local admin below this level)
    Oracle Clusterware is an extension to the base OS and is the low level interfaces between the Oracle Stack and Operating System. (crs_* utilities and crsctl)
    Hardware & OS: it all needs too start here. OS user, User equivalence, Networking (TCP/IP, UDP), DNS or hosts resolution, Network Time Protocol, Watchdog Timer (linux), Storage Mapping (disks, luns, mounts)
    So, back to your original question about dropping a RAC database. The easiest way is with DBCA. Or, you could look up the commands to unwind each layer and peel it off one step at a time.
    Kevin

  • Drop database vs. dbca delete database

    So I'd like to delete this database: control files, datafiles, log files, spfiles, everything. leave no trace.
    I can use good old sqlplus and run "drop database;", or I can use DBCA and do "delete database".
    What is the difference?
    Documentation clearly explains what "drop database" will do, but it does not explain what DBCA is doing (maybe just running drop database behind the curtains?).

    from the book of «OCP - Oracle Database 10g Administration I», Chap 3. -- Using the DBCA to Delete a Database p 3 - 14
    «Dropping a database involves removing its data files, redo log files, control files, and
    initialization parameter files. The DROP DATABASE statement deletes all control files and all
    other database files listed in the control file. To use the DROP DATABASE statement
    successfully, all the following conditions must apply:
    • The database must be mounted and closed.
    • The database must be mounted exclusively—not in shared mode.
    • The database must be mounted as RESTRICTED.
    An example of this statement is:
    DROP DATABASE;
    The DROP DATABASE statement has no effect on archived log files nor does it have any effect
    on copies or backups of the database. It is best to use Recovery Manager (RMAN) to delete such
    files. If the database is on raw disks, then the actual raw disk special files are not deleted.»
    there is no distinction between the DBCA Delete a database and the drop database statement.

  • ORA-02026 when dropping database.

    Is the Drop Database functionality available in 9i? This is what I get when I try to execute the statement under sys. I also went through the DBCA to drop the database but for some reason none of my databases are showing up in it. Looked under the help file, and it said my SID is not in its "Shell"... whatever that means...
    SQL> DROP DATABASE;
    DROP DATABASE
    ERROR at line 1:
    ORA-02026: missing LINK keyword
    So. my question is, is there a way to get my databases to show up in the DBCA? If not, how do I drop a database in 9i manually? Thanks for all the help so far :)

    Thats cute guys, but you fail to notice 98% of the questions that are asked on this forum can be answered directly from some kind of documentation written either in the past or close to present. If what your asking is for people to check documentation before posting, what your really asking for is a INACTIVE FORUM.
    So tell me, who's being lazy? The developer thats found a faster way to get their questions answered (which coincidentally is getting more work done at light speed) or the plethora of "trying-to-be-oracle-aces" who continually ask for less work on the very forum they're supposed to help people on?
    I imagine that this forum is supposed to help oracle lessen the work load of meta-link. So do you job guys, and help some people. Flaming people will just make you look like an *ss.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • DUPLICATE: NEED TO "DROP DATABASE" BEFORE REFRESH OR CAN REMOVE DATAFILES

    I have TARGET and AUX, i need to REFRESH my AUX, so the question is:
    i need to "DROP DATABASE" or just REMOVE DATAFILES, CONTROLFILES, REDO LOGS?
    Sure, i will create new INIT.ORA , etc...
    Cheers

    Either command will do.
    Hemant K Chitale

  • Unable to DROP DATABASE

    Hi,
    I am trying to drop a database from oracle 10g RAC environment.
    I have stopped the instance.
    I am following the following steps
    $ export ORACLE_SID=databasesid
    $ sqlplus "/ as sysdba"
    SQL> STARTUP MOUNT RESTRICT;
    SQL> DROP DATABASE;
    DROP DATABASE
    ERROR at line 1:
    ORA-01586: database must be mounted EXCLUSIVE and not open for this operation
    Please help.

    1. Stop the database
    2. Make sure you will never need the database again.
    3. Repeat 2.
    4. Drop all of the files associated with the database -- Data, control, archived redo, online redo, pfile, spfile, alert log, bdump, udump, cdump, audit.
    5. Delete any backups.
    -- Database gone.

  • Dynamic drop database link

    Hi,
    As user SYS i need to Dynamically DROP all the database link in the Database.
    I cant drop private database link .
    For example i have few database links under APPS schema that i would like to drop.
    Please note that it should be done by SYS user
    SQL> declare
      2 
      3  cursor c is
      4  select *
      5  from dba_db_links;
      6 
      7 
      8  begin
      9  for c_rec in c loop
    10 
    11      if c_rec.owner = 'PUBLIC' then
    12          execute immediate ' drop public database link '||'"'||c_rec.db_link||'"';
    13      else
    14          dbms_output.put_line (' drop database link '||'"'||c_rec.db_link||'"');
    15           execute immediate ' drop database link '||'"'||c_rec.db_link||'"';
    16      end if;     
    17  end loop;
    18 
    19  end;
    20  /
    drop database link "APPS_TO_APPS"
    declare
    ERROR at line 1:
    ORA-02024: database link not found
    ORA-06512: at line 15Thanks

    791550 wrote:
    Yet it doest work please see bellow:Correct. The domain name can optionally be included with the database name. So if you for example want to drop database link "ABC.DEF.WORLD.COM", does ABC refer to the link name and DEF.WORLD.COM to the domain?
    Or is ABC the schema name, DEF the link name and WORLD.COM the domain?
    And what is schema ABC exists with link DEF.WORLD.COM and in the current schema there's a link called ABC for domain DEF.WORLD.COM ?
    So there is no clean and correct way for Oracle to resolve the schema scope of a database link name.
    If you, as SYS, want to drop all database links, then you can use the DBMS_SYS_SQL interface - this is a (mostly undocumented) interface for parsing SQL as any specific schema on the database. The DBMS_SQL interface (restricted to parsing as the current schema) is documented and runs on top of this system interface.
    E.g.
    create or replace procedure DropDbLink( schemaName varchar2, dbLink varchar2 ) is
            cur     number;
            plsql   varchar2(1000);
            uid     number;
            rc      number;
    begin
            select
                    u.user_id into uid
            from    dba_users u
            where   u.username = schemaName;
            plsql := 'drop database link "'||dbLink||'"';
            cur := SYS.DBMS_SYS_SQL.open_cursor;
            SYS.DBMS_SYS_SQL.parse_as_user(
                    c => cur,
                    statement => plsql,
                    language_flag => DBMS_SQL.native,
                    userID => uid
            rc := SYS.DBMS_SYS_SQL.execute( cur );
            SYS.DBMS_SYS_SQL.close_cursor( cur );
    end;
    /This proc, as SYS, allows you to drop any private database link from the SYS schema.

  • How to drop database?

    15:54:38 SYS AS SYSDBA@orcl>shutdown immediate;
    Base de datos cerrada.
    Base de datos desmontada.
    Instancia ORACLE cerrada.
    15:55:11 SYS AS SYSDBA@orcl>startup mount
    Instancia ORACLE iniciada.
    Total System Global Area 289406976 bytes
    Fixed Size 1290184 bytes
    Variable Size 201326648 bytes
    Database Buffers 79691776 bytes
    Redo Buffers 7098368 bytes
    Base de datos montada.
    15:55:53 SYS AS SYSDBA@orcl>drop database;
    drop database
    ERROR en línea 1:
    ORA-12719: la operación necesita que la base de datos está en modo RESTRICTED
    15:59:00 SYS AS SYSDBA@orcl>STARTUP MOUNT RESTRICT
    Instancia ORACLE iniciada.
    Total System Global Area 289406976 bytes
    Fixed Size 1290184 bytes
    Variable Size 209715256 bytes
    Database Buffers 71303168 bytes
    Redo Buffers 7098368 bytes
    Base de datos montada.
    15:59:59 SYS AS SYSDBA@orcl>drop database;
    Base de datos borrada.
    tnx!!!

    A good practice is to specify the OS and DB versions at the top of your thread. Do you want to 'Drop' a database or do you want to wipe it off from your OS. You could use Yingkuan advice, just use dbca, if it is not possible, depending on the OS you are currently working with, you should remove the Windows service, deconfigure it and physically remove it or simply, on unix like platforms, just remove it and remove its configuration.
    ~ Madrid
    http://hrivera99.blogstpot.com

  • Sql Drop database;

    Hello All:
    I always used the old approach of deleting the files data,log,control prior to any database refresh using OS rm command. Currently with 11gR2 2node RAC cluster , storage on ASM i did the same successfully. Just wondering for any inputs on using SQL>DROP DATABASE; Command if anyone has used it just so i can avoid a few steps in the refresh process. Your experiences will definetely help.
    Thanks
    San~

    I,do not need manually delete datafile/controlfile/logfile,you can use drop database;
    sqlplus "/as sysba"
    shutdown immediate;
    startup mount;
    alter system enable restricted session;
    drop database;
    all files related this database will automatically delete,but recommend way is using DBCA.
    In additonally, you have to need to use srvctl to remove specific instances settings from CRS,also you can drop ASM disk groups.

  • Can't catalog or drop database

    I was creating a db for pruning my db2hist files.  That another thread.  Problem is that the database that I created and lists in the db won't drop as it says from the db2 drop db DOD .....database DOD could not be found.  List db directory shows it. 
    Database 1 entry:
    Database alias                       = DMD
    Database name                        = DMD
    Local database directory             = /db2/P01
    Database release level               = d.00
    Comment                              =
    Directory entry type                 = Indirect
    Catalog database partition number    = 0
    Alternate server hostname            =
    Alternate server port number         =
    I tried to catalog it but it doesn't work as the files are no longer there.  How can I trick DB2 (or what do I need to do) to resolve this and get rid of this entry?
    Thanks,
    Len.

    Hi Leonard
    Could you please try below steps.
    db2 "connect to DBSID"
    db2 "quiesce database immediate force connections"
    db2 "unquiesce database"
    db2 "force application all"
    db2stop force
    db2start
    db2 "drop database DBSID"
    Thanks
    Sadiq

Maybe you are looking for