add.tiferry.com

.NET/Java PDF, Tiff, Barcode SDK Library

You can use the query shown in Listing 11-19, which joins the V$SESSION and the V$SQLTEXT tables, to give you the text of the SQL currently being used by a user. Listing 11-19. Finding Out the SQL Being Executed by a User SELECT a.sid,a.username, s.sql_text FROM v$session a,v$sqltext s WHERE a.sql_address = s.address AND a.sql_hash_value = s.hash_value AND a.username LIKE 'HR%' ORDER BY a.username,a.sid,s.piece; SID USERNAME SQL_TEXT ---------------------------------------------------------------8 HR BEGIN dbms_stats.gather_table_stats ('HR','REGIONS'); END; SQL> SQL> 2 3 4 5 6 7*

barcode fonts for excel 2016, microsoft excel barcode generator free, excel barcode generator, barcode in excel vba, vba code for barcode in excel, microsoft excel barcode font package, excel barcode add-in, barcode generator excel 2010, barcode generator excel freeware, how to print barcode in excel 2007,

You may need to sometimes log in as another DBA to perform certain actions. However, even the Oracle DBA doesn t have access to users passwords, which are stored in an encrypted form. You could use the ALTER USER statement to change the user s password, but you might not want to inconvenience the user by changing the password for good. In a case like this, you can change the password of a user temporarily and use the new password to get in as that user. Before you change a user s password, get the original encrypted password, which you can use to reset the user s password back after you re done. Here s an example: SQL> SELECT 'alter user tester identified by values '||password||';' 2 FROM dba_users 3* WHERE username='TESTER'; 'ALTERUSERTESTERIDENTIFIED --------------------------------------------------------alter user tester identified by values 1825ACAA229030F1; SQL> Now change the password of user tester so you can log in as that user: SQL> ALTER USER tester IDENTIFIED BY newpassword; When you re done using the tester user account, use the ALTER USER statement again to change user tester s password back to its original value. Make sure you enclose the encrypted password in single quotes. SQL> ALTER USER tester IDENTIFIED BY VALUES '1825ACAA229030F1'; User altered. SQL>

You can use the ALTER SYSTEM command to kill any user s session. You need to first query the V$SESSION view for the values of the SID and serial number of the user. Then using the SID and serial number, you can kill the user s session. Here s an example: SQL> SELECT sid, serial# FROM v$session 2* WHERE username='SALAPATI'; SID SERIAL# ---------------10 32 SQL> ALTER SYSTEM KILL SESSION '10,32'; System altered. SQL> If the session you want to kill is involved in a long operation, such as a lengthy rollback, Oracle will inform you that the session is marked for kill and it will be killed after the operation is completed. When Oracle kills a session, it rolls back all ongoing transactions and releases all session locks. If the UNIX process of the user is killed, the Oracle session will most likely be killed also, but that isn t the most graceful way to end a session. If you think you must kill a user s UNIX session, and the Oracle KILL SESSION command isn t working, or it s taking a long time, you can terminate the session rather abruptly by using the UNIX kill command as follows. Note that you can use either the kill command by itself or with the -9 switch, but in most cases the simple kill command will be enough to terminate the UNIX session of your Oracle users:

If the process has no children, the function will stop and return to the caller to process the next tree branch.

$ kill 345678 or $ kill -9 345678 You can use the following script to derive the process number from the V$SESSION dynamic view (and the SID and serial number as well): SQL> SELECT process,sid,serial# FROM v$session WHERE username='&user'; Enter value for user: SALAPATI old 2: username='&user' new 2: username='SALAPATI' PROCESS SID SERIAL# ----------------------------------2920:2836 10 34 SQL> Windows systems don t use the concept of processes, of course, but all user processes are threads of the same Oracle exe process In order to terminate an Oracle user s session on Windows, you can use the ORAKILL utility, which will kill a specific thread under the Oracle exe process Suppose you wish to kill a user s session How do you find out what that user s thread is Listing 11-20 shows how you can use a simple query to identify any user s thread in a Windows system Listing 11-20.

   Copyright 2020.