Identify the schema using sys_context (' USERENV', 'CURRENT_SCHEMA' ")

DB version: 10.2.0.4

I am trying to create a trigger that will follow all DDL in a particular schema.
But the relaxation below does not seem to work. Don't know if
('USERENV', 'CURRENT_SCHEMA') 
is the right way to identify the schema where the DDL has occurred.
create or replace trigger sys.mytest_trg after ddl on database
declare
v_sch_name varchar2(350);
begin

SELECT sys_context('USERENV', 'CURRENT_SCHEMA') into v_sch_name FROM dual;

if v_sch_name = 'PRODSCHEMA'
then
--insert into SCOTT.test21 values (v_sch_name);
--commit;
dbms_output.put_line ('You just performed a DDL in PRODSCHEMA');
end if;

end mytest_trg;
/

Why not simply refers to ora_dict_obj_owner?

Refer to the documentation:
http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96590/adg14evt.htm

Tags: Database

Similar Questions

  • How to identify the fonts used in text format?

    How to identify the fonts used in text format?

    Hi DSB.

    Open the document in Reader, go to the menu file-> properties, then click on the tag are. You will see a list of the fonts used in the document.

    Another option is to copy the text and paste it into MS Word, where you can simply move your mouse over the text to display the name of the font.

    Kind regards

    Nicos

  • Size of the schema and the schema used provided actual spending

    Hello

    Can you please provide me with the query that is used to see the actual size of the schema and the schema used provided.

    I got the sqlquery to see the used size of the schema (select owner, sum (bytes) / 1024/1024 "MB" dba_segments group by owner;).

    Please give me the sqlquery to see the actual size of the schema

    Does

    SQL> select username,tablespace_name,bytes,max_bytes from dba_ts_quotas order by 1,2;
    

    Help?

  • Prevent the owner of the schema using development tools

    Hello world

    We are doing some tasks to meet the PCI DSS requirements. One of them is preventing the schema owner to log in using development tools (TOAD, sqlplus, plsqldev, SQL Developer...). I found a solution here:

    http://kamranagayev.com/2009/10/04/block-developers-from-using-Toad-and-other-tools-on-production-databases/

    But as comment said, if we change the name of the .exe file, we can easily connect. I thought to do info = module, no program info. I tried with no success. I read somewhere that in after logon, the client info trigger is not set completely. So that we can't get info module exactly after logon trigger (I tried and I have seen this module was same as program interviewed since the session$ v).

    Another comment suggested that we allow some programs to connect instead of refuse many unauthorized tools. I think it is a good idea. But I wonder if some guys know rename tool dev as our authorized tools and it can connect.

    If anyone has any ideas or solutions, please help me. Thank you.

    One solution is to use two schemas - detail a. has no privs assigned to it (not even CREATE SESSION), but contains all of the objects (tables, indexes, views, code, etc.). Diagram B does not all objects, but given privileges to operate on the objects belongs to priv a. withdrawal CREATE SESSION from scheme a scheme b (in for example Prod) will achieve your requirement.

  • Cannot save the schema using the client - crashes ' start record contour.

    All,

    I use version 9.3.1 (yes I know we should be upgraded) and EAS installed on my machine (not web-based version).  For some reason, my computer crashed last week so I had to reinstall EAS.  After I did, I started having the problem of not being able to save a scheme and it gets stuck on the "start record sketch."

    It is not a java problem, that I'm not using the web browser.  In addition, a colleague has the same version of java and isn't in trouble. Also, I got this version of java (1.6) on my machine for months.

    Any ideas.

    Thank you

    Check: Cannot save the schema with Essbase Administration Services and Version Java JRE 1.6 (Doc ID 847487.1)

    It indicates that the client computer does not have the supported JRE versions.

  • Tables of export and import the schema using the system user

    Hello

    Can someone asssit me please:

    I want to export all the tables / or some tables of a schema (ETLUSER) on DB1 to ETLUSER on an other (DB2) database by using the user of the SYSTEM. The SYSTEM user has DBA privilege.
    How I do what I do not know the password of ETLUSER.

    Environment:
    Oracle 11 g 2, AIX5

    Thank you.

    no problem, shouldn't you password in the ETLUSER.
    Start your exp or imp of the user of the system

    below, scott table dept exported and imported in the HR schema.

    Oracle@oragg1 > exp tables = scott.dept file = a.dmp log = b.log

    Export: Release 10.2.0.4.0 - Production on Mon Mar 19 18:58:45 2012

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Username: System
    Password:

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    With the partitioning, Real Application Clusters, OLAP, data mining
    and Real Application Testing options
    Export in US7ASCII and AL16UTF16 NCHAR character set
    Server uses WE8ISO8859P1 (possible character set conversion) character set

    About to export specified tables by conventional means...
    Current user has changed to SCOTT
    . . export the DEPT 10 exported table rows

    Oracle@oragg1 > imp leader = a.dmp log = bb.log fromuser = scott touser = hr

    Import: Release 10.2.0.4.0 - Production on Mon Mar 19 18:58:56 2012

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Username: System
    Password:

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    With the partitioning, Real Application Clusters, OLAP, data mining
    and Real Application Testing options

    Export file created by EXPORT: V10.02.01 by conventional means
    import in US7ASCII and AL16UTF16 NCHAR character set
    import server uses WE8ISO8859P1 (possible character set conversion) character set
    *. import of SCOTT in HR objects *. .
    "DEPT" table import 10 lines imported
    Import completed successfully without warnings.

  • Try to identify the 2000Mo used on my hardrive xp by "JMRE 2000: c:\program files 1-3 project?

    I ran out of space on my hard drive and I need to clean it.  That's what I see: two entries:

    JMRE 2000 1026 MB

    C:\Program files Project 1

    JMRE 2000 1035 MB

    C:\Program files project 1 #3

    What is c? I can never remember putting this on my hard drive.  Thank you

    I want to get rid of. as its taking a lot of space.

    It is likely that the documents, but a search Google failed to suggest useful for JMRE or JMRE 2000 opportunities.

    Do you mean that there are two files like this:

    C:\Program Files\Project 1\JMRE2000
    C:\Program Files\Project 1 #3\JMRE2000

    Navigate in Windows Explorer to one of the directories
    Click Tools > Folder Options > view
    Click the radio button "show the hidden files and folders".
    Uncheck the box for "Hide extensions of known file types".

    Will there be other files in the directory? What is?
    What is the JMRE2000 file extension (3 characters after the point)?

    Right-click on the JMRE file and select Properties
    If there is a 'Version' tab, click on it (not all files have the Version tabs): useful information here?

    If you wish, you can undo changes made to the Folder Options when you are finished.

  • How to identify the fonts used in a pdf document

    Hi all! I was given a pdf and asked to understand which fonts are used. Is there an easy way to find this information? I use the version of Adobe Acrobat Pro CC on an iMac. I looked online, but only to find old information. Thank you!

    Julie

    See: file - properties - Fonts.

  • How to identify the style used in Photoshop?

    I have prepared a text with style, but I can't find out witch style is in the style gallery (I simply give upt). There are just miniature without any name - how to find it, I have a lot of styles.

    prepared a text with style

    A paragraph or character style? Just click an insertion point in formatted text and look at the window > paragraph Styles (or if a character style, window > character Styles) and it will be highlighted in the list. Before you forget, double-click it in the Panel and give it a name short and descriptive.

  • Register xmltype column of a table in the schema using DBMS_registerschema

    I try to do the following:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema
    (SCHEMAURL = > 'CCD.xsd',)
    SCHEMADOC = > xdbURIType (select SANDBOX. XHOLDER. SYS_NC_ROWINFO$ sandbox. XHOLDER) .getClob)
    );
    END;

    But he does not have a select statement where she is waiting for a. I can't find anything to do what I'm trying to do. Anyone with ideas?

    Thanks TONS!
    DECLARE
      XMLSCHEMA XMLTYPE;
    BEGIN
      select OBJECT_VALUE
         into XMLSCHEMA
        from SANDBOX.XHOLDER ;
    
       DBMS_XMLSCHEMA.registerSchema(SCHEMAURL => 'CCD.xsd', SCHEMADOC => XMLSCHEMA);
    END;
    

    Published by: mdrake on 25 Sep, 2009 10:52

    Published by: mdrake on 25 Sep, 2009 10:53

  • Identify the name of the schema in a procedure/package

    My google-fu is totally miss you on this one and I have a method for doing this already, but there is an insidious sense that there is a better way to do it there.

    Basically I have two schemas that have the same procedures, packages, etc. in them (separate for reasons of risk; leaves do not enter the problem of duplication of code to maintain...!) and in a few, there are references to the schema to which belongs the package/proc/function (for example for analysis of tables). In order to avoid the schema name and the nightmare of maintaining different publication for different schemas, hard coding scripts I want to code in order to determine which schema it runs under.

    I can't use 'USER' as which shows the user connected, and I want the name of the owner of the code being run.

    I came with:
    select username from user_users;
    but as I said, I can't help but feel that there is a better way.

    Is there, and if there is, what is it please?

    This?

    sys_context (' USERENV', 'CURRENT_SCHEMA' ")

  • Calculate the space used by an individual/idebtifying partition in the partitions belonging to a partition - possible?

    Hello

    Using oracle 11.2.0.3 and have a partitioned table, some of the partitions use their own tablespace for to use WHERE user_segments but many partitions share the same tablespace.

    We wish to place each partition to a tablepsace of dedicatde and seek to identify the space used by a single partition.

    What is the best way to do this?

    See user_tatb_partitions ha snum_rows + blocks.

    Can see WHERE user_segments door secondary partition names.

    Is that a query can use for secondary idnentify belonging to a partition

    Thank you

    See halfway down the page below for SQL XML util to convert a string of high_value.

    http://OraStory.WordPress.com/2013/12/12/SQL-utils-using-XML/

  • connections hs Oracle to mysql without passthrough 'use the schema' command

    Oracle 11.2

    create a connection of hs to log in as root to mysql.

    Start receiving

    in mysql create a schema of 'metric '.

    create a vw_backups of view under "settings" in looking at mysql.backup_history

    create a "mysql_metrics" db link to mysql using the metric schema

    CREATE THE DATABASE LINK "MYSQL_METRICS".

    CONNECT to "metric".

    IDENTIFIED BY < PWD >

    With the HELP of 'mysql ';

    in oracle

    Select * from 'vw_backups"@mysql_metrics '.

    Select * from 'vw_backups"@mysql_metrics '.

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    [MySQL] [Driver ODBC 5.2.a] [mysqld - 5.5.28 - log] Table 'mysql.vw_backups' doesn't exist not {42 S 02, NativeErr = 1146}

    ORA-02063: preceding 2 lines of MYSQL_METRICS

    OR

    Select * from 'metrics.vw_backups"@mysql_metrics '.

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    [MySQL] [Driver ODBC 5.2.a] [mysqld - 5.5.28 - log] Table 'mysql.metrics.vw_backups' doesn't exist not {42 S 02, NativeErr = 1146}

    ORA-02063: preceding 2 lines of MYSQL_METRICS

    This looks to my like his or by default in the schema of mysql root.  However, we can make it work by issuing the command use schema via passthrough

    Select DBMS_HS_PASSTHROUGH. EXECUTE_IMMEDIATE@MYSQL_metrics ("metrics of USE') of double;

    my selection now works.

    How can I get my application to work without this passthrough command?  Im sure Ive done this before, without having to do

    replied.  My necessary odbc.ini metric schema not root.

  • How to identify the siebel custom index created from DB without using siebel tools

    Dear Experts,

    Please let us know how to identify siebel custom indexes that are created directly through DB. We don't are not sure on the customer tables had created indexes.

    Thank you

    Carine Ch

    Hello carine,.

    Thank you for using Oracle communities.

    Custom indexes created without using Siebel tools are not included in the schema definition in the Siebel Repository.

    Just for your information, these indexes are deleted during the upgrade of database. In order to preserve these indexes, add them to the repository Siebel using Siebel Tools.

    Now come to your query you have utility DBCHCK.

    DBCHCK is that Siebel provided utility to compare the logical schema in the Siebel Repository against objects in the physical Oracle database.

    DBCHCK must be run regularly to check the status of the Siebel business, especially after a release.

    DBCHCK can be useful to identify custom index added by the development team, but not added to the repository using Siebel tools.

    You can run it from a server in the environment. A performance by connection to the base. This should be run from the folder siebsrvr

    You can get more information from document following knowledge.

    How the Dictutl and the dbchck to run? (Doc ID 475677.1)

    I hope it helps.

    Best regards

    Chetan

    P.S. If one of the answers was correct or useful, it would be great if you can mark as appropriate help the other identified correctly updated.

  • How to identify the Source of Table in a schema star

    Hello
    We have a star schema with an intermediate table (with fact, as data on sales data) and two tables of dimension (such as by location and product data). In the model, we have specified an intermediate table to have a FK relationship with these two dimension tables.

    Two questions:
    -How can I select staging table and the foreign key columns in a KM. There are a few options available to the general public as: FK_PK_TABLE_NAME which helps me get my dimension of array, CT_NAME, ERR_NAME, but I can not find a method to identify the intermediate table that is one of the source tables in my interface.

    -Is it possible to use the function getsrctableslist() somehow? For example we can use like I_TABLE or TABLE_ORD fields to identify the source table by using this function.

    -On the 'Control' of my interface tab, I see the constraints that have been on the target table, is it possible to check the constraints on the source table. For example I can check if the source table contains all the entries valid product by referring to the product as the forign key relationship dimension table.

    Pointers, advice, solutions are appreciated.

    Thank you

    It's Ok now...

    follow these steps...

    (1) at IKM (not ckm) create a new step.

    technology: the same to the table in step
    Logical schema: that of the table in step

    Code:

    <%=odiRef.getSrcTablesList( "","/*\n Will be used the table (and its alias): \n*/","","")%>

    (2) move this step just before the stage of "Flow Control".

    (3) to sewing, the same stage where is the code that you sent change me all code at 'FROM' to

    It will work.

Maybe you are looking for

  • Open a new file and can't find anywhere?

    Tried to create a new folder called but it does not show anywhereHe tried again, I was told this folder already exists, but where?I tried with a different name and tha gone tooRenamed an existing folder and it disappeared! Help! someone ' one/somethi

  • Organize the Audiobook on Sansa Clip +.

    I'm relatively new to the Sansa Clip. I want to put an audio book on which has a set of 11 disks. I created a title on the drive under audio books. Now I want the title create 11, disk1, disk2, etc. subfolders, to copy the torn in each folder of s to

  • I paid money for something I thought was Windows Defender

    original title: Hello Over the weekend, I also had this Code for my window Defender. I could not activate or log in my Security Center. So I had to pay Itechbilling.com 79,95 usd / http://SPRTGW.COM I had this personal activation key you number: * ,

  • Troubé with Base64 and qCompress/qUncompress

    I need to compress and coded a QString in base 64. I wrote 2 methods for this task. These methods are: /* * Compress a QString and converts to Base 64 */ QString BlackBerry10Utils::compressAndBase64(const QString &paramString) { QByteArray byteArray;

  • Turn off Windows 8 license of a dead laptop

    Hello Some time ago I bought one license for Windows 8 be upgraded my old laptop to Windows 7.  Since my laptop exploded in a cloud of smoke and my hard drive was erased and refocused. However, I would install Windows 8 on my old XP laptop but it say