Audit DBA Activity, skip table from logical standby!

Dear All,
My database is 10gR2 on windows 2003 server.
I want to know if I can put some audit on the commands: execute dbms_logstdby.skip() to skip tables from Logical standby and also the same on unskipping the objects exec dbms_logstdby.unskip.
Thanks, Imran

Hi,
Given that your Database is 10g, the auditing options were extended to included DML from only SELECT in 9i, but not audit on procedures.  You could double check the Fine Grained Auditing options in 10g, but I don't think this extends to DBMS_ packages.
I would consider writing a trigger or a small job that monitors the DBA_LOGSTDBY_SKIP view for additional entries.  This is the only workaround that I can suggest that might fit your needs.

Similar Messages

  • Skipping dependent Tables in Logical Standby

    Hello DBAs
    I need your expertise here. Let me explain the scenario. Suppose a table is skipped in a logical standby. This table is referred by other tables and there are dependencies on this table. Now my question is what happens when a transaction is committed at the primary which is dependent on this table ?
    Does the transaction go through even though that table is not replicated. What happens to data integrity ?
    I appreciate your help. Thanks.

    Have a go at
    [The Documentation...|http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ls.htm#SBYDB00800]

  • Creating new tables in Logical Standby database

    Hi
    I have a requirement to create new tables in logical standby database. These tables will not be present on primary database. Is it possible to do this ?
    I have a new schema already created which has the privilege to CREATE new table.
    I have stopped the logical standby apply.
    When I am now trying to create a new table but it is failing with error : insufficient privileges.
    When I am trying to run below statement on new schema it is also failing with error of insufficient privileges.
    alter session disable dataguard;
    Please help.

    user8819121 wrote:
    Thanks Mahir,
    I was able to create the table after logging in as sysdba.
    But I need my user on that table to execute DML statements. My user has privileges to insert,delete and update any table.
    I tried the following statements to disable the guard but it is sill not working
    ALTER DATABASE GUARD STANDBY.
    Do I need to skip the tables created using dbms_logstdby package to not making it part of SQL Apply ? I guess not since the table is not in primary database.
    Amit
    You can skip only on primary, your created schema on Standby is not in primary.
    Then you must change Status of data guard to NONE. NONE is means is not any security on your data.
    In Guard status NONE can change all schema data.
    Please check link: http://docs.oracle.com/cd/E11882_01/server.112/e10700/manage_ls.htm#CHDGFGHG
    Following tests on user created before guard status is change from ALL to STANDBY.
    C:\Users\Administrator>sqlplus / as sysdba
    SQL> conn test/test
    Connected.
    SQL> select table_name from user_tables;
    TABLE_NAME
    T
    SQL> insert into t values(22);
    insert into t values(22)
    ERROR at line 1:
    ORA-16224: Database Guard is enabled
    SQL> conn / as sysdba
    Connected.
    SQL> select guard_Status from  v$database;
    GUARD_S
    ALL
    SQL> alter  database guard standby;
    Database altered.
    SQL> conn test/test
    Connected.
    SQL> insert into t values(1);
    insert into t values(1)
    ERROR at line 1:
    ORA-16224: Database Guard is enabled
    SQL> conn / as sysdba
    Connected.
    SQL> select guard_Status from  v$database;
    GUARD_S
    STANDBY
    SQL> alter  database guard none;
    Database altered.
    SQL> select guard_Status from  v$database;
    GUARD_S
    NONE
    SQL> conn test/test
    Connected.
    SQL> insert into t values(1);
    1 row created.
    SQL> commit;
    Commit complete.And Now I want share with you new tests :)
    Now user creating when after guard status change
    SQL> drop  user test cascade;
    User dropped.
    SQL> select guard_status from v$database;
    GUARD_S
    STANDBY
    SQL> create user test identified by test;
    User created.
    SQL> grant create session,  resource, create table to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> create table t (n number);
    Table created.
    SQL> insert into t values(1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>It means when guard status is ALL then all of user created guarding.
    When you changed status to STANDBY then Logical Standby guard only primary schema and created schema before change.
    NONE is not guard any schema. it means you can delete standby schema data too.
    Regards
    Mahir M. Quluzade
    Edited by: Mahir M. Quluzade on Apr 19, 2013 4:07 PM

  • Physical Standby from Logical Standby

    Is it possible this scenario?
    Create a physical standby from logical standby and the physical receive archive from logical.
    I mean,
    Primary (10g production) -> Logical (11gr2 new server 1) -> (Physical 11gr2 new server 2)
    The goal of this scenario is a migration with a short downtime.
    O.S. aix 6.1
    11.2.0.2

    Is it possible this scenario?YES

  • Goldengate from physical standby with Active data guard or from logical standby - which is better?

    Hi,
    We have Oracle 11.2.0.4 and are currently using Active Data Guard on a physical standby. My boss wants me to use Goldengate
    to replicate several schema from Oracle to SqlSserver. She doesn't want to touch the Primary, which is in production. Would it be better
    to setup a Logical standby for Goldendate to use, in addition to the Physical standby? Or will it be sufficient to use the Physical standby?
    The application tables don't all have primary keys. I'm trying to decide if the Logical standby adds another layer of complexity or would
    introduce delays in getting the data from Oracle to Sqlserver.
    Thanks in advance,

    Hi,
    In this case I recommend you to use physical standby + Golden gate with ALO mode. You might have sligthly more trouble in logical standby. it means you might have more trouble at Goldengate's extract side.
    You said
    The application tables don't all have primary keys.
    so you have to add keycols on replicat side.
    I recommend you to add an index which should consist of keycols columns. it will be necessary for replicat performance.
    Best Regards

  • Create table on Logical Standby Database

    Dear DBAs,
    here is my situation;
    1. My primary database (where the tables' owner is "ICC" having a DBA) is used for insert/update transactions.
    2. The logical stdby DB (dataguard structure with MAX availability) is used to generate reports, after updating some tables owned by the same user "ICC". note that these tables are excluded from the replication.
    3. The developers might need to create this kind of tables to generate another kind of reports.
    The issue is that when the standby apply is enabled or disabled, the user ICC is not able to create a new table, it gives ORA-01031: insufficient privileges. note that it's not practical to ask the DBA to disable the "APPLY" at any table creation.
    Do you have an idea about how to resolve.
    My database is 10gR2 path.10.2.0.4.0 on Windows 2003
    Thank you in advance

    If you stop applying log on the logical standby you can easily create a table over there. See oracle docs. The following list shows >how to re-create a table and restart SQL Apply on that table:
    >
    Stop SQL Apply:
    SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    Ensure no operations are being skipped for the table in question by querying the DBA_LOGSTDBY_SKIP view:
    SQL> SELECT * FROM DBA_LOGSTDBY_SKIP;
    ERROR STATEMENT_OPT OWNER NAME PROC
    N SCHEMA_DDL HR EMPLOYEES
    N DML HR EMPLOYEES
    N SCHEMA_DDL OE TEST_ORDER
    N DML OE TEST_ORDER
    Because you already have skip rules associated with the table that you want to re-create on the logical standby >database, you must first delete those rules. You can accomplish that by calling the DBMS_LOGSTDBY.UNSKIP >procedure. For example:
    SQL> EXECUTE DBMS_LOGSTDBY.UNSKIP(stmt => 'DML', -
    schema_name => 'HR', - object_name => 'EMPLOYEES');SQL> EXECUTE DBMS_LOGSTDBY.UNSKIP(stmt >=> 'SCHEMA_DDL', -
    schema_name => 'HR', - object_name => 'EMPLOYEES');
    Re-create the table HR.EMPLOYEES with all its data in the logical standby database by using the >DBMS_LOGSTDBY.INSTANTIATE_TABLE procedure. For example:
    SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE(shema_name => 'HR', -
    object-_name => 'EMPLOYEES', -
    dblink => 'BOSTON');
    Start SQL Apply:
    SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;Regards.

  • Updating tables in logical standby database

    Dear DBAs,
    Is it possible to update non replicated tables in the logical standby database, but have the same schema name?
    "Alter session disable guard" works only for the current session, in fact i want it for all connected users whithout stopping the standby apply ?

    hi,
    Let's say in the primary database i have 10 tables, and using the RMAN i have created a Ph. standby database and then converted to a logical.
    so now i have the same schema and the same tables in these servers.
    the fact of using logical stdby is to be able to make DML transactions.
    so the issue is that from the 10 tables i need 9 tables to be replicated and the last one will not be replicated, so the application connected to the log. stdby will use only this table to update the user record(login date, logout date...bla bla bla).
    the problem is that when the user will connect to the database the application will insert a record like "insert into SCHEMANAME.tablename....."
    the problem is that the schema name is added into the insert statement.
    Thank you in advance

  • Error from Logical Standby

    Dear All,
    I have configured Logical Standby Database 10gR2, on Windows 2003 Server.
    Logs are shipped and applied on the standby, without any issue.
    I can log on logical database using sys account, but if i use any other user's account i get this error message:
    SQL> connect user/pass
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06550: line 11, column 52:
    PL/SQL: ORA-16224: Database Guard is enabled
    ORA-01017: invalid username/password; logon denied
    ORA-06550: line 11, column 4:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 17, column 28:
    PL/SQL: ORA-16224: Database Guard is enabled
    ORA-01017: invalid username/password; logon denied
    ORA-06550: line 14, column 8:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 20, column 12:
    PLS-00513: PL/SQL function called from SQL must return value of legal SQL type
    ORA-06550: line 12, column 4:
    PL/SQL: Statement ignored
    ORA-01017: invalid username/password; logon denied
    I have copied the password file from live to standby.
    Kindly help

    Hi,
    Did you sure connecting to  standby database correct user and password ?
    Did you  getting following error on connection?
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06550: line 11, column 52:
    PL/SQL: ORA-16224: Database Guard is enabled
    ORA-01017: invalid username/password; logon denied
    ORA-06550: line 11, column 4:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 17, column 28:
    PL/SQL: ORA-16224: Database Guard is enabled
    ORA-01017: invalid username/password; logon denied
    ORA-06550: line 14, column 8:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 20, column 12:
    PLS-00513: PL/SQL function called from SQL must return value of legal SQL type
    ORA-06550: line 12, column 4:
    PL/SQL: Statement ignored
    ORA-01017: invalid username/password; logon denied
    Paste here your whole script.
    Additionally please check: http://docs.oracle.com/cd/E11882_01/server.112/e25608/manage_ls.htm#SBYDB4811
    10.2 Controlling User Access to Tables in a Logical Standby Database
    Regards
    Mahir M. Quluzade

  • How to skip delete on logical standby

    Dear guys and gurus,
    On next month i will have plan to delete history data on my Primary database, but i still want to keep them in logical standby as the data warehouse. So, how can i skip delete statement from primary database apply to logical standby.
    Oracle SQL apply only support for Skip DML but not for keep delete statemen (on 10g and 11g)
    SQL>exec dbms_logstdby.skip(statement => 'DELETE',schema_name => 'SCOTT', object_name => 'DEPT');
    BEGIN dbms_logstdby.skip(statement => 'DELETE',schema_name => 'SCOTT', object_name => 'DEPT'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SKIP'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I do search and see one post about 3 years age about this question but still not answered.So, do you have any idea for this ???
    So thanks and best regards.
    Ch

    You might want to play with this but here is an idea.
    CREATE OR REPLACE PROCEDURE schema.handle_delete (
    old_stmt IN VARCHAR2,
    stmt_type IN VARCHAR2,
    schema IN VARCHAR2,
    name IN VARCHAR2,
    xidusn IN NUMBER,
    xidslt IN NUMBER,
    xidsqn IN NUMBER,
    error IN VARCHAR2,
    new_stmt OUT VARCHAR2
    ) AS
    BEGIN
    -- Default to what we already have
    new_stmt := old_stmt;
    -- Ignore any GRANT errors on SYS or HR schemas
    IF INSTR(UPPER(old_stmt),'DELETE') > 0
    THEN
    IF schema IS NULL
    OR (schema IS NOT NULL AND
    (UPPER(schema) = '<SCHEMA>' OR UPPER(SCHEMA) = '<SCHEMA>' )
    THEN
    new_stmt := NULL;
    -- record the fact that we just skipped
    END IF;
    END IF;
    END handle_delete;
    Register the error handler with SQL Apply:
    SQL> EXECUTE DBMS_LOGSTDBY.SKIP_ERROR ( -
    statement => 'DML', -
    schema_name => NULL, -
    object_name => NULL, -
    proc_name => 'SYS.HANDLE_DELETE');

  • Skip table during automatic standby database

    We would like to skip a table from being replicated into a standby database.
    We do the following on the standby database
    startup nomount;
    alter database mount standby database;
    recover automatic standby database;
    and cancel the process.
    and then bring the standby database up to date at night for example.
    And during the day we would like to use it as a report database, to see if that is possible.
    To be able to do that, we do this:
    alter database open read only;
    But the problem is, there is one reporting table that we do not like to replicate.
    We want to create a database link in the standby (report) database, that links to the table in the live database.
    Because we need that data from the live database to be update to date in that table.
    That table does not contain data that needs to be stored, so it is no problem if it does not end up in the standby report database.
    Problem is that we cannot get Oracle to skip to replicate this REPORTPARAM table.
    We tried this
    execute dbms_logstdby.skip(stmt => 'SCHEMA_DDL',
    schema_name => 'ABSSOLUTE',
    object_name => 'REPORTPARAM',
    use_like => FALSE);
    exectue dbms_logstdby.skip(stmt => 'DML',
    schema_name => 'ABSSOLUTE',
    object_name => 'REPORTPARAM',
    use_like => FALSE);
    And when we check SELECT * FROM DBA_LOGSTDBY_SKIP
    we see the values in there.
    But still this table is being replicated.
    How can we stop Oracle from doing that?
    ( And can when we stopped Oracle from doing that, create a database link with alias to the same table in the live database,
    that will be the next step. )

    This is the output from select * from dba_logstdby_skip
    ERROR     STATEMENT_OPT     OWNER     NAME     USE_LIKE     ESC     PROC
    N     SCHEMA_DDL     ABSSOLUTE     REPORTPARAM     N          
    N     DML          ABSSOLUTE     REPORTPARAM     N          
    N     INTERNAL      SCHEMA     SI_INFORMTN_SCHEMA     %     N          
    N     INTERNAL     SCHEMA     APEX_030200     %     N          
    N     INTERNAL     SCHEMA     XS$NULL     %     N          
    N     INTERNAL     SCHEMA     ORDPLUGINS     %     N          
    N     INTERNAL     SCHEMA     APPQOSSYS     %     N          
    N     INTERNAL     SCHEMA     ORACLE_OCM     %     N          
    N     INTERNAL     SCHEMA     XDB     %     N          
    N     INTERNAL     SCHEMA     WMSYS     %     N          
    N     INTERNAL     SCHEMA     DIP     %     N          
    N     INTERNAL     SCHEMA     OUTLN     %     N          
    N     INTERNAL     SCHEMA     EXFSYS     %     N          
    N     INTERNAL     SCHEMA     ANONYMOUS     %     N          
    N     INTERNAL     SCHEMA     CTXSYS     %     N          
    N     INTERNAL     SCHEMA     ORDSYS     %     N          
    N     INTERNAL     SCHEMA     ORDDATA     %     N          
    N     INTERNAL     SCHEMA     MDSYS     %     N          
    N     INTERNAL     SCHEMA     SYSTEM     %     N          
    N     INTERNAL     SCHEMA     SYS     %     N          
    N     INTERNAL     SCHEMA     MGMT_VIEW     %     N          
    N     INTERNAL     SCHEMA     SYSMAN     %     N          
    N     INTERNAL     SCHEMA     DBSNMP     %     N
    The second select however
    SELECT APPLIED_SCN, NEWEST_SCN FROM DBA_LOGSTDBY_PROGRESS;
    returns no rows.

  • Issue while Instantiating a table in logical standby

    I am trying to instantiate the tables in my logical standby and i am getting this error
    ORA-39006: internal error
    ORA-06512: at "SYS.DBMS_LOGSTDBY", line 636
    ORA-06512: at line 1
    i used the below command to instantiate the table
    EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE('FLXUSER','JOB_ACTION', 'NGMES_PROD')
    i have also provide all the required privilege i.e LOGSTDBY_ADMINISTRATOR and DBA.still i am getting the error.
    In alertlog i found the Import struck warning as the job is getting struck.
    The value (30) of MAXTRANS parameter ignored.
    kupprdp: master process DM00 started with pid=31, OS id=4648
             to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'LH137', 'KUPC$C_1_20131218044529', 'KUPC$S_1_20131218044529', 0);
    Wed Dec 18 04:47:54 2013
    The value (30) of MAXTRANS parameter ignored.
    kupprdp: master process DM00 started with pid=51, OS id=3076
             to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'LH137', 'KUPC$C_1_20131218044754', 'KUPC$S_1_20131218044754', 0);
    Wed Dec 18 04:49:41 2013
    The value (30) of MAXTRANS parameter ignored.
    kupprdp: master process DM00 started with pid=52, OS id=4128
             to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'FLXUSER', 'KUPC$C_1_20131218044941', 'KUPC$S_1_20131218044941', 0);
    which i think are just warning.
    kindly help me out

    Yes that could very well be the reason. You can try recompiling. If it does not fix, you can reload the whole datapump utility by using following metalink note:
    How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)

  • Doubt regarding switchover from logical standby to primary

    I am using Oracle 10g databases on Linux environment
    I was trying creating a data guard configuration and once I was successfully done I created a logical standby database from the physical standby . Then I was trying to do a switchover .
    By mistake I gave the prepare switchover command in the logical standby before executing it in the primary . And then when I gave it in the primary both the status turned to be "PREPARING SWITCHOVER"
    In logical standby
    SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO PRIMARY;
    Database altered.
    SQL>  SELECT SWITCHOVER_STATUS FROM V$DATABASE;
    SWITCHOVER_STATUS
    PREPARING SWITCHOVER
    In primary
    SQL> ALTER DATABASE PREPARE TO SWITCHOVER TO LOGICAL STANDBY;
    Database altered.
    SQL> select switchover_status from v$database;
    SWITCHOVER_STATUS
    PREPARING SWITCHOVERNow I am not able to commit any of them to primary or logical standby
    In primary
    SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY;
    ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY
    ERROR at line 1:
    ORA-16217: prepare to switchover has not completed
    ORA-06512: at line 1
    In logical standby
    SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
    ALTER DATABASE commit  TO SWITCHOVER TO PRIMARY
    ERROR at line 1:
    ORA-16109: failed to apply log data from previous primaryLet me know what should be done now ? Is there anyway to solve this issue ?

    Can you try using the following first on Primary and then on Standby?
    ALTER DATABASE PREPARE TO SWITCHOVER CANCEL;

  • Easy way to audit high activity on table

    Hi,
    There is the case (db is 10g):
    We have some tables which we wanna audit. If any user make "mass" select (e.g. 100 or more records per time) - we'd like to know he did it. Normal activity is selecting one record per time.
    What would be the best tool to reach it?
    Regards,
    wiwusX

    Please use DB auditing feature, for more details…
    Master Note For Oracle Database Auditing (Doc ID 1299033.1)
    How to Setup Auditing (Doc ID 1020945.6)

  • Logical standby Slow after starting auditing

    Hi:
    I have logical standby, which was keeping with the primary database, then we started auditing on the primary database(Database auditing.) , After starting auditing my Logical standby not keeping with primary, after doing reasearch we found out that there are so many sql statement from sys schema on AUD$ table, and they are doing full tablescan on it, which is of 3GB as off now. Also This table is own by sys and by default all sys objects should be excluded from logical standby apply. But this is not, when I tryed to skip it by my self, then apply process gives ora-600 and stops.
    I think it is a bug or what ???
    Any help on this will be appriciated.
    Regards
    Bhushan

    Hi Guys:
    After taking my time we decided to truncate the sys.AUD$ on the LOGICAL STANDBY and that solved our problem.Now LS is catching up fast as I can see the progree is verry fast.
    Still if anybody from "ORACLE CORP" is reading this thread they should give us the reason why the sys.aud$ table is beging replicated on the LOGICAL STANDBY site. is this a BUG in oracle?
    Regards
    Bhushan

  • Skip the DELETE command on logical standby

    Hi All,
    I want to skip the DELETE command on logical standby.
    DB Version - 10.2
    OS - Linux
    Primary DB and logical standby DB .
    In our DB schema some transaction tables. We delete data from those tables by delete commands.
    Delete command, also delete data from logical standby DB. But we want to skip on logical standby DB .
    I use following for that and get error.
    ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    EXECUTE DBMS_LOGSTDBY.SKIP (stmt =>'DELETE TABLE', schema_name =>'TEST',object_name =>'TRANS',proc_name => null);
    ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
    But I got error
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SKIP'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    When I change stmt =>'DELETE TABLE' to stmt =>'DML', no error happen
    Please help me to solve this issue . This is urgent.
    Thanks in advance.
    Regards

    Dear aditi2,
    Actually it is so simple to understand the problem. Please read the following documentation and try to understand the SKIP procedure.
    http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
    *SKIP Procedure*
    Use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    By default, all SQL statements executed on a primary database are applied to a logical standby database.
    If only a subset of activity on a primary database is of interest for application to the standby database,
    you can use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    While skipping (ignoring) SQL statements is the primary goal of filters,
    it is also possible to associate a stored procedure with a DDL filter so that runtime determinations can be made whether to skip the statement,
    execute this statement, or execute a replacement statement.
    Syntax
    DBMS_LOGSTDBY.SKIP (
         stmt                      IN VARCHAR2,
         schema_name               IN VARCHAR2,
         object_name               IN VARCHAR2,
         proc_name                 IN VARCHAR2,
         use_like                  IN BOOLEAN,
         esc                       IN CHAR1);Hope That Helps.
    Ogan
    Edited by: Ogan Ozdogan on 30.Tem.2010 13:03

Maybe you are looking for