<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Oracle sqlplus script for listing dba_views... Want compete text. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184225#M795763</link>
    <description>hi Jack,&lt;BR /&gt;&lt;BR /&gt;try these:&lt;BR /&gt;&lt;BR /&gt;getaview gets one view to a file named "viewname.sql"&lt;BR /&gt;&lt;BR /&gt;--------------- getaview.sql ------------------------&lt;BR /&gt;set heading off&lt;BR /&gt;set feedback off&lt;BR /&gt;set linesize 1000&lt;BR /&gt;set trimspool on&lt;BR /&gt;set verify off&lt;BR /&gt;set termout off&lt;BR /&gt;set embedded on&lt;BR /&gt;set long 50000&lt;BR /&gt;&lt;BR /&gt;column column_name format a1000&lt;BR /&gt;column text format a1000&lt;BR /&gt;&lt;BR /&gt;spool &amp;amp;1..sql&lt;BR /&gt;prompt create or replace view &amp;amp;1 (&lt;BR /&gt;select decode(column_id,1,'',',') || column_name  column_name&lt;BR /&gt;  from user_tab_columns&lt;BR /&gt; where table_name = upper('&amp;amp;1')&lt;BR /&gt; order by column_id&lt;BR /&gt;/&lt;BR /&gt;prompt ) as&lt;BR /&gt;select text&lt;BR /&gt;  from user_views&lt;BR /&gt; where view_name = upper('&amp;amp;1')&lt;BR /&gt;/&lt;BR /&gt;prompt /&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;set heading on&lt;BR /&gt;set feedback on&lt;BR /&gt;set verify on&lt;BR /&gt;set termout on&lt;BR /&gt;---------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To get all views in a schema, you could use getallviews.sql:&lt;BR /&gt;&lt;BR /&gt;------------ getallviews.sql ------------------------------&lt;BR /&gt;&lt;BR /&gt;set heading off&lt;BR /&gt;set feedback off&lt;BR /&gt;set linesize 1000&lt;BR /&gt;set trimspool on&lt;BR /&gt;set verify off&lt;BR /&gt;set termout off&lt;BR /&gt;set embedded on&lt;BR /&gt;&lt;BR /&gt;spool tmp.sql&lt;BR /&gt;select '@getaview ' || view_name&lt;BR /&gt;from user_views&lt;BR /&gt;/&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;set termout on&lt;BR /&gt;set heading on&lt;BR /&gt;set feedback on&lt;BR /&gt;set verify on&lt;BR /&gt;@tmp&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
    <pubDate>Sat, 07 Feb 2004 01:08:40 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2004-02-07T01:08:40Z</dc:date>
    <item>
      <title>Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184221#M795759</link>
      <description>Anybody got a sqlplus script for dumping the database views for a particuler owner.  I wan't to keep a snapshot of all views for an owner that can be compared to other databases.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2004 10:46:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184221#M795759</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-05T10:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184222#M795760</link>
      <description>select owner, name, text from dba_views will get you the structure to recreate the view.  But since the text column is a long it's a pain to work with.  But you might want to look into buying TOAD from QUEST.  Software &lt;A href="http://www.quest.com." target="_blank"&gt;www.quest.com.&lt;/A&gt;  This costs about $700 and it's a great little tool.  It has other add ons you can buy.  You can export the source code to recreate any database object you want.  Or all the objects for a specific user.  You can also run a compare on schemas with this tool.  or a file compare.  But I think this would do exactly what you want and more.  Heck you could even just download a free trial version for a month and do this to see if it's what you want.</description>
      <pubDate>Thu, 05 Feb 2004 11:01:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184222#M795760</guid>
      <dc:creator>Brian_274</dc:creator>
      <dc:date>2004-02-05T11:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184223#M795761</link>
      <description>Not really into buying more tools.   Here's something that will work.&lt;BR /&gt;&lt;BR /&gt;-- --------------------------------&lt;BR /&gt;set echo off &lt;BR /&gt;SET head OFF &lt;BR /&gt;SET verify OFF&lt;BR /&gt;SET feedback OFF&lt;BR /&gt;SET newpage 0&lt;BR /&gt;SET pagesize 0&lt;BR /&gt;set long 30000;&lt;BR /&gt;&lt;BR /&gt;select 'CREATE OR REPLACE VIEW ' || OWNER || '.' || VIEW_NAME || ' AS ' , text , ';' &lt;BR /&gt;from dba_views &lt;BR /&gt;where owner = 'MSDDBA' &lt;BR /&gt;ORDER BY view_name asc;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-- --------------------------------&lt;BR /&gt;&lt;BR /&gt;I'll likely spool the output for compares.&lt;BR /&gt;&lt;BR /&gt;thanks... jack...</description>
      <pubDate>Thu, 05 Feb 2004 11:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184223#M795761</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-05T11:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184224#M795762</link>
      <description>I understand.  I hate gui tools also.  But toad is a great low cost tool that will pretty much do anything you'd ever want.</description>
      <pubDate>Thu, 05 Feb 2004 13:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184224#M795762</guid>
      <dc:creator>Brian_274</dc:creator>
      <dc:date>2004-02-05T13:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184225#M795763</link>
      <description>hi Jack,&lt;BR /&gt;&lt;BR /&gt;try these:&lt;BR /&gt;&lt;BR /&gt;getaview gets one view to a file named "viewname.sql"&lt;BR /&gt;&lt;BR /&gt;--------------- getaview.sql ------------------------&lt;BR /&gt;set heading off&lt;BR /&gt;set feedback off&lt;BR /&gt;set linesize 1000&lt;BR /&gt;set trimspool on&lt;BR /&gt;set verify off&lt;BR /&gt;set termout off&lt;BR /&gt;set embedded on&lt;BR /&gt;set long 50000&lt;BR /&gt;&lt;BR /&gt;column column_name format a1000&lt;BR /&gt;column text format a1000&lt;BR /&gt;&lt;BR /&gt;spool &amp;amp;1..sql&lt;BR /&gt;prompt create or replace view &amp;amp;1 (&lt;BR /&gt;select decode(column_id,1,'',',') || column_name  column_name&lt;BR /&gt;  from user_tab_columns&lt;BR /&gt; where table_name = upper('&amp;amp;1')&lt;BR /&gt; order by column_id&lt;BR /&gt;/&lt;BR /&gt;prompt ) as&lt;BR /&gt;select text&lt;BR /&gt;  from user_views&lt;BR /&gt; where view_name = upper('&amp;amp;1')&lt;BR /&gt;/&lt;BR /&gt;prompt /&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;set heading on&lt;BR /&gt;set feedback on&lt;BR /&gt;set verify on&lt;BR /&gt;set termout on&lt;BR /&gt;---------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To get all views in a schema, you could use getallviews.sql:&lt;BR /&gt;&lt;BR /&gt;------------ getallviews.sql ------------------------------&lt;BR /&gt;&lt;BR /&gt;set heading off&lt;BR /&gt;set feedback off&lt;BR /&gt;set linesize 1000&lt;BR /&gt;set trimspool on&lt;BR /&gt;set verify off&lt;BR /&gt;set termout off&lt;BR /&gt;set embedded on&lt;BR /&gt;&lt;BR /&gt;spool tmp.sql&lt;BR /&gt;select '@getaview ' || view_name&lt;BR /&gt;from user_views&lt;BR /&gt;/&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;set termout on&lt;BR /&gt;set heading on&lt;BR /&gt;set feedback on&lt;BR /&gt;set verify on&lt;BR /&gt;@tmp&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Sat, 07 Feb 2004 01:08:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184225#M795763</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-02-07T01:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle sqlplus script for listing dba_views... Want compete text.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184226#M795764</link>
      <description>Nice :)   Thanks...</description>
      <pubDate>Sun, 08 Feb 2004 10:15:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-sqlplus-script-for-listing-dba-views-want-compete-text/m-p/3184226#M795764</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-08T10:15:38Z</dc:date>
    </item>
  </channel>
</rss>

