Creating DDL at schema level

Hi,
Is there a way to create DDL for all objects at the schema level from OEM?
Thanks.

DBMS_METADATA
With DBMS_METADATA you can retrieve complete database object definitions (metadata) from the dictionary by specifying:
The type of object, for example, tables, indexes, or procedures
Optional selection criteria, such as owner or name
Parse items (attributes of the returned objects that are to be parsed and returned separately).
Optional transformations on the output. By default the output is represented in XML, but callers can specify transformations (into SQL DDL, for example), which are implemented by XSLT (Extensible Stylesheet Language Transformation) stylesheets stored in the database or externally.
DBMS_METADATA provides the following retrieval interfaces:
For programmatic use: OPEN, SET_FILTER, SET_COUNT, GET_QUERY, SET_PARSE_ITEM, ADD_TRANSFORM, SET_TRANSFORM_PARAM, FETCH_xxx and CLOSE retrieve multiple objects.
For use in SQL queries and for browsing: GET_XML and GET_DDL return metadata for a single named object. The GET_DEPENDENT_XML, GET_DEPENDENT_DDL, GET_GRANTED_XML, and GET_GRANTED_DDL interfaces return metadata for one or more dependent or granted objects.
This chapter discusses the following topics:
Summary of DBMS_METADATA Subprograms
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_metada.htm#ARPLS026
Joel P�rez

