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

Similar Messages

  • Do I need start the database before installing Oracle 9iAS portal?

    I found the Oracle white paper which talks about installing
    Oracle8i EE and Oracle 9iAS portal on windows 2000. Based this
    document, after Oracle 8i installaion but before installing
    Oracle 8.1.7.1.1 path, all the Oracle database related services
    startup type have been changed to 'Manual'.
    Based on my understanding, there are some objects will be
    created in this database during the installation of 9iAS portal
    repository. But this oracle white paper didn't say that I need
    have the database ruuning during the 9iAS installation. Do I
    need to start the database before installing 9iAS?
    Thanks

    hi,
    Even i am new to oracle application server and had the same doubt that you have.
    When you install Application Server there would be two tiers installed, application tier and middle tier, these tiers can be running from the same machine or different machines.
    These tiers will have a meta data repository to store application server related data, this database will be installed along with application server.
    It is upto you to install "oracle database 10gR2 " before or after installaion of application server, this will be an independent database which will have its own home, but after this installation you will have three homes, ex: infra_home,mid_home and 10gR2_home.
    by default oracle_home is set to the last installation that happens so if you install the database 10gR2 after installing application server it will point to 10gR2_home, but if you install 10gR2 before and application server later then the oracle home will be infra_home(if both the middle tier and infratier are on the same machine)
    you can always change the oracle home by using set ORACLE_HOME=path/to/oracle/home( in windows)
    or export ORACLE_HOME=path/to/oracle/home (in unix)
    hope this helps....
    regards

  • Check for duplicate record in SQL database before doing INSERT

    Hey guys,
           This is part powershell app doing a SQL insert. BUt my question really relates to the SQL insert. I need to do a check of the database PRIOR to doing the insert to check for duplicate records and if it exists then that record needs
    to be overwritten. I'm not sure how to accomplish this task. My back end is a SQL 2000 Server. I'm piping the data into my insert statement from a powershell FileSystemWatcher app. In my scenario here if the file dumped into a directory starts with I it gets
    written to a SQL database otherwise it gets written to an Access Table. I know silly, but thats the environment im in. haha.
    Any help is appreciated.
    Thanks in Advance
    Rich T.
    #### DEFINE WATCH FOLDERS AND DEFAULT FILE EXTENSION TO WATCH FOR ####
                $cofa_folder = '\\cpsfs001\Data_pvs\TestCofA'
                $bulk_folder = '\\cpsfs001\PVS\Subsidiary\Nolwood\McWood\POD'
                $filter = '*.tif'
                $cofa = New-Object IO.FileSystemWatcher $cofa_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
                $bulk = New-Object IO.FileSystemWatcher $bulk_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
    #### CERTIFICATE OF ANALYSIS AND PACKAGE SHIPPER PROCESSING ####
                Register-ObjectEvent $cofa Created -SourceIdentifier COFA/PACKAGE -Action {
           $name = $Event.SourceEventArgs.Name
           $changeType = $Event.SourceEventArgs.ChangeType
           $timeStamp = $Event.TimeGenerated
    #### CERTIFICATE OF ANALYSIS PROCESS BEGINS ####
                $test=$name.StartsWith("I")
         if ($test -eq $true) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("L")
           $tempItem=$left.substring(0,$pos)
           $lot = $left.Substring($pos + 1)
           $item=$tempItem.Substring(1)
                Write-Host "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\CofA.csv -Append -InputObject "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"
                start-sleep -s 5
                $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=PVSNTDB33; Initial Catalog=adagecopy_daily; Integrated Security=TRUE")
                $conn.Open()
                $insert_stmt = "INSERT INTO in_cofa_pvs (in_item_key, in_lot_key, imgfileName, in_cofa_crtdt) VALUES ('$item','$lot','$name','$timestamp')"
                $cmd = $conn.CreateCommand()
                $cmd.CommandText = $insert_stmt
                $cmd.ExecuteNonQuery()
                $conn.Close()
    #### PACKAGE SHIPPER PROCESS BEGINS ####
              elseif ($test -eq $false) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("O")
           $tempItem=$left.substring(0,$pos)
           $order = $left.Substring($pos + 1)
           $shipid=$tempItem.Substring(1)
                Write-Host "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\PackageShipper.csv -Append -InputObject "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"
    Rich Thompson

    Hi
    Since SQL Server 2000 has been out of support, I recommend you to upgrade the SQL Server 2000 to a higher version, such as SQL Server 2005 or SQL Server 2008.
    According to your description, you can try the following methods to check duplicate record in SQL Server.
    1. You can use
    RAISERROR to check the duplicate record, if exists then RAISERROR unless insert accordingly, code block is given below:
    IF EXISTS (SELECT 1 FROM TableName AS t
    WHERE t.Column1 = @ Column1
    AND t.Column2 = @ Column2)
    BEGIN
    RAISERROR(‘Duplicate records’,18,1)
    END
    ELSE
    BEGIN
    INSERT INTO TableName (Column1, Column2, Column3)
    SELECT @ Column1, @ Column2, @ Column3
    END
    2. Also you can create UNIQUE INDEX or UNIQUE CONSTRAINT on the column of a table, when you try to INSERT a value that conflicts with the INDEX/CONSTRAINT, an exception will be thrown. 
    Add the unique index:
    CREATE UNIQUE INDEX Unique_Index_name ON TableName(ColumnName)
    Add the unique constraint:
    ALTER TABLE TableName
    ADD CONSTRAINT Unique_Contraint_Name
    UNIQUE (ColumnName)
    Thanks
    Lydia Zhang

  • Do I need to have data before performing Drag and Drop????

    I have gotten drag and drop working with Swing in JDK 1.4b2 using "URL-based" files instead of operating system native files. The way this was accomplished by creating a wrapper class that sub-classed File and would download the contents of the URL to a temporary file and then initiate a normal drag and drop operation using the normal java file mechanisms. However, when you have a large file, the operation can take too long since I am fronting all of the effort at the start of the drag. I would like to be able to delay the need to produce the bytes/files to give to the operating system until after there has been a successful drop, at which point I can do the heavy lifting and raise a dialog telling them that the action is commencing. As best as I can tell, you must have all of the data BEFORE any operation (which could be a potential design flaw!!)
    So, is there a way to get a hook that there has been a successful drop to a vm-external drop target before the VM gives the data over? Even if I create my own data flavor (which isn't well documented outside of Text types) won't I still run into the same problems? Am I just overlooking something simple?
    Thanks for your help.

    Hello
    I've had the same problem, but take a look at: http://foxtrot.sourceforge.net/
    You can use their API to start the long consuming time job (reading files from the network) and also to paint a progress bar, showing the progress in the Event Dispatch Thread.
    This is how I've solved my problem:
    I've passed a MyTransferable object to the startDrag method of the DragGestureEvent event.
    In the getTransferData method of MyTransferable object (that implements Transferable interface) I've used the Worker.post method of their API which reads the file from the network and updates a progress bar.
    The API lets the Event Dispatch Thread enter but not return from the listener method (getTransferData in my case), instead rerouting the Event Dispatch Thread to continue dequeuing events from the Event Queue and processing them (repaint the progress bar). Once the worker thread has finished, the Event Dispatch Thread is rerouted again, returning from the listener method.

  • 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 --

  • How to truncate / drop database automatic?

    Using: 10gR2 and "imp" and "exp" for Import/Export.
    Hi.
    We have a problem. We have two databases. One to test/develope and one live database.
    The test/developers one was created with a full dump after settin up the developer server.
    Now we want to actualize the test/developer server with the live database.
    The best way would be a normal import from a full dump file which overwrites all existing data.
    Now we try it with "ignore=y" (it runs longer than 6h) and it seems to append all not existing data in the test/database from the full-dump (of the live server).
    Is it the only way (to have a full clone) to drop/truncate the old DB and import than the data?
    Can we automate the truncating/droping before import?
    It would be to much work every time to delete the whole database, create it, create tablespaces, import the dump-file and so on.
    What is the easiest way to do that?
    Or is there no need to drop/truncate?
    Thanks for your help!

    The problem is, that importing the live database in the test system doesn´t update (because all tables, many rows, ... already exists) the database when ignore=n is set.
    If we set ignore=y we get several of messages (and it runs up on 6h for a whole import), because many many rows exists (there are several foreign keys and constraints).
    Then only the rest (newest) rows will append.
    So if we want to import all new (fresh) from the live system (because direct overwriting does not work), we want to truncate/drop the database to get all fresh in (but does not recreate the whole database).
    But I don´t know if there is a automaticated solution to truncate the whole database (and does not do it for each table by hand).
    System privileges are not the problem, we have to import with sys as sysdba privileges.

  • 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

  • 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.

  • Do i need to install 10gr1 before installing 10gr2

    My assumption was that i don't need to install 10gr1 before installing 10gr2, but when i downloaded "10g Release 2 (10.2) for AIX 5L Based Systems (64-Bit)" from otn website, Its size was only 1.2GB and after i unzip and did cpio command, It only extracted "Disk1"
    thanks.

    As of Oracle10g, they have reorganizsed their install and disk layout.
    The database code and minimum configuration is installed only from disk 1, options and extensions are on the Companion CD and Client things including the 10g version of 9i Java OEM console are on the Client CD. Each is separate.

  • 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

  • At time of switchover do we need to shutdown database

    Hi
    Oracle RDBMS : 11.2.0.2 RAC 4-node on RHEL 5.6
    What are the steps for perfoming switchover between primary and physical standby,Do we need to shutdown the primary and physical standby databases before perfoeming switchover?

    951368 wrote:
    Hi
    Oracle RDBMS : 11.2.0.2 RAC 4-node on RHEL 5.6
    What are the steps for perfoming switchover between primary and physical standby,Do we need to shutdown the primary and physical standby databases before perfoeming switchover?No but you need to shut down all but one primary database instance. then you can restart the shutdown instances after the switchover task is completed.
    read: http://docs.oracle.com/cd/B28359_01/server.111/b28294/role_management.htm#i1026398
    Tobi

  • Need to drop a current redo log on a Standby

    Oracle 11.2.0.2
    I have 3 redo logs on a newly created Standby database.
    SQL> SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;
    GROUP# ARC STATUS
    1 YES UNUSED
    3 NO CURRENT
    2 YES UNUSED
    The redo log in Group 3 needs to be dropped and recreated. How can I force a log switch on a Standby in mount mode?
    SQL> alter database drop logfile group 3;
    alter database drop logfile group 3
    ERROR at line 1:
    ORA-01623: log 3 is current log for instance ufms216 (thread 1) - cannot drop
    ORA-00312: online log 3 thread 1: '/path/redo03.dbf'
    SQL> alter system switch logfile;
    alter system switch logfile
    ERROR at line 1:
    ORA-01109: database not open
    Please help !!!
    Thanks!
    Dave

    SAME ERROR/SITUATION
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area 1.2527E+10 bytes
    Fixed Size 2231240 bytes
    Variable Size 3657434168 bytes
    Database Buffers 8858370048 bytes
    Redo Buffers 8691712 bytes
    Database mounted.
    SQL> SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;
    GROUP# ARC STATUS
    1 YES UNUSED
    3 NO CURRENT
    2 YES UNUSED
    SQL> alter database drop logfile group 3;
    alter database drop logfile group 3
    ERROR at line 1:
    ORA-01623: log 3 is current log for instance ufms216 (thread 1) - cannot drop
    ORA-00312: online log 3 thread 1: '/a0253/d01/oradata/ufms216/redo03.dbf'
    SQL> alter system switch logfile;
    alter system switch logfile
    ERROR at line 1:
    ORA-01109: database not open
    SQL> alter database recover managed standby database cancel;
    alter database recover managed standby database cancel
    ERROR at line 1:
    ORA-16136: Managed Standby Recovery not active
    SQL>
    HELP!

  • 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 in Oracle9i

    I have a situation wherein I need to drop a database and recreate the database using a different NLS_characterset. The software (Cognos) I am trying to install will not accept the default characterset and only prefers in a particular format. I am using Oracle 9i. I would like to know how I could drop the database and recreate a new one database with the correct characterset.
    Also, can you advise me as to how to create the database using NLS_CHARACTERSET with either UTF-8 or AL32UTF8? Also, is there a way I can change this parameter in my existing database to the value I need. I need to address this immediately. Can the experts on this forum please guide me.

    Eliminating a database is quite easy, you can do it either manually or by means of the dbca. By means of the dbca you can also create a customized database and specify the desired character set.
    Another option is to try to change the database character set, but prior to execute this task you should use the character set scanner tool to verify if your character set is suitable to be changed. You are required to use the csscan tool to determine if this is or isn't possible.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Drop objects before import?

    I've read an unofficial article stating that whenever you do subsequent imports on the same database, one should drop existing objects in order not to produce duplicate data. Is this valid also when one passes the 'ignore = yes' argument to the 'imp' command?
    Also, I would like to know how to import/export everything except the system tablespace. Is this possible to do in a simple step? Bear in mind that i want to do regular imports on the same database to fake a sync between two databases.

    one should drop existing objects in order not to produce duplicate data. Is this valid also when one passes the 'ignore = yes' argument to the 'imp' command?when you are importing, oracle first executes ddl, like creating the object, if it found, then says already exists and then skips to the next step of import. If you say ignore=y, then, it wont display error message. Thats it.
    Bear in mind that i want to do regular imports on the same database to fake a sync between two databases. incremental exports you can do it, but, not a great idea to do so. For this, you can use replication rather.

Maybe you are looking for

  • Problem with CMS track for a SCA

    Hi, in my NWDI, I have a track which contains a SCA (for SAP_ESS), can i chekin that track in my local NWDS, modify that DC (the webDynpro project), and directly deploy it from my NWDS studio on a sap j2ee server, instead of cheking out and importing

  • FXO to FXO disconnect problem - Part1

    Hi, I have 2 sites connected through an hdlc leased line. Each site has router 1750 with one VIC - 2FXO. Once a call is placed both FXO are stuck in the off hook state. So there is no way to make another call unless I shut down and turn on the ViC ag

  • What would cause a prolonged blue screen during start up?

    I have an iMac desktop.  Recently I've had trouble with a prolonged blue screen during start up (approx. 10 mins) before it finally takes me to the login screen.  Any ideas why this is happening? Jeff P.

  • If I restore and update my old iPhone, will it mess up my iPhone 3G

    I have an iPhone 3G running 2.2.1 but still use my deactivated first generation iPhone more or less as an iPod Touch. If I update the software on the old phone to the 2.2.1 will it mess up the AT&T registration for my 3G phone during the setup proces

  • 1.5 sometimes freezes when running statements with F9

    I had noticed occasional freezes when hitting F9 with 1.5.0 production (ie three or four times last week), but after upgrading to 1.5.1 today (fresh install, migrated preferences) I have had four or five freezes when hitting F9. The UI completely fre