Locking of Database

I have heard of that the database can be put in locked mode so that some activity like re-building of database indexes can be done. In the locked mode, nobody should be able to work with the application else any activity like even index re-building can take a long time to complete. I hope, my question is clear.
Please, help in solving the doubt.
regards

Aside from the fact that rebuilding indexes is almost never necessary, I'm guessing that what you are talking about is what the documentation would refer to as quiescing the database.
Justin

Similar Messages

  • Re: what is difference between sap locking and database locking

    hi,
        what is difference between sap locking and database locking. Iam locked the table mara by using lock objects.
    But iam unable to unlock the mara table. I give u the coding. Please check it.
    REPORT zlock .
    CALL FUNCTION 'ENQUEUE_EZTEST3'
    EXPORTING
       MODE_MARA            = 'S'
       MANDT                = SY-MANDT
       MATNR                = 'SOU-1'.
    call transaction 'MM02'.
    CALL FUNCTION 'DEQUEUE_EZTEST3'
         EXPORTING
              mode_mara = 'E'
              mandt     = sy-mandt
              matnr     = 'SOU-1'.
    IF sy-subrc = 0.
      WRITE: 'IT IS unlocked'.
    ENDIF.

    Hi Paluri
    Here is the difference between SAP locks and Database locks, i will try to find the solution to your code.
    Regards
    Ashish
    Database Locks: The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. This means that database locks can never be set for longer than a single database LUW; in other words, a single dialog step in an R/3 application program.
    Physical locks in the database system are therefore insufficient for the requirements of an R/3 transaction. Locks in the R/3 System must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must apply on all servers in that R/3 System.
    SAP Locks:
    To complement the SAP LUW concept, in which bundled database changes are made in a single database LUW, the R/3 System also contains a lock mechanism, fully independent of database locks, that allows you to set a lock that spans several dialog steps. These locks are known as SAP locks.
    The SAP lock concept is based on lock objects. Lock objects allow you to set an SAP lock for an entire application object. An application object consists of one or more entries in a database table, or entries from more than one database table that are linked using foreign key relationships.
    Before you can set an SAP lock in an ABAP program, you must first create a lock object in the ABAP Dictionary.

  • How to find out who is locking my database account ?

    Hi,
    Which dynamic view can help me to find out who is locking my database account ?
    Thanks

    Yoav wrote:
    Hi,
    Which dynamic view can help me to find out who is locking my database account ?
    Thanksdoes account have PROFILE?
    if so, repeated failed logons can result in locked account.
    enable AUDIT to see from where logins originate.

  • How to lock a database Z table before updating it through a report program

    Hi,
    How to lock a database Z table before updating it through a report program and also how to unlock it after my updation.
    The whole process is done through report program.

    Hi,
    Go to SE11, in the option 'Lock object' enter the name of your lock,
    begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the
    table name where the record you want to lock exist and select the
    lock mode. Lock mode can be shared and exclusive. If 'shared',
    when you lock the record, other can also read data, but can not
    modify. If 'exclusive', when you lock the record, other can neither
    read nor modify the record. After save and activate, you will get two
    function module.'ENQUEUE_EXXXX' to lock record,
    'DEQUEUE_EXXXX' to release lock on one record.
    When use this function module it only lock one record at a time. It
    does not lock the table.
    Regards,
    Omkaram.

  • How to manage and prevent database lock for database admin and development

    how to manage and prevent database lock for database admin and development
    [email protected]

    Hi,
    can someone advise me some good book or even better a PDF or a white paper on the Web where it's explained well how to design and manage a relational database (that is normal forms, tuning, design, implemantation...)?
    I've been working on Oracle databases for a few years as pl sql programmer, but I'd like to read something describing well the relational database theory, because I've been asked to work as database designer.There are many books available in the market, please go through this link -- http://www.amazon.com/gp/bestsellers/books/549646/ref=pd_ts_b_nav
    I've been told to read "Fundamentals of Database Systems" by Ramez Elmasri, but I ask here for some more advices.I would strongly recommend reading this book, it was my best reference during my college study and even after starting my DBA career.
    Thanks,
    Hussein

  • DB Adapter polling and logical delete: Process succeed but lock on database

    We have the following busisness flow, that reseult in a BPEL behaviour we did not expect. I hope that some of you had the same exeprience.
    The database adpater polls from a table new records based on a value (20) in a status field. When it finds records, it will process them and update the status field (20 -> 30).
    When we update from sqlplus a record, select for update on record with status 20, then We see in the logging that the update fails, but the process ran sucessfully. At the database we see an outstanding lock. If we commit the sqlplus session (after a few minutes), the status field is updated to 30.
    This is strange to me, the BPEL process was already sucessfully finished.
    Anyone seen this behaviour?
    Regards,
    Marc
    The logging
    <2006-05-02 13:06:37,052> <DEBUG> <default.collaxa.cube.activation> <Database Adapter::Inbound> <oracle.tip.adapter.db.TopLinkLogger log> SELECT STATUS,
    USERID FROM AQADM.TEST_UPDATE_VANUIT_BPEL WHERE ((STATUS = ?) AND ((STATUS <> ?) OR (STATUS IS NULL)))
    /ORA-
    <2006-05-02 12:03:21,473> <DEBUG> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Delivery Thread 'JCA-work-instance:Database Adapter-0 pe
    rforming unsynchronized post() to localhost
    <2006-05-02 12:03:21,879> <DEBUG> <default.collaxa.cube.activation> <Database Adapter::Inbound> <oracle.tip.adapter.db.TopLinkLogger log> begin transact
    ion
    <2006-05-02 12:03:21,881> <DEBUG> <default.collaxa.cube.activation> <Database Adapter::Inbound> <oracle.tip.adapter.db.TopLinkLogger log> UPDATE PROV.PR
    OV_USER_ACCOUNT SET STATUS_CMMAC = ? WHERE (PUAT_ID = ?)
    bind => [30, 81600]
    <2006-05-02 12:03:22,188> <WARN> <default.collaxa.cube.activation> <Database Adapter::Inbound> <oracle.tip.adapter.db.InboundWork runOnce> Exception dur
    ing polling of the database ORABPEL-11624
    DBActivationSpec Polling Exception.
    Query name: [prov_cmmac], Descriptor name: [PROVprocessmacaddress.ProvUserAccount]. Polling the database for events failed on this iteration.
    If the cause is something like a database being down successful polling will resume once conditions change. Caused by Exception [TOPLINK-4002] (OracleAS
    TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException
    Exception Description: java.sql.SQLException: ORA-20220: MDB3 ERR: session not in admin mode
    ORA-06512: at "PROV.PUAT_BUR", line 90
    ORA-04088: error during execution of trigger 'PROV.PUAT_BUR'

    The following entry:
    <MESSAGE>
    <HEADER>
    <TSTZ_ORIGINATING>2008-12-11T17:50:20.119+01:00</TSTZ_ORIGINATING>
    <COMPONENT_ID>tip</COMPONENT_ID>
    <MSG_TYPE TYPE="TRACE"></MSG_TYPE>
    <MSG_LEVEL>16</MSG_LEVEL>
    <HOST_ID>u514603.cmcdev.be</HOST_ID>
    <HOST_NWADDR>10.151.70.3</HOST_NWADDR>
    <MODULE_ID>esb.server.service.impl.inadapter</MODULE_ID>
    <THREAD_ID>18</THREAD_ID>
    <USER_ID>orasoad</USER_ID>
    </HEADER>
    <CORRELATION_DATA>
    <EXEC_CONTEXT_ID><UNIQUE_ID>10.151.70.3:11323:1229014220014:8</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
    </CORRELATION_DATA>
    <PAYLOAD>
    <MSG_TEXT>JCA: &lt;oracle.tip.adapter.db.TopLinkLogger log> SELECT UNIQUE_SUPPLIER_ID, SUPPLIER_NAME, SUPPLIER_NUMBER, NUMBER_TYPE, CM_SUPPLIER_TYPE, VAT_REGISTRATION_NUM, M_NUMBER, ADM_ID, OFB_PARTY_ID, CENTURY, LANGUAGE, ATTRIBUTE_CATEGORY, SPARE6, SPARE8, SPARE9, SPARE10, SPARE11, SPARE12, SPARE13, SPARE14, SPARE15, STATUS, ERROR_CODE, FILE_ID FROM XXCM.XXCM_AP_SUPPLIERS WHERE (STATUS = ?) ORDER BY UNIQUE_SUPPLIER_ID ASC FOR UPDATE NOWAIT
         bind => [MINE[undef:instance]]
    </MSG_TEXT>
    </PAYLOAD>
    </MESSAGE>
    can be found in $ORACLE_HOME/j2ee/oc4j_soa/log/oc4j_soa_default_group_1/oc4j/*.xml
    Regards

  • Script to find locks in Database with Date and time.

    Hi all,
    I used to have a script which i have lost now due to a recent laptop crash. This script used to find locks in the database.. along with the date and time since when it is locking the session.
    It was quite a comprehisive one. I think i found it on this forum only, but not able to find it now. Can someone please help me find one such comprehensive script.
    Currently I am using this script.. which is also good.. but does not have the date and time stamp on it. Is there something better.?
    SET LINESIZE 165
    SET PAGESIZE 66
    COLUMN oracle_user     FORMAT a15      HEADING 'Oracle User'
    COLUMN usercode        FORMAT a12      HEADING 'SID/Serial#'
    COLUMN os_user         FORMAT a10      HEADING 'O/S User'
    COLUMN program         FORMAT a25      HEADING 'Program'
    COLUMN mode_held       FORMAT a15      HEADING 'Mode Held'
    COLUMN mode_requested  FORMAT a15      HEADING 'Mode Requested'
    COLUMN lock_type       FORMAT a15      HEADING 'Lock Type'
    COLUMN object_name     FORMAT a30      HEADING 'Object Name'
    COLUMN lock_time_min   FORMAT 999,999  HEADING 'Lock Time (min)'
    SELECT
    s.username                                 oracle_user
    +, l.sid || '/' || s.serial# usercode+
    +, s.osuser os_user+
    +, s.program program+
    +, DECODE(l.lmode,+
    +1, NULL,+
    +2, 'Row Share',+
    +3, 'Row Exclusive',+
    +4, 'Share',+
    +5, 'Share Row Exclusive',+
    +6, 'Exclusive', 'None') mode_held+
    +, DECODE(l.request,+
    +1, NULL,+
    +2, 'Row Share',+
    +3, 'Row Exclusive',+
    +4, 'Share',+
    +5, 'Share Row Exclusive',+
    +6, 'Exclusive', 'None') mode_requested+
    +, DECODE(l.type,+
    +'MR', 'Media Recovery',+
    +'RT', 'Redo Thread',+
    +'UN', 'User Name',+
    +'TX', 'Transaction',+
    +'TM', 'DML',+
    +'UL', 'PL/SQL User Lock',+
    +'DX', 'Distributed Xaction',+
    +'CF', 'Control File',+
    +'IS', 'Instance State',+
    +'FS', 'File Set',+
    +'IR', 'Instance Recovery',+
    +'ST', 'Disk Space Transaction',+
    +'TS', 'Temp Segment',+
    +'IV', 'Library Cache Invalidation',+
    +'LS', 'Log Start or Log Switch',+
    +'RW', 'Row Wait',+
    +'SQ', 'Sequence Number',+
    +'TE', 'Extend Table',+
    +'TT', 'Temp Table',+
    l.type)                                 lock_type
    +, o.owner || '.' || o.object_name+
    +|| ' - (' || o.object_type || ')' object_name+
    +, ROUND(l.ctime/60, 2) lock_time_min+
    FROM
    v$session     s
    +, v$lock l+
    +, dba_objects o+
    +, dba_tables t+
    WHERE
    l.id1            =  o.object_id
    AND s.sid            =  l.sid
    AND o.owner          =  t.owner
    AND o.object_name    =  t.table_name
    AND o.owner          <> 'SYS'
    AND l.type           =  'TM'
    ORDER BY
    +1+
    +/+

    What Brian said is true so are your sure your query was not just reporting the start time of the current transaction from v$transaction.start_time, or the start time of the session: v$session.logon_time, or perhaps the time since the last database call (v$session.last_call_et) which for an active session would be the time the current SQL statement has been running?
    HTH -- Mark D Powell --

  • How to remove an object lock from database in VMM?

    This seems to be a recurring issue for others as well, but the root cause might be different for each
    I am in a situation where I can't add additional disks to a VM because of running intoError (2602) "Unable to perform the job because one or more of the selected objects are locked by another job" - however, other VMs on
    the cluster are not locked and there are no other jobs running against the VM where I need to add the disks.
    Looks like a quirk in the VMM database to me - maybe an "orphaned lock"?  Would love to know how to remove this or how to handle this issue, as the recommended action in VMM doesn't really help much at all (To find out which
    job is locking the object, in the Jobs view, group by Status, and find the running or canceling job for the object. When the job is complete, try again.)  
    Why doesn't VMM at least say which job is locking the object? 

    This post is older than 30 days or we have not heard back from you. 
    Did this issue get resolved?  If so, please share with community how you resolved. 
    Otherwise, re-activate post if you still require assistance.
    o   
    Also, if you feel this is just a bug in SCVMM I recommend submitting bugs or recommendations to our connect site.  Connect offers the ability
    to have the product team directly evaluate a bug, design, or feature request.  Here is the link:
    https://connect.microsoft.com/site960
    Carmen M. Summers (MSFT) --Posting is provided "AS IS" with no warranties, and confers no rights.

  • CR Locks on Database Expert existing rpt / Load report failed on new  rpt

    Visual Studio 2010 SP1 / CR 2010 13.0.1.220
    1) Have a CR (VB) that has been working fine in development for over two weeks and suddenly locks up when attempting to open Database Expert. I right click it to select Expert ... and then nothing. I have to terminate the task.
    2) Loaded a Backup of this project to attempt to save the work on the report...same thing...locks up when attempting to open Database Expert. This report will compile and bring data (from XML) into the viewer but I cannot add additional information from the XML using Database Expert.
    3) Went to create a totally new crystal report...bombs at the point when the CReport tries to load with error: "Load report failed"
    4) From threads on this forum...tried suggestion of downloading and converting "vbnet_win_SimplePreviewReport" from VS2002 to VS2010 ... still receive error "load report failed" when it tries to find "World Sales Report.rpt" even though this report is in this directory: C:\Crystal\CRNET\vbnet_win_SimplePreviewReport\vbnet_win_SimplePreviewReport
    I need some assistance to resolve these errors.

    See KB [KB 1540637 - Error: External component has thrown an exception. Launching the Database Expert in the embedded Crystal Reports designer in Visual Studio|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533343330333633333337%7D.do]
    For more info, search the forums.
    Repair of VS2010 and CRVS2010 should also be considered.
    - Ludek
    Edited by: Ludek Uher on Apr 28, 2011 7:11 AM

  • Why does pacman lock the database during downloads?

    Something that's always irked me about pacman is the fact that it locks the package database during the download stages of package installation, before anything has actually been installed/committed. Is there a reason for this, and if not, would a suggestion/patch be acceptable?
    Here's the scenario I'm encountering right now:
    * Downloading large package in background
    * Need to upgrade flash player (YouTube no longer accepts an older version I suppose, and lolcats are a necessity)
    * I cannot do this quick upgrade due to the lock pacman has on the database while downloading said large package
    Last edited by itsbrad212 (2012-03-24 00:36:31)

    krigun wrote:
    Sounds reasonable, but the following scenario may or may not be a problem:
    You have package A B and C installed:
    Run pacman -Syu (huge download, all three packages updated)
    Simultaneously, you execute pacman -R A (basically modify the pacman DB)
    Package A updated (reinstalled) by first process
    Not sure how pacman is built, but it probably locks and reads the DB when started, and then does it's thing without worries. In any case, it does support resuming downloads, so you could just end the long running process, install whatever, and resume.
    I think it's the same with apt-get.
    That's an interesting point, although I'm guessing the package manager could check to make sure that all packages that it wants to update are present on the system right after it locks the db, and if for some (rare) reason that one is missing, skip it.
    hadrons123 wrote:
    What is that large package which you think is that big?
    I think locking is present in all package managers in all distributions and it is  a good Idea, so that someone can't install and uninstall a package at different terminals at the same time, and end up with a messed up package manager .
    Well in this case, it is eclipse (>200 MB), but there are a variety of other large packages in the repositories. What may be small to you may seem massive to those with slower connections.
    How could it become messed up? I'm not proposing the database lock be eliminated, but rather wait until the actual installation process begins before locking it. It's no skin off anybody's ass if someone simply downloads packages simultaneously.

  • Locks in database object Packages...

    Hi,
    i want to know how many locks are possible in the database object Packages in windows.
    can anybody help me in this.
    regards,

    In one SQL*Plus session run this:
    DECLARE
        n   NUMBER := 0;
        idx NUMBER := 0;
    BEGIN
        LOOP
            n := dbms_sql.native;
            dbms_lock.sleep(10);
            idx := idx + 1;
            EXIT WHEN idx > 100;
        END LOOP;
    END;
    /In another SQL*Plus session (AS SYSDBA) execute this:
    SQL> grant execute on dbms_sql to public ;
    grant execute on dbms_sql to public
    ERROR at line 1:
    ORA-04021: timeout occurred while waiting to lock object SYS.DBMS_SQL
    SQL>

  • Running out of REDO space locks the database

    Hi All,
    My 11gR2 RAC database running on two RH5.7 nodes got locked. I relate the cause to the REDO disk space being full as running the ASMCA shows that all the REDO space is used (40GB!!!)
    Furthermore as I try to access the database via sqlplus i get the ORA-00257 (http://ora-00257.ora-code.com/) that mentions
    "The most likely cause of this message is the destination device is out of space to store the redo log file"
    Now is it possible that an Oracle RAC is unrecoverable just because it can't write logs? And that as we can't access it we can't delete these logs?
    Please help

    920550 wrote:
    Now is it possible that an Oracle RAC is unrecoverable just because it can't write logs?No it's the contrary: Oracle instance is blocking any new database write in order to be recoverable.
    And that as we can't access it we can't delete these logs?
    Even if archive destination is stored in ASM you can access it (for example with asmcmd utility with command line interface).
    What you must do is:
    1. backup archived redo logs
    2. remove archived redo logs that have been backed up.
    For example if you are using RMAN you can try
    backup archivelog all delete input;

  • Will there be a lock on database row?

    Hi,
    I have a stateless session bean with TX_BEAN_MANAGED methods and TX_SERIALIZABLE isolation level. I am not doing a usertransaction.begin() in the method, but i am getting the connections from a datasource. I am not doing any updates/insert/delete as well. It is only read.
    Are the connections that i took associated to any transactions?
    If i do a read on a row from this method, will there be a lock on that row(since isolation level is serializabe) and for how long?
    thanks for your help!
    toby

    I understand that you have set TX_SERIALIZABLE/TX_BEAN_MANAGED/method level.
    If you open a connection in the method and read some rows, those rows will be locked till you exit the method.

  • Reducing No of Locks on Database tables

    Hi,
    Thank You very much in advance for reading this thread.
    My requirement is to update the Data base table NAST with minimum no of locks on it.
    Can you please advise me which one i suppose to follow from the below mentioned 2 approaches.
    1) Update the NAST data base table with each record with in the loop and execute the Commit Work statement after a certain number of records are updated.
    2) Insert the total no of records at a time by using the INSERT statement and execute the Commit statement.
    Regards,
    K.Krishna Chaitanya.

    try the second option as it will do the db update in a single shot and it also depends on the way UPDATE work process perf.

  • Site is very slow-Dead lock in database?

    Hi Friends,
    DB version:10.2.0.1
    OS:RHEL
    I have a table whose structure is as below
    SQL>desc prod
    Name Null? Type
    ID NOT NULL VARCHAR2(40)
    TITLE VARCHAR2(500)
    VALUE VARCHAR2(2000)
    Column ID has two contarints primary key constraint and check constraint.
    Actual problem:
    ================
    One of our site is very slow and as a i DBA i have checked the alert log file of the database and found the error
    Wed Jul 7 01:26:50 2010
    ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/PUBDB01/udump/pubdb01_ora_25844.trc.
    I checked the trace file and found the information as below.
    DEADLOCK DETECTED
    [Transaction Deadlock]
    Current SQL statement for this session:
    DELETE FROM prod WHERE id = :1
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Now i want to know the reason behind the slowness of the site is because of the deadlock which i have found in the database or some thing else. If the reason is because of the deadlock then what i have to do that SQL statement inorder to perform it optimally.
    Please need your help and suggestions.

    Get statspack/AWR running at regular intervals.
    Deadlocks are resolved instantaneously by Oracle itself - I don't think that could cause the entire site to slow down.

Maybe you are looking for