Similar Messages

  • How to exclude tables from Schema level replication

    Hi All,
    I am currently trying to setup Oracle Streams (Oracle 11.1.0.6 on RHEL5) to replicate a schema from one instance to another.
    The basic schema level replication is working well, and copying DDL and DML changes without any problems. However there are a couple of tables that I need to exclude from the stream, due to incompatible datatypes.
    Does anybody have any ideas or notes on how I could achieve this?? I have been reading the Oracle documentation and find it difficult to follow and confusing, and I have not found any examples in the internet.
    Thanks heaps.
    Gavin

    When you use SCHEMA level rules for capture and need to skip the replication of a few tables, you create rules in the negative rule set for the table.
    Here is an example of creating table rules in the negative rule set for the capture process.
    begin
    dbms_streams_adm.add_table_rules(
    table_name => 'schema.table_to_be_skipped',
    streams_type => 'CAPTURE',
    streams_name => 'your_capture_name',
    queue_name => 'strmadmin.capture_queue_name',
    include_dml => true,
    include_ddl => true,
    inclusion_rule => false
    end;
    table_name parameter identifies the fully qualified table name (schema.table)
    streams_name identifies the capture process for which the rules are to be added
    queue_name specifies the name of the queue associated with the capture process.
    Inclusion_rule=> false indicates that the create rules are to be placed in the negative rule set (ie, skip this table)
    include_dml=> true indicates DML changes for the table (ie, skip DML changes for this table)
    include_ddl=> true indicates DDL changes for the table (ie, skip DDL changes for this table)

  • Schema level tiggers

    hi all,
    is it possible to write a schema level trigger with DCL and DDL commands in it.
    Actually in my database there are more than one (X & Y)schemas with differnt privelages.
    if i create a table in ' X'schema,i have to create a synonym for the same table for the other schema 'Y' and i want to grant select privelage for that table for 'Y' .my verison is 10204
    create or replace
    TRIGGER bcs_trigger
    after  create ON X.SCHEMA
    declare
    Cursor table_cur is
    Select object_id, object_name, object_type, owner
    from DBA_OBJECTS
    where to_date(created,'DD/MM/YYYY')= to_date(SYSDATE,'DD/MM/YYYY');
      type TABLE_collect is table of table_cur %rowtype;
    TACOLL TABLE_collect;
    v_msg varchar2(1000) := 'SYNONYM HAS BEEN CREATED';
    V_error varchar2(1000) := 'ALREADY EXIST';
    BEGIN
    open table_cur;
    loop
              fetch table_cur bulk collect into TACOLL;
               exit when table_cur %notfound;
               end loop;
               close table_cur;
    for i in 1.. TACOLL.count
    loop
    IF
    TACOLL(i). OBJECT_TYPE ='TABLE'
    THEN
    execute immediate 'create synonym '||TACOLL(i).OBJECT_NAME||' for '||TACOLL(i).OBJECT_NAME;
    execute immediate 'grant select on '||TACOLL(i).OBJECT_NAME||' to Y ';
    dbms_output.put_line ('v_msg');
    end if;
    end loop;
    end ;

    Hi Suresh.
    Welcome to OTN Forums!
    I think this help you
    CREATE OR REPLACE TRIGGER bcs_trigger AFTER
    CREATE ON X.SCHEMA
      DECLARE
        V_MSG VARCHAR2(1000) := 'SYNONYM HAS BEEN CREATED';
      BEGIN
        FOR OBJ IN
        (SELECT object_id,
          object_name,
          object_type,
          owner
        FROM DBA_OBJECTS
        WHERE TO_DATE(CREATED,'DD/MM/YYYY')= TO_DATE(SYSDATE,'DD/MM/YYYY'))
        LOOP
          IF OBJ.OBJECT_TYPE = 'TABLE' THEN
            EXECUTE IMMEDIATE 'create or replace synonym '||OBJ.OBJECT_NAME||' for '||OBJ.OBJECT_NAME;
            EXECUTE IMMEDIATE 'grant select on '||OBJ.OBJECT_NAME||' to Y ';
            dbms_output.put_line (V_MSG|| ' : ' ||OBJ_OBJECT_NAME);
          END IF;
        END LOOP;
      END ;

  • How to add new tables in Streams for Schema level replication ( 10.2.0.3 )

    Hi,
    I am in process of setting up Oracle Streams schema level replication on version 10.2.0.3. I am able to setup replication for one table properly. Now I want to add 10 more new tables for schema level replication. Few questions regarding this
    1. If I create new tables in source, shall I have to create tables in target database manually or I have to do export STREAMS_INSTANTIATION=Y
    2. Can you tell me metalink note id to read more on this topic ?
    thanks & regards
    parag

    The same capture and apply process can be used to replicate other tables. Following steps should suffice your need:
    Say table NEW is the new table to be added with owner SANTU
    downstr_cap is the capture process which is already running
    downstr_apply is the apply process which is already there
    1. Now stop the apply process
    2. Stop the capture process
    3. Add the new table in the capture process using +ve rule
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES
    table_name      => 'SANTU.NEW',
    streams_type    => 'capture',
    streams_name    => 'downstr_cap',
    queue_name      => 'strmadmin.DOWNSTREAM_Q',
    include_dml     => true,
    include_ddl     => true,
    source_database =>  ' Name of the source database ',
    inclusion_rule  => true
    END;
    4. Take export of the new table with "OBJECT_CONSISTENT=Y" option
    5. Import the table at destination with "STREAMS_INSTANTIATION=Y' option
    6. Start the apply process
    7. Start the capture process

  • SQL Trace for schema level

    Hi
    Database 10.1.0.4
    Sql trace file which I have used but didn't get the trace file. I have tried to get per session Id but not able to get the trace file, when ever user logged into application, virtually 6 user get lgged in and you never know about user. So I have desided to capture for schema
    I have used this for tracing
    SQL> ALTER SESSION SET sql_trace=TRUE;
    SQL> ALTER SESSION SET sql_trace=FALSE;
    Or
    SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
    SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => FALSE);
    or
    SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>TRUE);
    SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>FALSE);
    I want to get trace file for schema, can anyone suggest how do I get trace file at schema level.
    Thanks for help

    Hi,
    Using instance-level tracing by setting the init.ora/spfile... parameter SQL_TRACE=TRUE, all processes against the instance will create their own trace files. This particular method of tracing should be used with care since it creates a great deal of overhead against the system. In addition, the default value for this parameter is FALSE.
    Cheers
    Legatti

  • AWR REPORT AT SCHEMA LEVEL

    Hello,
    Can anybody guide me how to generate an AWR (automatic workload repository) report at schema level? Actually I have created one user name xyz and imported some 1000 objects (tables, views etc) .
    I have little doubt here , when we create one user ,is schema for that user will it create automatically …..if its true then I need to generate one AWR report for that user or schema

    I don't think this is possible: AWR only works at database/instance level and not at schema level.

  • What level suplemental logging requires to setup Streams at Schema level

    Hi,
    Working on setting-up streams from 10g to 11g db @ schema level. And the session is hanging with statement "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" while running following command - generated using DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS.
    Begin
    dbms_streams_adm.add_schema_rules(
    schema_name => '"DPX1"',
    streams_type => 'CAPTURE',
    streams_name => '"CAPTURE_DPX1"',
    queue_name => '"STRMADMIN"."CAPTURE_QUEUE"',
    include_dml => TRUE,
    include_ddl => TRUE,
    include_tagged_lcr => TRUE,
    source_database => 'DPX1DB',
    inclusion_rule => TRUE,
    and_condition => get_compatible);
    END;
    The generated script also setting each table with table-level logging "'ALTER TABLE "DPX1"."DEPT" ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, FOREIGN KEY, UNIQUE INDEX) COLUMNS'".
    So my question is: Is Database level supplemental logging required to setup schema-level replication? If answer is no then why the following script is invoking "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" command.
    Thanks in advance.
    Regards,
    Sridhar

    Hi sri dhar,
    From what I found, the "ALTER DATABASE ADD SUPPLEMENTAL LOG DATA" is required for the first capture you create in a database. Once it has been run, you'll see V$DATABASE with the column SUPPLEMENTAL_LOG_DATA_MIN set to YES. It requires a strong level of locking - for example, you cannot run this alter database while an index rebuild is running (maybe an rebuild online?)
    I know it is called implicitly by DBMS_STREAMS_ADM.add_table_rules for the first rule created.
    So, you can just run the statement once in a maintenance window and you'll be all set.
    Minimal Supplemental Logging - http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14215%2Flogminer.htm%23sthref2006
    NOT to be confused with database level supplemental log group.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14228/mon_rep.htm#BABHHCCC
    Hope this helps,
    Regards,

  • Schema level and table level supplemental logging

    Hello,
    I'm setting up bi- directional DML replication between two oracle databases. I have enabled supplemental logging database level by running this command-
    SQL>alter database add supplemental log data (primary key) columns;
    Database altered.
    SQL> select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_UI from v$database;
    SUPPLEME SUP SUP
    IMPLICIT YES NO
    -My question is should I enable supplemental logging table level also(for DML replication only)? should I run the below command also?
    GGSCI (db1) 1> DBLOGIN USERID ggs_admin, PASSWORD ggs_admin
    Successfully logged into database.
    GGSCI (db1) 2> ADD TRANDATA schema.<table-name>
    what is the deference between schema level and table level supplemental logging?

    For Oracle, ADD TRANDATA by default enables table-level supplemental logging. The supplemental log group includes one of the following sets of columns, in the listed order of priority, depending on what is defined on the table:
    1. Primary key
    2. First unique key alphanumerically with no virtual columns, no UDTs, no functionbased
    columns, and no nullable columns
    3. First unique key alphanumerically with no virtual columns, no UDTs, or no functionbased
    columns, but can include nullable columns
    4. If none of the preceding key types exist (even though there might be other types of keys
    defined on the table) Oracle GoldenGate constructs a pseudo key of all columns that
    the database allows to be used in a unique key, excluding virtual columns, UDTs,
    function-based columns, and any columns that are explicitly excluded from the Oracle
    GoldenGate configuration.
    The command issues an ALTER TABLE command with an ADD SUPPLEMENTAL LOG DATA clause that
    is appropriate for the type of unique constraint (or lack of one) that is defined for the table.
    When to use ADD TRANDATA for an Oracle source database
    Use ADD TRANDATA only if you are not using the Oracle GoldenGate DDL replication feature.
    If you are using the Oracle GoldenGate DDL replication feature, use the ADD SCHEMATRANDATA command to log the required supplemental data. It is possible to use ADD
    TRANDATA when DDL support is enabled, but only if you can guarantee one of the following:
    ● You can stop DML activity on any and all tables before users or applications perform DDL on them.
    ● You cannot stop DML activity before the DDL occurs, but you can guarantee that:
    ❍ There is no possibility that users or applications will issue DDL that adds new tables whose names satisfy an explicit or wildcarded specification in a TABLE or MAP
    statement.
    ❍ There is no possibility that users or applications will issue DDL that changes the key definitions of any tables that are already in the Oracle GoldenGate configuration.
    ADD SCHEMATRANDATA ensures replication continuity should DML ever occur on an object for which DDL has just been performed.
    You can use ADD TRANDATA even when using ADD SCHEMATRANDATA if you need to use the COLS option to log any non-key columns, such as those needed for FILTER statements and KEYCOLS clauses in the TABLE and MAP parameters.
    Additional requirements when using ADD TRANDATA
    Besides table-level logging, minimal supplemental logging must be enabled at the database level in order for Oracle GoldenGate to process updates to primary keys and
    chained rows. This must be done through the database interface, not through Oracle GoldenGate. You can enable minimal supplemental logging by issuing the following DDL
    statement:
    SQL> alter database add supplemental log data;
    To verify that supplemental logging is enabled at the database level, issue the following statement:
    SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;
    The output of the query must be YES or IMPLICIT. LOG_DATA_MIN must be explicitly set, because it is not enabled automatically when other LOG_DATA options are set.
    If you required more details refer Oracle® GoldenGate Windows and UNIX Reference Guide 11g Release 2 (11.2.1.0.0)

  • Best Approach to create Security / Authorization Schema for an APEX Apps

    Hi,
    I am planning to create a Security / Authorization Schema for an APEX Application.
    Just want to know what is the best approach to create the security feature in APEX, so that it should be re-used in other APEXApplications too..
    I am looking for following features...
    1. users LOGIN and then user's name is stored in APEX_USER...
    2. Based on the user, I want to restrict the Application on following levels.
    - TABS
    - TABS - Page1 (Report
    - Page2 (Form)
    - Page2 (Region1)
    - Page2 (Region1, Button1)
    - Page2 (Region1, Items,....)
    AND so on.....basically depending on user....he will have access to certain TABS, Pages, Regions, Buttons, Items...
    I know, we have to create the Authorization Schema for this and then attach these Authorization Schema to the different Level we want.
    My Question is, what should be the TABLE structure to capture these info for each user...where we will say...this USER will have following access...AND then we create Authorization Schema from this table...
    Also what should be the FRONT end, we should have to enter these detail...
    SO, wondering, lot of people may already have implemented this feature....so if guys can provide the BEST Approach (re-usable for other APEX Application)....that will be really nice..
    Thanks,
    Deepak

    Hi Raghu,
    thanks for the detial info.
    so that means..I should have 2 table...
    master table (2 columns - username, password)
            username    password
       user1       xxxx
       user2       xxxx2nd table (2 columns - username, chq_disp_option)
    - In this table, we don't have Y/N Flag you mentioned..
    - If we have to enter all the regions/tabs/pages in the Applications here or just those regions/tabs/pages for which are conditionally diaplayed.
    - so that means in all the Pages/Regions/tabs/items in the entire Application, we have to call the Conditionally display..
    - suppose we have 3 tabs, 5 pages, 6 regions, 15 items..that means in this table we have to enter (3+5+6+15) = 29 records for each individual users..
              username    chq_disp_option
       user1       re_region1
       user1       re_region2
       user1       tb_main
       user1       Page1
       user1       Page5
       ----        ----     - how you are defining unique name for Regions..i mean in static ID or the Title
    - is the unique name for tab & item is same as the TAB_NAME (T_HOME) & Item Name (P1_ITEM1) or you are defining somewhere else.
    Thanks,
    Deepak

  • Ask about DML Handler for Streams at the Schema level ?

    Hi all !
    I use Oracle version 10.2.0.
    I have two DB is A (at machine A, and it used as source database) and B (at machine B - destination database). Some changes from A will apply to B.
    At B, I installed oracle client to use EMC (Enterprise Manager Console) tool to generate some script, and use them to configure Streams environment, I configured Streams at the Schema level (DML and DDL) => I successed ! But I have two problems is:
    + I write a DML Handler, called "emp_dml_handler" and want set it to EMP table only. So, I must DBMS_STREAMS_ADM.ADD_TABLE_RULES ? (I configured: DBMS_STREAMS_ADM.ADD_SCHEMA_RULES) such as:
    BEGIN
    DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name => '"HOSE"',
    streams_type => 'APPLY',
    streams_name => 'STRMADMIN_BOSCHOSE_REGRES',
    queue_name => 'apply_dest_hose',
    include_dml => true,
    include_ddl => true,
    source_database => 'DEVELOP.REGRESS.RDBMS.DEV.US.ORACLE.COM');
    END;
    and after:
    DECLARE
    emp_rule_name_dml VARCHAR2(50);
    emp_rule_name_ddl VARCHAR2(50);
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name => 'HOSE.EMP,
    streams_type => 'APPLY',
    streams_name => 'STRMADMIN_BOSCHOSE_REGRES',
    queue_name => 'apply_dest_hose',
    include_dml => true,
    include_ddl => true,
    source_database => 'DEVELOP.REGRESS.RDBMS.DEV.US.ORACLE.COM',
    dml_rule_name => emp_rule_name_dml,
    ddl_rule_name => emp_rule_name_ddl);
    DBMS_APPLY_ADM.SET_ENQUEUE_DESTINATION(
    rule_name => emp_rule_name_dml,
    destination_queue_name => 'apply_dest_hose');
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'HOSE.EMP',
    object_type => 'TABLE',
    operation_name => 'UPDATE',
    error_handler => false,
    user_procedure => 'strmadmin.emp_dml_handler',
    apply_database_link => NULL,
    apply_name => NULL);
    END;
    ... similar for INSERT and DELETE...
    I think that I only configure streams at the schema level and exclude EMP table, am i right ?
    + At the source, EMP table have a primary key. And I configured:
    ALTER TABLE HOSE.EMP ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
    ==> So, at the destination, have some works that I must configure the substitute key for EMP table ?
    Have some ideas for my problems ?
    Thanks
    Edited by: changemylife on Sep 24, 2009 10:45 PM

    If you want to discard emp from schema rule, then just add a negative rule, either on capture or apply.
    What is the purpose of :
    DBMS_APPLY_ADM.SET_ENQUEUE_DESTINATION(
    rule_name => emp_rule_name_dml,
    destination_queue_name => 'apply_dest_hose');sound like you are enqueunig into 'apply_dest_hose' all the rows for this table that comes from ... 'apply_dest_hose'
    Next you declare a DML_HANDLER that is attached to nobody :
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'HOSE.EMP',
    object_type => 'TABLE',
    operation_name => 'UPDATE',
    error_handler => false,
    user_procedure => 'strmadmin.emp_dml_handler',
    apply_database_link => NULL,
    apply_name => NULL);           <----- nobody rules the world!
    END;the sequence of evaluation is normally :
    APPLY_PROCESS (reader)
              |
              | -->  RULE SET
                          |
                          | --> RULE .....
                          | --> RULE
                                     |
                                     | --> evaluate OK then --> exist DML_HANDLER  --> YES --> call DML_HANDLER --> on LCR.execute call coordinator
                                                                                            |
                                                                                            | NO
                                                                                            |                                                                 
                                                                                       Implicit apply (give LCR to coordinator which dispatch to one apply server)    
                                                      Since your dml_handler is attached to null apply process it will never be called by anybody and your LCR for table emp will be implicit applied by its apply process.

  • Schema Level Problem !

    {color:#000080}Hi,{color}
    {color:#000080}I have successfully configured the schema level replication, but some issues are front of me to struck me.
    So, I am going to explain my scenario as following.{color}
    {color:#000080}1: Site1 having oracle 10g DB and having two schema level processes: Capture and Propagate
    2: Site2 having oracle 10g DB and having two schema level processes: Capture and Propagate
    3: Central_DB having oracle10g DB and having two APPLY processes one for site1 and second for site2.{color}
    {color:#000080}I have a plan to connect the total 18 branches to our Central_DB in future.
    From all sites to Central_DB we will configure the Schema Level Replication using streams.(All sites have same schema)(DML + DDL)
    But From Central_DB to all sites we will configure Table Level Rule-Based replication.(Only DML's){color}
    {color:#000080}My Questions are:{color}
    {color:#000080}1: Please recommend me that it's a good model or not ?
    2: When site1 doing DML or DDL changes locally then changes are captured by capture process and
    After that changes are propagated from source queue(Site1) to destination queue(CEntral_DB) and
    Applied by apply process of Central_DB.
         &gt; If site1 doing changes and at the same time Central_DB goes shutdown and
    restart again then changes are applied from site1 to Central_DB.(Normal Working)
         &gt; If site1 doing changes and at the same time Central_DB goes shutdown and
    site1 doing more changes locally, after few minutes site1 also goes shutdown , Now site1 and Central_DB both are down.
         &gt; After one day when both machines are upped and running, but propagation process
         contains some connection errors and no further changes are replicated, even status of processes are enabled.{color}
    {color:#ff0000}ERROR: {color}
    {color:#ff0000}     ORA-12545: Connect failed because target host or object does not exis {color}
    {color:#000080}Please assist me to troubleshoot this problem why no further changes are replicated?{color}
    {color:#000080}Thanks,
    Fazi {color}
    {color:#000080}
    {color}
    {color:#000080}
    {color}

    That would be if an IP or DNS lookup (depending on what is specified as HOST in the tnsnames entry) is failing.
    Possibly, the lookups before the servers went down were via DNS and now the DNS is no longer available (it has gone down ?). OR that someone has recreated a hosts file and the earlier entry for the target host is missing.

  • Schema Level DML

    I have about 200 tables, and each table has two columns : ( table_name_ID, local_id ).
    example :
    COST ( cost_id, local_id )
    RATES ( rates_id, local_id )
    SALARY ( salary_id, local_id )
    I want the column local_id to be set to same value as table_id. ( local_id = cost_id for COST table; local_id = SALARY_ID in SALARY table etc.)
    The code for trigger on these table will be generic and can be automtically generated.
    But we are talking about 200 tables - means huge amount of testing with existing triggers on all these tables.
    Is there any simpler method.
    BTW - I purused following thread, and it talks about using AUDITING.
    Re: Schema level Database triggers
    But I wonder how AUDITING can be used in place of trigger to modify data ?

    If you are running 11g, you could also replace the "local_id" physical columns with virtual ones (below). Not very pretty, but way cheaper than triggers.
    SQL> CREATE TABLE COST ( cost_id  number
      2                    , local_id number generated always as (cost_id+0) )
      3  /
    Table created
    SQL> insert into cost (cost_id) values (1);
    1 row inserted
    SQL> select * from cost;
       COST_ID   LOCAL_ID
             1          1

  • Schema level replication.

    What kind of changes will be captured if we are having schema level replication?
    Will it capture the changesonly related to tables or it will capture the changes to other objects like procedure, function, triggers etc also?
    Kapil

    It replicates everything concerned to a ddl and dml change.
    It even replicates the capture,propagate and apply procceses if running on the source database..........:-)

  • Schema level trigger

    Hello,
    Please clarify me with respect to after logon trigger (defined at the schema level). So i wanna monitor how many times a user logs on / off. When i specify the ON SCHEMA , the trigger fires for the specific user. If i specify ON DATABASE the trigger fires for all users. But what's the difference?! Because when a user logs on, he logs on on a "schema", so no matter which user logs on, the ON SCHEMA trigger always fires.
    User A logs on, ON SCHEMA trigger fires.
    User B logs on, ON SCHEMA trigger fires.
    If i specify ON DATABASE, the trigger also fires, because the user logs on.
    So, what's the difference?
    Thanks

    Roger22 wrote:
    so , can anyone answer?You misunderstand "schema", triggers and docs are a bit misleading. When you create, for example, AFTER LOGON trigger you can specidy:
    ON DATABASEwhich means trigger will fire for every user who logs in. Or you can specify:
    ON schema_name.SCHEMAwhich means trigger will fire only when user schema_name logs in. Below is example:
    SQL> connect scott
    Enter password: *****
    Connected.
    SQL> create or replace
      2  trigger after_logon_db
      3  after logon
      4  on database
      5  begin
      6  raise_application_error(-20900,'Logion is not allowd.');
      7  end;
      8  /
    Trigger created.
    SQL> connect u1/u1
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20900: Logion is not allowd.
    ORA-06512: at line 2
    Warning: You are no longer connected to ORACLE.
    SQL> connect u2/u2
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20900: Logion is not allowd.
    ORA-06512: at line 2
    SQL> connect scott
    Enter password: *****
    Connected.
    SQL> drop trigger after_logon_db
      2  /
    Trigger dropped.
    SQL> create or replace
      2  trigger after_logon_u1
      3  after logon
      4  on u1.schema
      5  begin
      6  raise_application_error(-20900,'Logion is not allowd.');
      7  end;
      8  /
    Trigger created.
    SQL> connect u1/u1
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20900: Logion is not allowd.
    ORA-06512: at line 2
    Warning: You are no longer connected to ORACLE.
    SQL> connect u2/u2
    Connected.
    SQL> As you can see, ON DATABASE trigger fired for both users U1 & U2. Trigger ON U1.SCHEMA fired for user U1 only. I hope it answers your question.
    SY.

  • EXPORT at schema level, but exclude some tables within the export

    I have been searching, but had no luck in finding the correct syntax for my situation.
    I'm simply trying to export at the schema level, but I want to omit certain tables from the export.
    exp cltest/cltest01@clprod file=exp_CLPROD092508.dmp log=exp_CLPROD092508.log statistics=none compress=N
    Thanks!

    Hi,
    Think in simple first.. you use the TABLES Clause..
    Example.
    exp scott/tiger file=empdept.expdat tables=(EMP,DEPT) log=empdept.log
    In case if you scehma contains less number of tables.. !!
    Logically if you have large number of tables, I say this solutuion might work ...all around... alternative solutions to solve the problems.. If you have hundered of tables... in your schema....
    Try to Create a New Schema and using CTAS create a tables which are skippable in the Current Scehma.
    Do an Export and once the Job Done.. you recreate the backup fom New schema
    and Import to DB (Destinaiton)
    - Pavan Kumar N

Maybe you are looking for

  • Imported Jar file not loaded at run time ORA-105100

    Oracle 9iDS forms Version 9.0.2.9.0 Oracle 9iAS Release 2 I have imported java classes from a jar file into my form. I have it working in client server. Added the entries to the classpath in the default.env and system environment variable for develop

  • CUCM Silent Monitoring

    Hi all, We have UCCX 7.0.1 product in our company, and was wondering if CUCM Silent Monitoring through the Phone's BIB (Build In Bridge) is possible from CSD. I know UCCE supports Silent Monitoring through CM BIB, but I could not find any document sa

  • Under what circumstances JNI_CreateJavaVM will return 0

    Hello all, Can any one please tell me "under what cicumstances JNI_CreateJavaVM returns 0" ? The following code segment returns 0. when I try to debug the code segment using VC++ 6.0. jdk 1.4.1 ON WINDOWS 2000 Prof. The debugger first shows status =

  • Deleted application shows up in Finder Places

    I have deleted the application iSquint ( using AppCleaner) but a "greyed" out folder for iSquint appears in my Finder window under the PLACES heading. I cannot click on the iSquint icon (looks like a document icon with the top corner turned down). I

  • HT3728 can I rename my time capsule with a soft reset or how can I rename it?

    I am trying to rename my time capsule, how can this be done? do I have to perform a reset and if so soft, hard etc.