How to find Oracle script in the database

Hi,
I've an Oracle instance with Fine Grained Auditing (FGA).
In this DB was created a series of policies and now I want to find the scripts created for insert it in another database.
for example:
dbms_fga.add_policy (
.....................How can I find this SQL script from this database?
I have also export dmp file
Must I use TOAD for export the objects?
Thanks in advance!

you'll need to use datapump export/import for this, see the example below:
Create fga policy TEST_POLICY on table scott.emp
SQL> exec dbms_fga.add_policy(object_schema => 'SCOTT',object_name => 'EMP',policy_name => 'TEST_POLICY');
Show fga policy in the db
SQL> select * from DBA_AUDIT_POLICIES where policy_name = 'TEST_POLICY';
OBJECT_SCHEMA                  OBJECT_NAME                    POLICY_OWNER
POLICY_NAME                    POLICY_TEXT          POLICY_COLUMN                  PF_SCHEMA
PF_PACKAGE                     PF_FUNCTION                    ENA SEL INS UPD DEL AUDIT_TRAIL  POLICY_COLU
SCOTT                          EMP                            OPS$ORACLE
TEST_POLICY
                                                              YES YES NO  NO  NO  DB+EXTENDED  ANY_COLUMNS
Now export the metadata for the objects
[oracle@mr-blonde 11.2.0]$ expdp / dumpfile=testpolicy.dmp directory=DATA_PUMP_DIR content=METADATA_ONLY SCHEMAS='OPS$ORACLE,SCOTT'
Export: Release 11.2.0.1.0 - Production on Mon Mar 29 11:22:25 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  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
FLASHBACK automatically enabled to preserve database integrity.
Starting "OPS$ORACLE"."SYS_EXPORT_SCHEMA_01":  /******** dumpfile=testpolicy.dmp directory=DATA_PUMP_DIR content=METADATA_ONLY SCHEMAS=OPS$ORACLE,SCOTT
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/FGA_POLICY
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Master table "OPS$ORACLE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
Dump file set for OPS$ORACLE.SYS_EXPORT_SCHEMA_01 is:
  /app/oracle/admin/CS11G/dpdump/testpolicy.dmp
Job "OPS$ORACLE"."SYS_EXPORT_SCHEMA_01" successfully completed at 11:23:46
Now to drop the policy
SQL> exec dbms_fga.drop_policy (object_schema => 'SCOTT',object_name => 'EMP',policy_name => 'TEST_POLICY');
PL/SQL procedure successfully completed.
Now checking that the policy is really gone
SQL> select * from DBA_AUDIT_POLICIES where policy_name = 'TEST_POLICY';
no rows selected
Now to import the policy back into the db from the data pump export taken earlier
[oracle@mr-blonde 11.2.0]$ impdp / dumpfile=testpolicy.dmp directory=DATA_PUMP_DIR include=FGA_POLICY
Import: Release 11.2.0.1.0 - Production on Mon Mar 29 11:27:16 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  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
Master table "OPS$ORACLE"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "OPS$ORACLE"."SYS_IMPORT_FULL_01":  /******** dumpfile=testpolicy.dmp directory=DATA_PUMP_DIR include=FGA_POLICY
Processing object type SCHEMA_EXPORT/TABLE/FGA_POLICY
Job "OPS$ORACLE"."SYS_IMPORT_FULL_01" successfully completed at 11:27:21
Checking that the fga policy has been imported successfully
OBJECT_SCHEMA                  OBJECT_NAME                    POLICY_OWNER                   POLICY_NAME                    POLICY_TEXT
POLICY_COLUMN                  PF_SCHEMA                      PF_PACKAGE                     PF_FUNCTION                    ENA SEL INS UPD DEL
AUDIT_TRAIL  POLICY_COLU
SCOTT                          EMP                            OPS$ORACLE                     TEST_POLICY
                                                                                                                            YES YES NO  NO  NO
DB+EXTENDED  ANY_COLUMNS

Similar Messages

  • How to find out  Locks on the database objects

    how to find out Locks on the database objects

    The following notes should be helpful:
    Note: 200590.1 - bde_session_locks.sql - Locks for given Session ID
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=200590.1
    Note: 1039273.6 - SCRIPT: VIEWING LOCKS ON OBJECTS HELD BY SPECIFIC USER
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1039273.6
    You can also search Metalink, there are many notes/scripts published there which would be also helpful.

  • How to find communication channels in the database

    Hello,
    how can I find communication channels in the database? Exists here a webservice or a template to read them out automatically? Has anyone here an idea or experience with it?
    Thanks in advance,
    kind regards,
    Peter Mueller

    Hi stephan,
       In XI all the intrgration logic will be stored as Design time objects(Integration Objects) and Runtime objects (Integratin Directory).So there wont be any specific tables that store all of them .But XI holds them in CACHEs called CPA caches and there are different caches too.
    Tables in XI
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/xi+tables
    For caches:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1a69ea11-0d01-0010-fa80-b47a79301290
    Important Tcodes
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/xiTransactionCodes
    Thanks,
    Ram.

  • How to find affected tables in the database

    Hi Friends,
    Is there any way to find the tables affected in the database when book a trade in the Application in Oracle. Please help me to find the affected tables.
    Thanks,
    ragu.
    Edited by: user533548 on Apr 3, 2009 5:08 AM
    Edited by: user533548 on Apr 3, 2009 5:13 AM

    Hi Karthick_Arp,
    You take any application for example when you book details about a new employee the rows will be affected in the database we generally use the empid to identify
    what are the tables affected is there any way like this when you book a trade in the Application to find what are all the tables affected in the database.I think that
    you have understand my question.
    Thanks,
    ragu.
    Edited by: user533548 on Apr 3, 2009 5:09 AM
    Edited by: user533548 on Apr 3, 2009 5:13 AM

  • How to find Responsibility through which the user has logged in to Disco.

    Hi All,
    I have got a requirement to create a "Usage Report Summary by Responsibility" for all Oracle user having an Access to Oracle Disco Viewer.
    In the report, I need to show the list of Oracle Users and the Responsibilities through which an User has logged in to Disco Viewer.
    Kindly help me in finding the corresponding Disco tables to full-fill this requirement.
    Available Information/queries in my Hand:
    1. Query to find the list of Workbook and its shared Responsibilities
    2. Query to find number of times an Oracle Disco Report has been run.
    Thanks a ton in Advance
    Arun

    Hi Arun
    The first place to look is to try running one of the pre-built workbooks created by Oracle for this purpose.
    I see you are working in Apps mode. Therefore, you'll need to run both of these scripts when logged in as the owner of the EUL:
    1. EUL5.SQL
    2. EUL5_APPS.SQL
    You will find both scripts in the $ORACLE_HOME/Discoverer/Util folder where your Discoverer Administrator tool is located.
    Next, you will need to log into the Administrator tool and import this EEX file: EUL5.EEX
    You will find the EEX file located in $ORACLE_HOME/Discoverer, again on the PC where Discoverer Administrator tool is located.
    After you have imported the EUL, log into Desktop or Plus and open up the EUL5 workbook that you will now see in the list and work through the various worksheets. You should find one or two that will give you what you want.
    Let us know how you get on
    Best wishes
    Michael
    http://ascbi.com

  • How to search a string from the database?

    how to search a string from the database? starting with some character

    If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
    Here's an Example
      SELECT obj_name FROM tadir
        INTO prog
        WHERE pgmid = 'R3TR'
          AND object = 'PROG'
          AND obj_name LIKE 'Z%'.
    In this case it will select every row that obj_name starts with Z. 
    If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
    Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

  • How to know which table in the database a form is accessing

    Actually Im new to oracle applications,
    Im getting an error when i open a form from system administrator responsibility saying that table doesnot exist.
    My basic doubt is, how to know which table in the database a form is accessing.
    Any response is higly appreciated.
    Thanks,
    Praveen
    Edited by: user10239520 on Sep 10, 2008 7:07 AM

    Take a look at the following thread:
    Is there a query log in EBS?
    Re: Is there a query log in EBS?

  • How to change a connection with the database in Runtime?

    How to change a connection with the database in Runtime?
    My connection was made using ADF Business component (ApplicationModule).
    ADF Swing.
    JDeveloper Studio 11.1.1.4.0.

    When deploying ADF applications with database connection, you should be using JDBC data sources configured in the weblogic server.
    You could change the JDBC data sources to a different DB instance or location - by changing the JDBC data source and restarting the weblogic server.
    For more details, check
    http://techiecook.wordpress.com/2010/12/02/oracle-weblogic-adf-datasources/
    Thanks,
    Navaneeth

  • How to debugg a script when the Required out put is like Fax  or email

    Hi this is Durga Prasad i have small doubt in scripts can any one clarify that one plz  normally we will do that one with activating debugger but when a special requirement is like fax or e mail    how we will do that one
    "how to debugg a script when the Required out put is like Fax  or email"
    Thanks in advance
    Durga Prasad.

    Hi
    DEBUG Smartform:
    1) One way to debug smartform is to debug the Function Module of that smartforms.
    If you want to debug particular smartform node that the solution would be,
    insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint.
    So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
    2) SFTRACE can be used for debugging SMARTFORMS.
    Read More here.
    http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    script
    1). Use Tools - Word Processing - Layout Set (SE71). Enter name of layout set and then Utilities - Activate Debugger.
    It is of no consequence which layoutset you enter when selecting the SAPscript debugger. (Menu path: Tools-Wordprocessing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger.
    2). Another way to set the SAPScript debugger is to run program RSTXDBUG.
    When you debug Print program it is same as you debug any other ABAP program. While when you debug SAPScript, you actually debug the code ( scripting) you have written SAPScript Form.
    As per ur question there is nothing new with script debugging,
    it is same as normal report debugging...
    SMARTFORMS DEBUGGING
    For smartforms debugging you can do this.
    1. Execute the smartform (execute button in SMARTFORMS transaction)
    2. Take the generated function module and display it in SE80.
    3.Find the smartforms Elements (text elements, windows, code lines, loops) in this and set Soft break points.
    Correct name is SMARTFORM_TRACE. You have lots of options for adequate analysis
    Tcode - SFTRACE
    Re: How to Debug a Smartform
    Debug of smartform and sapscript.
    Debugging SmartForms
    Debugging of a subroutine pool.
    SCRIPT
    There are 2 separate kinds of debugging available when you try to debug scripts.
    1. Debugging the print program : This is the normal debugging we do for our report programs.
    2. Debugging the script itself : You Can debug a SAP Script by activating debugger in two ways:
    a .In SE71->Menu->Utilities->Activate Debugger, then debugger will be get activated and when your print program is executing Script Debugger will be in active and you can proceed with your debugging.
    b. Goto se38-> RSTXDBUG ->Execute this same as going thru in se71-> Menu, now debugger will be activated.
    refer to the link below
    http://www.howforge.com/how-to-debugging-sapscript-form
    Look at the BLOG here, it is well explained
    /people/sudheer.junnuthula2/blog/2007/01/09/script-debugging
    Regards
    Anji

  • How to find oracle archieved products

    Hi
    I want to download Oracle Forms 6i for all OS(Vista). here is a link http://www.oracle.com/technology/products/forms/index.html which everybody say we can find Oracle Forms6i. But i feel that now its difficult to find archieved products. If any body has info on how to find Oracle forms 6i download link please reply.
    thanks a lot

    Oracle Forms 6i (6.0.8) is obsolete and no longer supported. It was also never certified to be installed on Vista or any of the newer OSs. The likelihood that you will experience problems installing on those platforms is quite high and is not recommended. That said, if you really would prefer to use an obsolete product you can still download it for a limited time here:
    http://www.oracle.com/technology/software/products/forms/htdocs/winsoft.html
    I do not know how long this URL will remain available as we are slowly cleaning up all of the old references to now unsupported products.

  • How to find workarea ID for the work area name.

    Hi Experts..
    How to find workarea ID for the work area name.(Work area name CCIHT_WAH-WAID and I want to fetch characteristic data from table AUSP matching the OBJEK field,but I only have Work area name).Can anybody help me to find tables or relationship between Workarea ID and Workarea name for the same.I am using TCODE - CHIB02.Once I select a workarea and click on IHS Data button,I get data for that workarea.I need to find where this data comes from and How is this fetched.
    Points would be rewarded for helpful answers..
    Thanks
    Kunal Halarnakar

    U want to fetch the workarea description ?
    we can fetch it from CCIHT_WALD table with the RECN value.
    The informations are stored in AUSP table with the characterstic(ATINN) value.

  • How to find out what are the functions supported by string class

    Hi,
    Can any one let me know how to find what are all the functions supported by the string class in standard(STL) library on solaris.
    Regards,
    Vignesh

    1. Any C++ textbook that covers the Standard Library will tell you about the standard string class. A good tutorial and reference for the entire Standard Library is "The C++ Standard Library" by Nicolai Josuttis, published by Addison Wesley.
    2. WIth Sun C++, the command
    man -s3C++ basic_string
    provides documentation for the default libCstd version of the Standard Library.
    3. You could look at the <string> header itself. I don't recommend that approach.

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

    You don't.
    If you forgot or lost the password, all you can practically do is reset it.
    The manner in which you do so depends on what version of OS X you are running. The older versions utilize the reset password utility on your recovery/re-installation disk/drive.
    On Lion, you use the following technique to reset the Administrators password:
    Boot to your Lion Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.

  • How to save a fmb in the database thru command prompt?

    Hi,
    How to save a fmb in the database thru command prompt?
    I have around 25 fmb template files which needs to be saved in the database.Every time when we apply the new dump , we need to resave the templates in the database to compile other application related fmb files.Its a time consuming process and Monotonous for me. Is there anyway to save the forms in the database thru batch file, so that just I have to execute the batch file every time.
    Expecting your earliest feedback.
    Thanks & Regards,
    G.S -
    [email protected] / [email protected]

    Hi Frank,
    Thanks for your feeback.
    I am using forms6i.Basically our application was migrated from 4.5 to 6i two years back. Due to some reasons our technical team members are insisting us to store the template FMB's into the database to do the coding activities at site.
    Once in a month we are receiving the live dump for test database.Hence the problem.
    Please suggest the easiest way to store the template FMBs in the database.
    Thanks & Regards,
    G.S

  • How to find latest entry in the table according to time

    how to find latest entry in the table according to the time
    is there any function module to do so
    \[removed by moderator\]
    Regards
    Shashi
    Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PM

    Hi,
    If you want to read the entry from an internal table,
    sort the internal table in the descending order by the time and
    delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
    Suggestion: instead of only time try to have one more field called date with the time combination
    Regards,
    Ramesh

Maybe you are looking for

  • Failed to start Oracle Weblogic Server node in 11g

    Hello friends, I have a problem starting the Weblogic Server node Oracle 11g (10.3.5). Any suggestions to solve the problem Logs---------------------------------------------------------------------------------- <Nov 3, 2011 12:33:03 PM> <INFO> <NodeM

  • OTF files to PDF convertion

    Hello I would like to know if it is possible to convert received OTF files to PDF with SAP NetWeawer? I have received som OTF files, which I need printet - so therefore I would like to convert them to some printformat that my own printer accepts! If

  • Can I isolate part of a shape path to simplify if?

    Hello, I want to simplify part of a complex shape.  Is it possible to isolate part of a shape path and simplify it, leaving the rest of the shape with the original number of anchor points? Thank you

  • Magic mouse is not allowing me to use all the features

    I just got this mouse and the computer yesterday 02/18/10. I'm unable to scroll from left to right nor the other feature I thought I should be doing with the mouse. I'm new to macs so all this is a little confusing. Do I have the correct software tha

  • Read Objects EOF

    I am trying to read object from a file into a linked list, but i keep getting a EOFException when it reaches the eof, i have tred a while loop but still the exception gets thorw, whats the best way of stoping reading once eof is read without throwing