How to view all my views in a Database?

Hi there,
could any one tell me what's the command to display each of the following:
1. all views (SYstem and the user define ones)
2. all triggers (SYstem and the user define ones)
3. all procedures, (SYstem and the user define ones)
in the database?
TY

If you just want a listing, you can do this:
select owner, object_type, object_name
from   dba_objects
where  object_type in ('VIEW','TRIGGER','PROCEDURE');(you don't want to see functions or packages?)
If you want to see the code for these types, an easy way is to use the package dbms_metadata to display them:
SQL> select dbms_metadata.get_ddl('TRIGGER','ORDERS_TRG','OE') from dual;
DBMS_METADATA.GET_DDL('TRIGGER','ORDERS_TRG','OE')
  CREATE OR REPLACE TRIGGER "OE"."ORDERS_TRG" INSTEAD OF INSERT
ON oc_orders FOR EACH ROW
BEGIN
   INSERT INTO ORDERS (order_id, order_mode, order_total,
                       sales_rep_id, order_status)
               VALUES (:NEW.order_id, :NEW.order_mode,
                       :NEW.order_total, :NEW.sales_rep_id,
                       :NEW.order_status);
END;
ALTER TRIGGER "OE"."ORDERS_TRG" ENABLE

Similar Messages

  • How to export all the views in one schema?

    Hi,
    I have more than 1000 views in one shcema.
    How to export all the views in one schema?
    Amy

    Hi,
    It's not a very easy question, I have develop a script wich create a script to create view from old database to new database :
    /* &1: Oracle SID Source
    /* &2: Oracle Schema Source
    SET HEAD OFF
    SET VERIFY OFF
    SET PAGESIZE 0
    SET LONG 40000000
    SET LONGCHUNKSIZE 2000
    SET LINESIZE 2000
    SET FEEDBACK OFF
    CREATE TABLE RECREATE_VIEW(VIEW_NAME VARCHAR2(30), TEXT LONG);
    /* Selection du texte de la vue */
    DECLARE
    w_text long;
    w_text_debut long;
    w_text_column long;
    w_view varchar2 (30);
    w_schema varchar2 (8):='&2';
    CURSOR w_cursor IS
    SELECT a.view_name, a.text
    FROM dba_views a
    WHERE a.owner = w_schema;
    CURSOR w_column IS
    SELECT DECODE (ROWNUM,
    1, 'CREATE OR REPLACE FORCE VIEW ' || '&' || '1..'
    || a.table_name || chr(10)
    || '('
    || a.column_name
    || DECODE (ROWNUM, nbcolumns, ')' || chr(10) || 'AS' || chr(10), ',' || chr(10))
    FROM (select column_name,table_name
    FROM dba_tab_columns
    WHERE owner = '&1'
    AND table_name = w_view
    order by column_id ) a,
    (SELECT COUNT (1) nbcolumns
    FROM dba_tab_columns
    WHERE owner = '&1'
    AND table_name = w_view
    GROUP BY owner, table_name) b
    order by rownum;
    BEGIN
    OPEN w_cursor;
    LOOP
    FETCH w_cursor INTO w_view, w_text;
    EXIT WHEN w_cursor%NOTFOUND;
    w_text_debut := NULL;
    w_text_column := NULL;
    OPEN w_column;
    LOOP
    FETCH w_column INTO w_text_column;
    EXIT WHEN w_column%NOTFOUND;
    w_text_debut := w_text_debut || w_text_column || ' ';
    w_text_column := NULL;
    END LOOP;
    CLOSE w_column;
    w_text := w_text_debut||w_text||';';
    insert into RECREATE_VIEW(VIEW_NAME, TEXT) VALUES (w_view, w_text);
    COMMIT;
    w_text := NULL;
    w_view := NULL;
    END LOOP;
    CLOSE w_cursor;
    END;
    SPOOL scripts_views_&1..sql
    PROMPT SPOOL scripts_views_&1..log
    PROMPT
    SELECT TEXT
    FROM RECREATE_VIEW;
    PROMPT
    PROMPT SPOOL OFF
    PROMPT
    SPOOL off
    PROMPT /* Formattage du fichier SQL */
    !sed 's/[ ]*$//' scripts_views_&1..sql > aprilia.tmp
    !rm scripts_views_&1..sql
    !mv aprilia.tmp scripts_views_&1..sql
    DROP TABLE RECREATE_VIEW;
    EXIT
    I hope that help you.
    Nicolas.

  • How to display all tables residing in my database

    i'm using 10g express edition.
    i'm developing a .net application using oracle
    i want display table infomation in a datagrid
    for that i need to select tables fromthe database using the interface given by them
    in that i found server name field.....what it actually means?
    also how to create a new database in 10g and how to display all tables residing in the database?
    pls help me
    thanking u
    chaitanya

    user11359516 wrote:
    i want display table infomation in a datagrid
    select owner||'.'||table_name owner_table_name
      from all_tables   
    user11359516 wrote:in that i found server name field.....what it actually means?i'm not sute what you mean by server name field? if you refer to table column name see this code below:
    select owner||'.'||table_name||'.'||column_name table_column_name,
           decode(data_type,'VARCHAR',data_type||'('||to_char(data_length)||')',
                            'VARCHAR2',data_type||'('||to_char(data_length)||')',
                            'NUMBER',decode(data_scale,0,data_type||'('||to_char(data_precision)||')',
                                                      null,data_type,
                                                      data_type||'('||to_char(data_precision)||','||to_char(data_scale)||')'),
                            data_type) type,
                            nullable
      from all_tab_cols
    order by table_name, column_id

  • How to save all event viewer log files in Windows 7 Professional

    Hello,
    I would like to save all Event Viewer logs from my Windows 7 Professional computer and be able to view them from another computer.  Currently I can only save one log at a time.  Please let me know how I can save all Event Viewer logs
    (Windows Logs, Applications and Service Logs, etc.).
    Thanks,
    Jason

    Hi Jason,
    There is no idea to save all categories log.
    It's recommend you ask in Official Scripting Guys forum for further help:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
    Besides that, this thread could be referred:
    http://social.technet.microsoft.com/Forums/en-US/d66c1bd7-0e61-4839-a5f6-cbe29661dccb/how-to-use-script-saving-log-from-event-viewer-into-csv-file?forum=ITCG
    Karen Hu
    TechNet Community Support

  • How to backup all the views in a table

    I want export all the view in a schema.
    I used the below command:
    expdp A12/A12 schemas=USER INCLUDE=VIEW directory=pump_dir dumpfile=expdp_VIEW.dmp
    The command executed successfully but,
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/VIEW
    Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    It seems nothing have been backed up..
    I don't want to export specifically. Is there any way to upload all the views using export or any other way.
    Kindly help me..
    Thanks in advance
    nonuday

    Dean Gagne wrote:
    This job exported views. You would not have seen this line:
    Processing object type SCHEMA_EXPORT/VIEW
    If the views were not exported. What were you expecting to see.
    DeanYes, it even showed the export was successful, but the blocks size was 0kb.
    If I import the dump which I took with the *"include=view"* export command, will the views imported?
    And, can you please tell me when I googled about this it was mentioned *"Metadata of the objects(view,procedure,etc) will be exported"* can you explain it?
    Thanks in advance,
    Karthik

  • How to find all sql ran in the database for particular time

    Hi All,
    i need to find all sql ran in the database between 7am to 9am on may 22 2012 , i can generate AWR but i think it shows only top sql but i need all sql during this time
    is any views in oracle to get this information
    Thanks

    i need to find all sql ran in the database between 7am to 9am on may 22 2012 , i can generate AWR but i think it shows only top sql but i need all sql during this time use below view to get detail.
    V$active_session_history
    dba_hist_active_sess_history

  • How to truncate all the tables of my database

    hi guys
    I am using SQL Server 2012 , i need to delete all  the data present in my database .I mean i want to truncate all the tables in my database , so please suggest me the easiest way .

    If the tables are referenced by FK it will be failed.... 
    Basically you can use the below statetemnt
    DECLARE @TruncateStatement nvarchar(4000)
    DECLARE TruncateStatements CURSOR LOCAL FAST_FORWARD
    FOR
    SELECT
        N'TRUNCATE TABLE ' +
        QUOTENAME(TABLE_SCHEMA) +
        N'.' +
        QUOTENAME(TABLE_NAME)
    FROM
        INFORMATION_SCHEMA.TABLES
    WHERE
        TABLE_TYPE = 'BASE TABLE' AND
        OBJECTPROPERTY(OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
            N'.' +
            QUOTENAME(TABLE_NAME)), 'IsMSShipped') = 0
    OPEN TruncateStatements
    WHILE 1 = 1
    BEGIN
        FETCH NEXT FROM TruncateStatements INTO @TruncateStatement
        IF @@FETCH_STATUS <> 0 BREAK
        RAISERROR (@TruncateStatement, 0, 1) WITH NOWAIT
        EXEC(@TruncateStatement)
    END
    CLOSE TruncateStatements
    DEALLOCATE TruncateStatements
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • JDeveloper 11g: How to get all the rows of a database table from applicatio

    Hello all!
    I'm developing a application with JDeveloper 11g, like subject show.
    So, I'm suppose to use some data which are in database table.
    So, I had the View Object where I want take data, to the datamodel.
    And after this, I use this next line in my serviceClass.java:
    public String method(){
            String truc = null;
            getViewName().setRangeSize(-1);
            getViewName().setRangeStart(0);
            getViewName().executeQuery();
    //I do my treatment here
    return truc
    }When the application run, it stop just before the line "getViewName().setRangeSize(-1);"
    So, I think it is the locking point.
    Someone can help me.
    Thank's
    Nystan

    Hi,
    1. You work with a application module class and not in a plain old java object? So you create a application module or only a view object?
    2. If you work with a application module class. Can you switch on a bit of logging? To set the system debug output property, open the Run/Debug/Profile page in the Project Properties dialog for your data model project. Click Edit to edit the chosen run configuration, and add following string to the Java Options field in the page.
    -Djbo.debugoutput=console -Djbo.adflogger.level=FINE
    maybe you can see the error.
    Best regards
    Martin

  • How to import all Excel in Folder to database by SSIS?

    I have SQL Server 2012 and I would like to import Excel files data to Database.
    I have several files that end-users copy to folder.
    I never know files names or number of files in folder, but I know that structucture of data is same in every single file.
    How to create logic with SSIS that imports all files one by one?
    Kenny_I

    I replace to
    Dts.Variables("FileName").Value.ToString(). I'm still getting error:
    My code:
            Dts.TaskResult = ScriptResults.Success
            Dim CurrentDay As String
            CurrentDay = Now().ToString("yyyyMMdd")
            Dts.Variables("CurrentDayFile").Value = IIf(InStr(Dts.Variables("FileName").Value.ToString(), CurrentDay) > 0, True, False)
    Error:
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    Kenny_I

  • How to delete all users (objects) in 9i database?

    Hi friends:
    I did a full database exp/imp for a dev database, before imp, I need to delete all objects in the old dev database, I know delete one user is
    drop user user_name cascade;
    how about all users (objects)???? in 9i database
    thank you very much

    Hi,
    I will use
    select ' drop user ' ||username|| ' cascade;' from all_users where username not
    in ('SYS','SYSTEM', ‘DBSNMP’);
    Is there any other users I don't need to drop off besides the above three ones?
    thank you very much

  • How I load all the data in a database table into a cache?

    Hi
    Lets assume I have a lookup table I want to load it upfront into the cache so that the application can use this data from cache. One way is to write code to create a map from the database and call putALL. Is there any better approach to this?
    Another thing is if the data is more than 1 GB and if I construct a map of one GB before putting it into the cache the JVM might crash. The question is how do I distribute upront loading of the cache to multiple JVMs. Do I have to use invocation service or is there any thing out of box.

    I only use one JVMs and I use a distributed cache, the configuration XML file like this:
    <p> <distributed-scheme>
    <scheme-name>default-distributed</scheme-name>
    <service-name>DistributedCachestore</service-name>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <scheme-ref>example-read-write</scheme-ref>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
         <listener-scheme> </listener-scheme> 
         <autostart>true</autostart>
    </distributed-scheme>
    <read-write-backing-map-scheme>
    <scheme-name>example-read-write</scheme-name>
    <internal-cache-scheme>
    <local-scheme>
    <scheme-ref>default-eviction</scheme-ref>
    <high-units>50050</high-units>
    <low-units>40000</low-units>
    <expiry-delay>3600</expiry-delay> 
    </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <scheme-ref>example-cachestore</scheme-ref>
    </class-scheme>
    </cachestore-scheme>
    <read-only>false</read-only>
    <write-delay-seconds>0</write-delay-seconds>
    </read-write-backing-map-scheme>
    <!-- 
    CacheStore test definition 
    -->
    <class-scheme>
    <scheme-name>example-cachestore</scheme-name>
    <class-name>com.tangosol.examples.coherence.DBCrudStore</class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>cachec</param-value>
    </init-param>
    </init-params>
    </class-scheme></p>
    The data in my table will reach about 1000000+ and I want to load about 50000 into cache.
    Thanks.

  • Can't view all computers on a network

    I'm at a university and when I log onto my area network I get a list of some 1750 computers (up to IF-H, I lose everyting after IF-I to Z). Is there a way to view all, or view a subset? I can't access my department server without viewing J and above.
    K

    Here are some ideas and questions.
    1. Make sure that the DSL or cable modem is connected to the Snow's WAN port, not its LAN port.
    2. Are all 5 computers connecting to the network wirelessly, or are some connected via Ethernet? If via Ethernet, what is your network structure?
    3. Can all the computers not only "see" your network, but join it? (Does a check mark appear next to the correct network name in each computer's AirPort status menu?)
    4. Can both computers that can connect to the Internet do so simultaneously?
    5. Check the IP address of each computer when all are joined to your network. Do they all have the form "10.0.1.x"? This is expected if each is obtaining an IP address via DHCP from the base station.
    6. Are the balky computers MacBooks and/or MacBook Pros? Note that this month Apple came out with an AirPort Client Update for MacBook and MacBook Pro, which is intended to address an AirPort performance issue while running on battery power under Mac OS X 10.5.8.

  • How to see all tables in a database

    I need to view all the tables in a database.
    What is the statement query to do that?
    Please help..

    http://www.praetoriate.com/t_garmany_easysql_the_data_dictionary.htm
    select * from all_tables;
    select * from user_tables;
    select * from dba_tables;

  • How to show all view tab (Main Report and all Sub Report) in Visual FoxPro 9

    I use ActiveX from Crystal Report Developer XI for viewer in Visual FoxPro 9 and I already know how to show Main Report by using command:
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=thisform.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    Inside the MyReport.rpt there is two subreport name :
    1. MySubReport1
    2. MySubReport2
    My Question is :
    How to show all view tab (Main Report and all Sub Report) at the 1st time we call ViewReport?
    I try to using command :
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=thisform.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptSub=oRptOpen.OpenSubreport("MySubReport1")
    oRptSub=oRptOpen.OpenSubreport("MySubReport2")
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    but only show Main Report (view tab name : Preview)?
    Did I miss any command before I call oRptView.ViewReport?

    Your right, there is only one tab to view the report.
    To open the subreports you will need to click on them in the main report. I don't know of a way to open them programmatically like you are doing here
    http://diamond.businessobjects.com/robhorne</a>

  • How can I view all my apple map pushpin Points of Intrest and pictures at once?

    Been trying to find a way to view all my Apple Maps Points of Interest pushpins all at once on the map screen.  As I drive along routing, or when I zoom in and out of map areas.  Saved bookmarks shows a long list, but I can't figure out how to just view all the pushpins on the map, so I can access my favorite locations and notes as I drive or plan a trip. 
    Maybe create a map pushpin folder to save only pictures related to the saved map bookmarks.  And save on phone or skydrive?  I still just go by memory.  But the list, notes and scenes are getting really numerous.  RV campsites, fishing, biking, skiing, services, phone signal, shopping, wifi, laundry, jobs, pictures, and much more. 
    I have an old HP mini that I like and use with my iphone 4.  Have no interest or extra money to be upgrading my devices every time the software/bloatware updates overload otherwise perfectly good phones and laptops.  Hope to be able to share with others how to have their phones and computers work for them, instead of the other way around. 
    Might stay with iPhone and even buy an ipad if they become more univerally compatible, or switch to all windows devices.  Not too happy with PCs bloatware programming these days either.  My old windows 98 laptop runs some really powerful programs.  Wonder how many people would buy Jeeps and such vehicles, if they could not easily drive them on regular city streets or highways?
    first posting in online support community in 15 years.  Home powered by Solar these days.  Can even park next to a street light and charge batteries.
    Thanks for reading and any useful info.  will try not to lose my login info

    Been trying to find a way to view all my Apple Maps Points of Interest pushpins all at once on the map screen.  As I drive along routing, or when I zoom in and out of map areas.  Saved bookmarks shows a long list, but I can't figure out how to just view all the pushpins on the map, so I can access my favorite locations and notes as I drive or plan a trip. 
    Maybe create a map pushpin folder to save only pictures related to the saved map bookmarks.  And save on phone or skydrive?  I still just go by memory.  But the list, notes and scenes are getting really numerous.  RV campsites, fishing, biking, skiing, services, phone signal, shopping, wifi, laundry, jobs, pictures, and much more. 
    I have an old HP mini that I like and use with my iphone 4.  Have no interest or extra money to be upgrading my devices every time the software/bloatware updates overload otherwise perfectly good phones and laptops.  Hope to be able to share with others how to have their phones and computers work for them, instead of the other way around. 
    Might stay with iPhone and even buy an ipad if they become more univerally compatible, or switch to all windows devices.  Not too happy with PCs bloatware programming these days either.  My old windows 98 laptop runs some really powerful programs.  Wonder how many people would buy Jeeps and such vehicles, if they could not easily drive them on regular city streets or highways?
    first posting in online support community in 15 years.  Home powered by Solar these days.  Can even park next to a street light and charge batteries.
    Thanks for reading and any useful info.  will try not to lose my login info

Maybe you are looking for

  • Managing Document Status at Original Document Levels

    Hi dms gurus, i know that we can manage the document at DIR level through the status, and create new versions of documents where the old version is kept with no change allowed. However, in the version how one can esily know what changes been done to

  • Error while strarting up DB

    We planned to upgrade DB to 11.2.0.4 In test DB, we took back up and deleted few old datas which was not used. At the time of restore we created some directories manually and moved the files like datafiles etc. Initially i changed the paths  directly

  • Lightroom 4.0 - Two Months and still NO FIX!

    It has been over two months since the release of LR 4.0. From the start there were problems. The main issue is performance.  See http://forums.adobe.com/thread/971581?start=0&tstart=0  Over a month ago the second RC was released to address many of th

  • Iweb 08 removing photos from photo page upon save

    I am running into a peculiar bug in iweb. I have a working iweb site with mostly photo or movie pages. Was in updating the iweb site on my new MBP late 2008 adding in a new photo page. 1) added new photo page and renamed 2) dragged ~8 photos from iph

  • LDB files in ORACLE database ?

    Hi Experts. What is meant by LDB files referring to ORACLE database? Any idea on this. Thanks in advance.