Alter system trigger - substitution

Hello.
By the documentation, there is restriction for trigger on alter command: "The trigger will not be fired by an ALTER DATABASE statement".
I'm trying to use BEFORE SHUTDOWN and AFTER STARTUP triggers to database and I'd need also cover situations:
- alter system quiesce restricted
- alter system suspend
- alter system enable restricted session
- alter system unquiesce
- alter system disable restricted session
- alter system resume
I'm using ALTER SYSTEM command (not ALTER DATABASE), but trigger isn't fired too. Is there any way how to catch and do some PL/SQL pre/post processing events described above?
Thanks.

Oracle Version ?
if ur on 10.x.x.x.x
Check
sql> select space_limit/1024/1024 "Limit MB",round(space_used/1024/1024) "Used MB"
2* from v$recovery_file_dest
SQL> /
Limit MB Used MB
2048 1681
If limit and used field equal then increase db_recovery_file_dest_size parameter size
SQL> show parameter db_recovery_file_dest_size
NAME TYPE VALUE
db_recovery_file_dest_size big integer 2G
SQL> alter system set db_recovery_file_dest_size = 3g;
System altered.
Also check below link.
>>>Re: Switch logfile hangs
[b]>>>SQL> alter system switch logfile;

Similar Messages

  • Alter System Kill Session Not Working

    I'm not certain as to what the problem may be, but the following code does not work in that the session is not being disconnected.
    The attempt is to have this trigger kill a user's logon session if the user is attempting to run a program named 'ex_oc.exe'
    I've tested the code (getting the values back to the table as expected) and it appears to be working but it doesn't execute.
    I've also tried ''ALTER SYSTEM DISCONNECT SESSION'.
    Database is 11g.
    Any ideas?
    Thanks
    CREATE OR REPLACE TRIGGER SYS.DENY_MSB_TRIGGER_UPDATEDD
    AFTER LOGON ON Database
    DECLARE
    v_programname varchar2(64);
    v_logontime date;
    v_process varchar2(24);
    v_machine varchar2(64);
    v_sid number;
    v_serialnum number;
    v_username varchar2(30);
    v_stmt2run VARCHAR2(327);
    cur INTEGER;
    ret INTEGER;
    v_string VARCHAR2(500);
    BEGIN
    SELECT PROGRAM, PROCESS, MACHINE, SID, SERIAL#, USERNAME
    INTO v_programname, v_process, v_machine, v_sid, v_serialnum, v_username
    FROM V$SESSION
    WHERE PROGRAM = LOWER('ex_oc.exe');
    INSERT INTO SAUDIT.DENYMSB (PROGRAM, PROCESS, MACHINE, SID, SERIALNUM, USERNAME)
    VALUES (v_programname, v_process, v_machine, v_sid, v_serialnum, v_username );
    v_string := 'ALTER SYSTEM KILL SESSION' || CHR(39)||v_sid||','||v_serialnum|| CHR(39)||' IMMEDIATE';
    EXECUTE IMMEDIATE v_string;
    END;
    Edited by: user12451703 on Jan 14, 2010 8:57 AM
    Edited by: user12451703 on Jan 14, 2010 8:58 AM

    user12451703 wrote:
    I'm not trying to kill my own session.
    Trigger written by Sys and running it as a generic user.You completely misunderstand triggers. Same as SP/SF trigger is always executed in invoking session on behalf of trigger owner. Below is a slighly modified version of your trigger that does not allow user U1 to connect by killing user U1 session:
    SQL> connect scott as sysdba
    Enter password: *****
    Connected.
    SQL> CREATE OR REPLACE TRIGGER SYS.DENY_MSB_TRIGGER_UPDATEDD
    2 AFTER LOGON ON Database
    3 DECLARE
    4 v_programname varchar2(64);
    5 v_logontime date;
    6 v_process varchar2(24);
    7 v_machine varchar2(64);
    8 v_sid number;
    9 v_serialnum number;
    10 v_username varchar2(30);
    11 v_stmt2run VARCHAR2(327);
    12 cur INTEGER;
    13 ret INTEGER;
    14 v_string VARCHAR2(500);
    15 BEGIN
    16 SELECT PROGRAM, PROCESS, MACHINE, SID, SERIAL#, USERNAME
    17 INTO v_programname, v_process, v_machine, v_sid, v_serialnum, v_username
    18 FROM V$SESSION where username = 'U1';
    19 EXECUTE IMMEDIATE ('ALTER SYSTEM KILL SESSION ''' || v_sid || ',' || v_serialnum || '''');
    20 EXCEPTION
    21 WHEN OTHERS THEN
    22 RAISE_APPLICATION_ERROR(-20001, 'Execution of this program not allowed', TRUE);
    23 END;
    24 /
    Trigger created.
    SQL> create user u1 identified by u1
    2 /
    User created.
    SQL> grant create session to u1
    2 /
    Grant succeeded.
    SQL> connect u1/u1
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: Execution of this program not allowed
    ORA-06512: at line 20
    <font color=red size =2>ORA-00027: cannot kill current session</font>
    Warning: You are no longer connected to ORACLE.
    SQL>
    Also, user not that keen to change the name of the exe.Is cex_soc.exe client side executable? If so what prevents user from renaming it?
    SY.

  • How to execute 'alter system....' in PL/SQL

    How can i execute a SQL of system control such as "alter system ...." in my form
    application?
    Thanks in advance!

    Hi,
    Try using the builtin forms_ddl.
    For example:
    forms_ddl('alter system ....');
    You can use this in any procedure or trigger you want.
    Hope this helps!

  • Log 'alter system ' commands

    Hi
    I am looking for a way to track alter system / alter database commands.
    Database triggers are not logging them : I do have a database trigger for DDLs tracking that works great but alter system commands are not captured by it . also trigger 'alter alter on database ' - do not log alter system or alter database
    Is there a way for me to force a command to appear in the alert log ?
    Or any other way you can think of ?
    thanks
    Orna

    Orna,
    YOu can create a database level trigger to capture ALTER statement and insert them into a user defined table. This is just one example you can define trigger at schema level as well.
    CREATE OR REPLACE TRIGGER usiuser.myaltertrg
       BEFORE ALTER
       ON DATABASE
    DECLARE
       tmpvar   NUMBER;
    BEGIN
       tmpvar   := 0;
    -- your code to insert alter statement in user defined table.
    EXCEPTION
       WHEN OTHERS
       THEN
          -- Consider logging the error and then re-raise
          RAISE;
    END myaltertrg;Regards
    Edited by: OrionNet on Dec 29, 2008 1:30 PM

  • Urgent-how to run 'alter system kill session 'sid, serial#' in form 6i ?

    I want to write a procedure in Form 6i so that user can kill the session by herself.
    I know kill session sql is 'alter system kill session 'sid, serial#'', however, I fould that I can only run it it sql plus screen, how can I run it in Form or in Stored procedure?
    Urgent....Please!

    try using Forms_ddl('alter system......'); in the forms. it will execute the dml statements in the form.
    zaibi.

  • ALLOW A USER TO KILL A SESSION WITHOUT ALTER SYSTEM PRIVILEGE.

    Hi
    I need a user to have permission to kill a session without having the ALTER SYSTEM privilege. I created a procedure on sys schema and granted the EXECUTE privilege to the user but it doesn't work, how can I do, help please.
    CREATE OR REPLACE PROCEDURE SYS.PRC_SESSION_KILLER (P_SID IN NUMBER, P_SERIAL IN NUMBER)
    AS
    BEGIN
         EXECUTE IMMEDIATE 'GRANT ALTER SYSTEM TO SYSADMIN';
         EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || P_SID || ',' || P_SERIAL || ''' IMMEDIATE';
         EXECUTE IMMEDIATE 'REVOKE ALTER SYSTEM FROM SYSADMIN';
    END;
    Thank you very much.

    Hi,
    I second everything John said.
    Are you sure the arguments are correct?
    Below is the procedure I use. You may want to run it, just to see what the error is.
    PROCEDURE     kill_internal
         s_id          IN     NUMBER,
         serial_num     IN     NUMBER,
         stat_out     OUT     VARCHAR2
    IS
         alter_handle     INTEGER;
         ex_val          INTEGER;     -- Returned by dbms_sql.execute
    BEGIN
         alter_handle := dbms_sql.open_cursor;
         dbms_sql.parse
              alter_handle,
              'ALTER SYSTEM     KILL SESSION '''     ||
                   TO_CHAR (s_id, '999990')     ||
                   ', '                    ||
                   TO_CHAR (serial_num, '999990')     ||
              dbms_sql.native
         ex_val := dbms_sql.execute (alter_handle);
         dbms_sql.close_cursor (alter_handle);
         stat_out := 'Success: '                    ||
                   TO_CHAR (s_id, '999990')     ||
                   ', '                    ||
                   TO_CHAR (serial_num, '999990');
    EXCEPTION
         WHEN OTHERS
         THEN
              stat_out := 'Failure:'          ||
                   SQLERRM;
    --          dbms_output.put_line (stat_out);
              dbms_sql.close_cursor (alter_handle);
    END     kill_internal
    ;

  • "Alter system set command" in a RAC database!!

    Hi, all.
    The database is (10.2.0.2.0) 2- node RAC database on 32-bit windows 2003
    EE SP1.
    I issued the following command on Node 1 database.
    --> Alter system set db_block_buffers= xxx sid='rac1';
    I was able to see "PE enqueue" in top 5 wait event section from an AWR report.
    In addition, I was able to find "PZ99","PZ98" process dump file in BDUMP.
    Soon later, I could find CKPT and DBWR hung.
    Is there anyone who experienced this issue?
    Thanks and Regards.
    Message was edited by:
    user507290

    10.2.0.2 has some bug which is fixed 10.2.0.3
    You check sequence cache. If it has less value, increase it to 10000.
    select CACHE_SIZE from dba_sequences where SEQUENCE_OWNER='SYS' and SEQUENCE_NAME='AUDSES$';
    SQL> alter sequence sys.audses$ cache 10000;
    Ashok

  • System.trigger node when using set_tree_selection

    I use set_tree_selection on a search through on the nodes.
    But this does not set the :SYSTEM.TRIGGER_NODE property like i thought. Is this correct?
    i.e. if i mouse click the node it is correct. If i search for a node a programmatically find the tree node trigger_node is not selected.
    If this is correct, is there anyway to set system.trigger_node.

    In my example I do a search for a node.
    If the node is on a particular level it needs to have different options. I then use system.trigger_node to find the depth.
    I assume ill need to create a parameter to store the system.trigger/set tree node value and use the parameter rather than system.trigger_node

  • Question about ALTER SYSTEM ARCHIVE LOG START

    Good morning,
    I'm trying (unsuccessfully) to get my database to be in archive log mode.
    These are the steps I followed:
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORACLE instance started.
    Total System Global Area  535662592 bytes
    Fixed Size                  1375792 bytes
    Variable Size             377487824 bytes
    Database Buffers          150994944 bytes
    Redo Buffers                5804032 bytes
    Database mounted.
    SQL> select log_mode from v$database;
    LOG_MODE
    ARCHIVELOG
    SQL> show parameter log_archive_start;
    NAME                                 TYPE        VALUE
    log_archive_start                    boolean     FALSE
    SQL> alter system archive log start;
    System altered.
    SQL> show parameter log_archive_start;
    NAME                                 TYPE        VALUE
    log_archive_start                    boolean     FALSE
    SQL>I've gone thru that process twice but, I don't seem to be able to get the ARCH process to start. (newbie mistake I'm sure...)
    Thank you for your help (again!),
    John.

    The parameter log_archive_start is no more needed John (as suggested already) and the best way to check the archive options is through the archive log list command.
    [oracle@edhdr2p0-orcl oui]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 10 10:51:57 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    SQL> archive log list
    Database log mode              No Archive Mode
    Automatic archival             Disabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     11
    Current log sequence           13
    SQL> shut immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area  418484224 bytes
    Fixed Size                  1336932 bytes
    Variable Size             318769564 bytes
    Database Buffers           92274688 bytes
    Redo Buffers                6103040 bytes
    Database mounted.
    SQL> select process,status from V$archive_processes;
       PROCESS STATUS
             0 STOPPED
             1 STOPPED
             2 STOPPED
             3 STOPPED
             4 STOPPED
             5 STOPPED
             6 STOPPED
             7 STOPPED
             8 STOPPED
             9 STOPPED
            10 STOPPED
       PROCESS STATUS
            11 STOPPED
            12 STOPPED
            13 STOPPED
            14 STOPPED
            15 STOPPED
            16 STOPPED
            17 STOPPED
            18 STOPPED
            19 STOPPED
            20 STOPPED
            21 STOPPED
       PROCESS STATUS
            22 STOPPED
            23 STOPPED
            24 STOPPED
            25 STOPPED
            26 STOPPED
            27 STOPPED
            28 STOPPED
            29 STOPPED
    30 rows selected.
    SQL>
    SQL> alter database archivelog;
    Database altered.
    SQL> alter database open;
    archive log list;
    Database altered.
    SQL> Database log mode         Archive Mode
    Automatic archival             Enabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     11
    Next log sequence to archive   13
    Current log sequence           13
    SQL>
    SQL> select * from V$archive_processes where status <> 'STOPPED';
       PROCESS STATUS     LOG_SEQUENCE STAT
             0 ACTIVE                0 IDLE
             1 ACTIVE                0 IDLE
             2 ACTIVE                0 IDLE
             3 ACTIVE                0 IDLEHTH
    Aman....

  • Question on alter system set cluster_database = true

    11.2.0.2.0 windows 2008
    doing a restore to a development RAC I noticed the following. I took the database out of cluster mode on one instance
    alter system set cluster_database=false scope=spfile sid='PRD1';
    shutdown, start up, do the restore, all good, I go to set cluster_Database=true but had issue instance would only start on one node, I reviewed my notes and found problem was when I set cluster_Database back to true I had typed
    alter system set cluster_database=true scope=spfile sid='*';
    instead of
    alter system set cluster_database=true scope=spfile sid='PRD1';
    So issue fixed.
    I retested and confirmed '*' wont take. Ive seen many examples of '*' working online and I am sure I have used '*' many times so had just typed it off my head. Anyone explain? probably quotes or something.

    Any chance there are multiple lines for cluster_database in the spfile ?I had thought maybe this, but confirmed no, it was a fresh build anyway that I was restoring to.
    >
    - Dump the spfile to a pfile ... edit ... recreate the spfile on all nodes.
    >
    Im not sure what this will achieve? the spfile is shared on the ASM.
    >
    As the cluster_database=true is a parameter to enable the RAC configuration. As you typed sid='*' it will try to enable the cluster_database parameter in all the instances(nodes) as it is RAC.
    In your case as you did on a single node by specifiying the sid name it will work as it will look only for that sid and enable that particular node.
    >
    I find this hard to read but I think this misinterprets as well.
    Thanks for the contribution. I think Ive found the solution
    the asterisk doesnt apparently mean actually "all instances", from here
    http://www.comp.dit.ie/btierney/oracle11gdoc/rac.111/b28254/admin.htm#BCEFICEE
    and
    "Setting SPFILE Parameter Values for Oracle Real Application Clusters"
    -- this is a good example of what happened to me
    >
    *.OPEN_CURSORS=500
    prod1.OPEN_CURSORS=1000
    Note:
    The value before the dot in an SPFILE entry identifies the instance to which the particular parameter value belongs. When an asterisk precedes the dot, the value is applied to all instances that do not have a subsequent, individual value listed in the SPFILE.
    For the instance with the Oracle system identifier (SID) prod1, the OPEN_CURSORS parameter is set to 1000 even though it has a database-wide setting of 500. Parameter file entries that have the asterisk (*) wildcard character only affect the instances without an instance-specific entry. This gives you control over parameter settings for instance prod1. These two types of settings can appear in any order in the parameter file.
    If another DBA runs the following statement, then Oracle updates the setting on all instances except the instance with SID prod1:
    ALTER SYSTEM SET OPEN_CURSORS=1500 sid='*' SCOPE=MEMORY;
    >
    so when I was on node 1 and ran it for *, I was setting it for all the nodes except the node I was on which holds true from what Ive seen. I'll remember that one.

  • Create synonym in System trigger

    How would i create a synonym in a system trigger?
    I have created a trriger on CREATE,in which i m giving execute immediate command for creating a synonym and using dbms_job.submit .
    it is not giving any error but its not creating any synonym on the table...
    code:
    create or replace trigger bdesai.DR_CRA
    after CREATE OR DROP on bdesai.schema
    declare
    l_str varchar2(255);
    l_str1 varchar2(255);
    l_job number;
    begin
    CASE ORA_SYSEVENT
    WHEN 'CREATE' THEN
    if (ora_dict_obj_type = 'TABLE') then
    l_str := 'execute immediate "grant select on bdesai.' ||ora_dict_obj_name ||' to eqhub_developer";';
    l_str1 := 'execute immediate "create or replace synonym eqhub_developer'||'.'||ora_dict_obj_name ||' for bdesai'||'.'||ora_dict_obj_name||'";';
    DBMS_OUTPUT.PUT_LINE(replace(l_str,'"',''''));
    DBMS_OUTPUT.PUT_LINE(replace(l_str1,'"',''''));
    dbms_job.submit( l_job, replace(l_str,'"','''') );
              dbms_job.submit( l_job, replace(l_str1,'"','''') );
    END IF;
    WHEN 'DROP' THEN
    if ( ora_dict_obj_type = 'TABLE') then
    l_str := 'execute immediate "revoke select on bdesai.' ||ora_dict_obj_name ||' from eqhub_developer";';
    l_str1 := 'execute immediate "drop synonym eqhub_developer'||'.'||ora_dict_obj_name||'";';
    DBMS_OUTPUT.PUT_LINE(replace(l_str,'"',''''));
    DBMS_OUTPUT.PUT_LINE(replace(l_str1,'"',''''));
    dbms_job.submit( l_job, replace(l_str,'"','''') );
    dbms_job.submit( l_job, replace(l_str1,'"','''') );
    END IF;
    END CASE;
    end;
    /

    i just want to know can we create a synonym or use any ddl command in a trriger body.We are not allowed to issue COMMITs inside a trigger. Triggers are fired as part of a transaction. Because a COMMIT marks the end of a transaction and the commencement of a new transaction, allowing them to be fored inside a trigger would really break the ACIDity of the database.
    If you really want to do this (and I would argue whether it's a sound approach) you will have to code an autonomous transaction in the trigger body. .
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Alter system set nls_length_semantics

    Hi all,
    my question concerns the scope in the change of NLS_LENGTH_SEMANTICS can be performed.
    The 10gR2 documentation only the
    "Modifiable      ALTER SESSION"
    But what about altering the system and making your own setting to default for all sessions? With which scope?
    I tried
    alter system set nls_length_semantics='CHAR';
    alter system set nls_length_semantics='CHAR' scope=spfile;
    alter system set nls_length_semantics='CHAR' scope=both;
    None had really any effect. Do I have to bounce the database?

    Hello,
    Do I have to bounce the database?Yes, you have to shutdown and startup the database.
    Else the NLS_LENGTH_SEMANTICS change won't be effective.
    You may have more details on the following thread:
    nls_database_parameters->nls_length_semantics Help!
    There's also an interesting Note from MOS:
    Examples and limits of BYTE and CHAR semantics usage (NLS_LENGTH_SEMANTICS) [ID 144808.1]They give many information about NLS_LENGTH_SEMANTICS and the following Bug:
    Bug 1488174
    Problem: ALTER SYSTEM does not change the setting of NLS_LENGTH_SEMANTICS for the current and new (!) sessions.
    Workaround: Don't use ALTER SYSTEM SET NLS_LENGTH_SEMANTICS scope=both; but set NLS_LENGTH_SEMANTICS as a init.ora parameter or issue ALTER SYSTEM SET NLS_LENGTH_SEMANTICS=CHAR scope=spfile; and bounce the database.Hope this help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on May 27, 2010 2:06 PM

  • Query on ALTER SYSTEM SET

    Hi,
    I was under impression that
    "PFILE has the limitation to change the initialization parameters dynamically.If any init parameter is to be changed,we can edit the pfile and the parameter changes will come into effect with the next reboot of the system.
    To overcome this limitation,Oracle has come up with the concept of SPFILE ,where in the initialization parameters can be changed dynamically using ALTER SYSTEM SET statement."
    But,today I started my test database using PFILE and executed the following command to change the memory_target parameter from 300M to 290M.
    ALTER SYSTEM SET memory_target=290M;
    And to my surprise,this statement executed fine without any errors and memory_target parameter has been set to the new value(of course,in memory).
    Isn't it changing the init parameters dynamically using PFILE itself??
    Please clarify my doubt and correct my understanding.
    Regards,
    Bharath

    bharathDBA wrote:
    Hi,
    I was under impression that
    "PFILE has the limitation to change the initialization parameters dynamically.If any init parameter is to be changed,we can edit the pfile and the parameter changes will come into effect with the next reboot of the system.
    To overcome this limitation,Oracle has come up with the concept of SPFILE ,where in the initialization parameters can be changed dynamically using ALTER SYSTEM SET statement."
    But,today I started my test database using PFILE and executed the following command to change the memory_target parameter from 300M to 290M.
    ALTER SYSTEM SET memory_target=290M;
    And to my surprise,this statement executed fine without any errors and memory_target parameter has been set to the new value(of course,in memory).
    Isn't it changing the init parameters dynamically using PFILE itself??
    Please clarify my doubt and correct my understanding.
    Regards,
    Bharath
    You have a wrong interpenetration about the genesis of the SPFILE. Yes it is a binary file and all that but remember, its not the SPFILE that makes a parameter dynamic or a PFILE that makes it static but it's the very nature of the parameter itself that makes it happen. Yes, the difference in the PFILE and SPFILE parameter would be evident when you would change a dynamic parameter and would give a bounce to the db. Since teh PFILE wasn't updated (its a text file so has to be updated manually) , with the next restart, the parameter would take the same value as it has in the PFILE. But with the SPFILE, depending on what you have set in the SCOPE, the parameter would behave accordingly.
    HTH
    Aman....

  • ALTER SYSTEM/DATABASE acts upon?

    Hi,
    I have a question inside my head since a long time now, I did lot of googling, but did'nt find a precise answer.
    All DMLs will be served by Dedicated/Shared server processes as per the configuration. Selects/Updates/Deletes/Inserts will have their execution plans generated to/used from the Library Cache of shared pool; will have their corresponding buffers put into the RLB and from there into redo log files. This is found every where on the web.
    But what happens when we issue an "ALTER SYSTEM ... ... ..." or an "ALTER DATABASE ... ... ..."?
    Does the user process adjust the SGA_TARGET/PGA_AGGREGATE_TARGET or it just signals MMAN?
    Does it Flush Buffer Cache/Shared Pool or does it just signal the MMAN again? What happens inside?
    Does it kill the sessions itself or just signal the PMON?
    Which process starts up first and takes on when "STARTUP;" is issued?
    Which process gears up to Close, Dismount, and Shut down the database stagewise in the mode requested by "SHUTDOWN ....;"?
    Any link that discusses these and other such internal Oracle algorithms/implementations would be greatly helpful.
    Thanks,
    Aswin.

    Hi,
    ice_cold_aswin wrote:
    Does it kill the sessions itself or just signal the PMON?
    Which process starts up first and takes on when "STARTUP;" is issued?
    Which process gears up to Close, Dismount, and Shut down the database stagewise in the mode requested by "SHUTDOWN ....;"?I think at least these can be answered by using strace. For example, starting up an instance:
    [oracle@localhost ~]$ strace -o trc.txt -f -t -e trace=process sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 30 00:20:49 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    Total System Global Area            535662592 bytes
    Fixed Size                            1337720 bytes
    Variable Size                       335545992 bytes
    Database Buffers                    192937984 bytes
    Redo Buffers                          5840896 bytes
    Database mounted.
    Database opened.
    18924 00:20:49 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus", ["sqlplus", "/", "as", "sysdba"], [/* 40 vars */]) = 0
    18924 00:20:49 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f81708) = 18925
    18925 00:20:49 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle", ["oracletest11g2", "(DESCRIPTION=(LOCAL=YES)(ADDRESS"], [/* 41 vars */]) = 0
    18925 00:20:51 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xae2708) = 18926
    18926 00:20:51 execve("/bin/sh", ["/bin/sh", "-c", "/bin/df -k /u01/app/oracle/produ"], [/* 42 vars */]) = 0
    18926 00:20:51 execve("/bin/df", ["/bin/df", "-k", "/u01/app/oracle/product/11.2.0/d"], [/* 42 vars */]) = 0
    18926 00:20:51 exit_group(0)            = ?
    18925 00:20:51 waitpid(18926, NULL, 0)  = 18926
    18925 00:20:51 --- SIGCHLD (Child exited) @ 0 (0) ---
    18925 00:20:52 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xae2708) = 18927
    18927 00:20:52 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xae2708) = 18928
    18927 00:20:52 exit_group(0)            = ?
    18925 00:20:52 --- SIGCHLD (Child exited) @ 0 (0) ---
    18925 00:20:52 waitpid(18927, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 18927
    18928 00:20:52 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle", ["ora_pmon_test11g2"], [/* 46 vars */]) = 0
    18925 00:20:52 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xae2708) = 18929
    18929 00:20:52 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xae2708) = 18930
    18929 00:20:52 exit_group(0)            = ?
    18925 00:20:52 --- SIGCHLD (Child exited) @ 0 (0) ---
    18925 00:20:52 waitpid(18929, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 18929
    18930 00:20:52 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle", ["ora_vktm_test11g2"], [/* 46 vars */]) = 0
    18930 00:20:52 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x4b3708) = 18931
    ...

  • Flush Shared Pool without Alter System Priv

    I am trying to device a way to flush the shared pool by a user who doesn't have ALTER SYSTEM priv. I tried creating a stored proc in user's schema who has DBA role
    with the following:
    execute immediate 'alter system flush shared_pool';
    and then granted execute on this to a normal user without explicit alter system priv, but the execution fails and seems that I need to grant alter system explicitly to this user. Is there any other workaorund for this?
    Thank You
    Kevin

    it works for me! V10.2.0.4 too.
    SQL> set time on
    12:11:24 SQL> @privs
    12:11:28 SQL> SET TERM ON ECHO ON
    12:11:28 SQL> SET SERVEROUTPUT ON
    12:11:28 SQL> CREATE USER PTST IDENTIFIED BY PTST DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON users TEMPORARY TABLESPACE TEMP;
    User created.
    12:11:28 SQL> grant create session to ptst;
    Grant succeeded.
    12:11:28 SQL> grant alter system to dbadmin;
    Grant succeeded.
    12:11:28 SQL> connect dbadmin/admindb
    Connected.
    12:11:28 SQL> set term on echo on
    12:11:28 SQL> create or replace procedure flush_pool
    12:11:28   2  as
    12:11:28   3  begin
    12:11:28   4  execute immediate 'alter system flush shared_pool';
    12:11:28   5  end flush_pool;
    12:11:28   6  /
    Procedure created.
    12:11:28 SQL> grant execute on flush_pool to ptst;
    Grant succeeded.
    12:11:28 SQL> connect ptst/ptst
    Connected.
    12:11:28 SQL> SET TERM ON ECHO ON
    12:11:28 SQL> execute dbadmin.flush_pool;
    PL/SQL procedure successfully completed.
    12:11:29 SQL> connect / as sysdba
    Connected.
    12:11:29 SQL> drop user ptst;
    User dropped.

Maybe you are looking for