Deliver the object make concession DDL

So, I am trying to extract the DDL for the object for a user grants in my 11 g database by using a call to DBMS_METADATA. GET_GRANTED_DDL ('OBJECT_GRANT' [...]
I note that the data that comes out is a sizeable CLOB which must be broken. I tried to use DBMS_OUTPUT. PUT, PUT_LINE, instead it goes off on length, so I had to resort to my strategy of rupture with PUT_LINE CLOB and manually inspecting the huge output for lines that are poorly distributed.

The code that I mainly use looks like:
set head off
set pagesize 0
set trimspool on
set long 999999
set feedback off
set serveroutput on size unlimited
set echo off
set linesize 1000
set timing off

spool create_user_MYCLIENT.sql

declare
  v_length int;
BEGIN
    for d in (
      SELECT replace(DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','MYCLIENT'),'"'||chr(10),'";'||chr(10))||';' DDL
      FROM DUAL
      where exists(select 'x' from dba_tab_privs drp where drp.grantee='MYCLIENT')
      ) loop --lines
      -- break up CLOB lines that are too long for dbms_output.put_line
      v_length := dbms_lob.getlength(d.DDL);
      for i in 0..((v_length/32000))
      LOOP --CLOB sub-parts
        dbms_output.put_line(dbms_lob.substr( d.DDL, 32000, (i*32000)+1) );
      end loop; --CLOB sub-parts
    end loop; --lines
end;
/

spool off
At some point in the output file, you get things like:
  GRANT SELECT ON "MYUSER"."MYTABLE" TO "MYCLIENT";
GRANT INSERT ON "MYUSER"."MYTABLE" TO "MYCLIENT";
GRANT DELETE ON "MYUSER"."MYTABLE" TO "MYCLIENT";
GRANT UPDAT
E ON "MYUSER"."MYTABLE" TO "MYCLIENT";
It ruins the ability to simply run this script without manual inspection and fixing.

Is there a way to get around this? I wish I could call DBMS_METADATA. GET_GRANTED_DDL in a loop for each subject of the grant, but I have not seen a way to do that no matter where.

Or is there a cunning fancy I can pull to break up my CLOB more effectively?

Any help would be greatly appreciated.

PS. I realize that my cheque for loop and existence of cursor seem redundant, but this example comes from a longer script users that I was working that works with the system of subsidies, grants of role and multiple users.

>
It ruins the ability to simply run this script without manual inspection and fixing.

Is there a way to get around this? I wish I could call DBMS_METADATA. GET_GRANTED_DDL in a loop for each subject of the grant, but I have not seen a way to do that no matter where.
>
But it's only because your code is bug. The round it is to fix your code.

There are a lot of thread on the net to use UTL_FILE to write CLOB in the file system. Take a look at this one.
Writing CLOB to deposit using UTL_FILE

You can also use the package DBMS_XSLPROCESSOR CLOB2FILE procedure - this procedure writes the content of a CLOB in a file.

This thread has an example
Write a CLOB variable in a file in the log file

here is an example to load from clob to file

declare
....
begin
  FOR c IN csr
  LOOP
    l_clob := DBMS_METADATA.get_ddl (c.object_type,c.object_name,c.owner);
    dbms_xslprocessor.clob2file(l_clob,'DIR',c.object_name||'fun.sql');
  end loop;
.....
end;

These methods are documented on the site Web of Dan Morgan
http://www.morganslibrary.org/HCI/hci004.html

Tags: Database

Similar Questions

  • Deliver the Photoshop files with library objects

    Is it possible to deliver a customer a final PSD that uses dynamic objects related to cloud? I don't want to share the entire library with the client, because they do not have CC and so not access Adobe Cloud. There are also cases where using an element or two of other libraries, I don't want to share during the delivery. Deliver the files without the library leads to non editable smart objects (broken link error open document). Others that the conversion of files embedded or linked individually, layer by layer, is there a way to incorporate or to export the library files that are used in a document to be supplied as well as the final PSD overall?

    Choose: Layer > smart objects > incorporate all related

    I hope this helps.

  • How to make the object move like mice

    I am now getting a... augmented reality project and I used flash to do this system... my system Maker use face detection and the object as a mouse cursor... means the object moves when the face moves in front of the camera... now I can do it... but I can't do this movement of the object in the frame of the flash... move only in the frame... now I would like to ask how I want to object to move out of the frame... like going inside the computer and can click on any folder (average control the computer as mouse). can someone help me?

    You cannot control the mouse of the user outside the flash scene (thankfully), and I don't think you can detect the user with their mouse off the stage with a not installed (that is to say, projector or air) flash application.

  • How can I make a button that presses that the object appears and the second press the object disappear

    Hello

    I'm quite new to flash programming, and I don't know how I can make a button that will make the object appear and disappear. Up to now, I have this code for calling:

    (press)

    {

    _root.top1.gotoAndStop (2);

    _root. Topp.gotoAndStop (2);

    _root. MM1.gotoAndStop (2);

    _root. M1.gotoAndStop (2);

    }

    but where I'm stuck.

    Thank you for your help

    What you can do, it's the object _visible property allows you to appear and disappear, or more correctly, use the _visible property opoosite.  You should not put the code 'on' objects, keep it in the timeline.

    If the 'object' is the name of the instance of the object you want to fail over, and then in the code to the timeline you can use...

    Object._visible = false;  First, the object is invisible

    yourButtonName.onRelease = function() {}

    Object._visible =! object._visible;

    }

    Only one line in the function sets _visible to be opposite of what it currently is.

  • Page number: make the objects to stay

    Hello, I am working on a dress up game and I have a problem with it. There are so many articles of clothing (which are video clips with drag and drop code base) that I had to create different pages for them. I have buttons (labeled as "dresses", "pants", etc.) that appear when you click on make this group of items. So very well. It's just that when an item is dragged over to the doll and set up, I want to stay here. But as soon as you click on another page, the point disappears. Is it possible to do items remain on the doll, even if they are part of a page?

    Here is an example of a game that does what I want: see how you can drag a dress on the doll, go to 'underwear' and the dress is still there? That. xD


    http://savivi.deviantart.com/art/soulless-Victorian-dress-up-137124180

    If you are using AS3 you reparenting the object using something in the sense of... dollMC.addChild (droppedObject). If you need to manage the positioning by.  If the doll had the same saving compared to the scene as the pages location, then you wouldn't need to adjust when occurs the addChild.

  • A tap above an object can be used to make the clip through the object?

    A tap above an object can be used to make the clip through the object?  So that transparency can see through the object.


    I have a square that has a line above it.  I would like to see the transparent background behind the square in the area occupied by STROKE. Example below:

    Transparent.jpg

    I would like the white area (which was created using the Brush tool and applying a stroke) to display the transparent background behind the red square - or whatever that fall behind the place.


    I have read and tried many tutorials and suggestions on the forum without success. (Group of knockouts, mask opacity, etc...)  I even created a much simpler red square with an accident stroke by default and still unable to get transparency through red square.


    I'm probably just missing something.


    Is this possible using a stoke?  Anyone able to help?


    Thank you

    -Chris

    Or:

    Stroke (s) select 0) and Ctrl + G for group races if more than one,

    (1) with the stroke (s) selected object > decompose the aspect, and

    (2) with all selected Pathfinder > Subtract from shape area / less Front according to version.

  • Make the display of the object performance stick?

    Is it possible to make the object to show stick performance level? I have some logos that sounds weird to typical display, so I changed their object-> display-> display of high quality performance.  Only I can't find a way to save this configuration (when I save and reopen the document, they started setting usage view).  Is it possible to save this setting?

    Thank you, Phyllis

    Select Configuration preserve object-level display in the preference and make sure that you apply the quality to the object and save doc. Next time you open, only objects of high quality applied will display that way.

  • get the ddl of the object in sqlplus

    Hello.

    How to get into the sqlplus to object ddl statement?

    as:

    Select the ddl from dba_objects where object_name = 'my_table ';

    Hello

    You can use the package which is displayed in the posts above else there are alternatives to get the DDL both
    For more than one table. You can go for export and import with Options by which you can get the DDL for all
    the objects in the schema according to your requirement.

    You can go for "dbms_metadata.get_ddl".
    next thing export and import with show options = 'Y '.

    -Pavan Kumar N

  • How to make a perfect canvas Composition, based cut at edges of the objects in the scene?

    To change the size of the composition to the edge cutting limits the objects in the scene.

    I know that it has the function "REGION of INTEREST".

    But this is not automatic as in Photoshop, which has the «TRIM...» »

    There may be a script somewhere out there, but not otherwise.

    Mylenium

  • Assignment of the object through the ESD Styles

    Hi all

    Someone of you have made use of attribute object Styles in ESD?  We tried this and, apparently, is not the appropriate elements to do so. We use xDocbook based on the ESD delivered with frame 7.0 default :-)  I tried to look at the default Docbook EDD that comes with frame 12, but there not the right items - I think that these are InsetStyle, AnchoredFrame and AnchoredFrameStyle.  I found them in the Dita EDD, but when I tried to import them into my existing xDocbook EDD, they are obviously not in the DTD/schema do not always work this way.

    Do you know if this is actually supported in Frame 12 or in 2015?  The frame 12 Structure Dev Guide says that you just insert an InitialObjectFormat element, then insert the style of the object using two InsetStyle for a simple chart or AnchoredFrameStyle for an anchored frame. However, these elements do not exist in our ESD or DTD.

    Does anyone know a work around or how it should actually work?

    Thank you very much

    Shelley Hoose

    Rogue Wave Software

    Shelley,

    Don't forget that there are two sets of definitions of element associated with each ESD:

    1. Definitions of element uses a DSP defines the elements and attributes that you can insert into ESD itself: these have tags such as ElementCatalog, element, AttributeList, TextFormatRules, AutoInsertions and so on.
    2. Definitions of element that defines a DSP are those created by the content of ESD. In the case of DocBook, include bridgehead, ChapterInfo, glossary, ListItem and so on.

    The EDD xdocbook which comes with 12 FM is a binary 12 FM, but its content, including the definitions of element it uses has not been updated since 7 FM. That's why the first line of the file reads "ESD Version is 7.0.

    To use the ESD features that have been added in later versions, you must update the element definitions used by your EDD to the version you want. If you use FM 12, you will need to open a DSP that uses the new features of FM 12 EDD and importing element definitions to use in your own ESD. A 12 ESD FM will say "Version of ESD is 12.0" at the top. Here is a sequence that works:

    1. FM 12, use StructureTools > new ESD.
    2. Save the resulting.
    3. Save your DocBook EDD.
    4. Open your DocBook EDD.
    5. Make up the dialog element definitions Import with file > import > element definitions.
    6. In the import of Document pop-up, select the new FM 12 you created.
    7. Hold down the CTRL key and click on the import button (or press Ctrl + Enter)

    The use of the CTRL key in step 7 is essential. Without it, FM important definitions of elements defined in ESD. You just created the file and do not have definitions of element inside. If you try to import a set of definitions of empty element, FM crashes. Instead, you want to import the element definitions used by the new ESD. That's what the CTRL key.

    EDD that have been added since 7 FM offers descriptions of the item and the text in the banner.

    -Lynne

  • Select dbms_metadata.get_dependent_ddl fails with ORA-31604 still exist for the object

    Hello

    In the DEPENDENCIES of DBA, I can see that I have (seen here) according to some a table objects:

    -SQL > select type, name

    -2 from dba_dependencies where REFERENCED_OWNER = upper ('stuff')

    --3 and REFERENCED_name = upper ('st_tab') and type = "VIEW";

    -NAME OF THE OWNER TYPE

    -- ----- ----- ------------------

    -VIEW STUFF STTAB_4MV_VW

    -VIEW STUFF STTAB_VW

    But trying to recover these definitions 2 times I get an error:

    -SQL > select dbms_metadata.get_dependent_ddl ('VIEW', 'ST_TAB', 'STUFF') def double;

    -ERROR:

    -ORA-31604: NAME parameter invalid "BASE_OBJECT_NAME" for the type of VIEW object in the function SET_FILTER

    -ORA-06512: at "SYS." DBMS_SYS_ERROR', line 116

    -ORA-06512: at "SYS." DBMS_METADATA_INT', line 4705

    -ORA-06512: at "SYS." DBMS_METADATA_INT', line 8582

    -ORA-06512: at "SYS." Dbms_metadata", line 2882

    For some objects, it works (triggers, index), but for others (views, procedures, packages), it still fails with ORA 31604.

    If I make a direct call on dbms_metadata.get_ddl ('DISPLAY', 'STTAB_4MV_VW', 'STUFF'), it works fine.

    Everyone has seen this behavior before? (tried this code on 10g and 11g)

    Thank you very much.

    Kind regards

    SEB

    For some objects, it works (triggers, index), but for others (views, procedures, packages), it still fails with ORA 31604.

    Exactly! That's what he should do. Dependent on DOF is for objects that are actually part of the table.

    If I make a direct call on dbms_metadata.get_ddl ('DISPLAY', 'STTAB_4MV_VW', 'STUFF'), it works fine.

    Exactly! That's how you get the DDL for views and other types of distinct objects. Provide you with the type of object as the first parameter.

    Everyone has seen this behavior before? (tried this code on 10g and 11g)

    Sure! This is a normal behavior.

    See chapter doc DBMS_METADATA packages and Types

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28419/d_metada.htm#i1019414

    Notes on use

    • These functions allow you to extract metadata for objects with a single call. They encapsulate calls to OPEN , SET_FILTER , and so on. The function you use depends on the characteristics of the type of object and if you want the DDL or XML.
      • GET_xxxis used to fetch named objects, especially schema objects (tables, views).

      • GET_DEPENDENT_xxxis used to extract dependent objects (audits, grants of the object).
      • GET_GRANTED_xxxis used to retrieve issued objects (System of subsidies, scholarships of role).
    • For certain types of objects, you can use more than one function. For example, you can use GET_xxx to fetch a name index, or GET_DEPENDENT_xxx to fetch the same index by specifying the table on which it is defined.

    See also table 74-11 in this doc for a table showing the types of objects.

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28419/d_metada.htm#BGBIEDIA

  • Reference the object expected found execution

    I have a .NET DLL that has a method that takes a parameter of reference an object of type NationalInstruments.TestStand.Interop.API.Execution. In TestStand 4.2.1 it worked well if I spent it RunState.Execution.

    Now in 2010 TestStand I get an error in TestStand that the method expects an object reference, but found a writ of execution. A performance, that's what I want is what describes the method. Then, why this doesn't work?

    Anyone have any ideas?

    Thank you.

    Skeptical salvation,

    It is a known backwards compatibility problem introduced in 2010 TestStand and will be fixed in a later version.

    That said, is not really meaningful for the parameter as byref (i.e. input/output) in this case, execution is already a type of reference data interface. Thus, passing byref implies that the method has the possibility of replacing the object that points to RunState.Execution with another object of execution that very probably is not something of the method would make ever.

    To work around this problem, you can do the following:

    (1) changing the prototype of the method (or add a new overload) to take the run by value setting (i.e. only), which is probably what that the author of the code really the intention anyway.

    Or

    (2) create a local variable of type object reference and assign RunState.Execution before your call to the method, and then pass the local variable for the byref parameter.

    Please let us know if you have any questions or if workarounds are not enough for you.

    Hope this helps,

    -Doug

  • What is the name of the object that I use to put in properties when setting up my acer built in webcam

    name of the object to set properties for built in webcam

    Hello

    Check with the Acer Support, their documentation and online drivers.

    Acer - USA - Service and support
    http://us.Acer.com/AC/en/us/content/support

    Acer - drivers and downloads
    http://us.Acer.com/AC/en/us/content/drivers

    Acer - worldwide
    http://www.Acer.com/worldwide/selection.html

    ============================

    Troubleshoot camera connection
    http://Windows.Microsoft.com/en-us/Windows7/Troubleshoot-camera-connection-problems

    The methods below are for Windows 7 - Vista and XP are similar.

    Vista references apply to Windows 7.

    You probably need to recharge the device drivers and any software control of the 'IF' camera, there is
    everything for Windows 7.

    Login as an administrator.

    Double-click Control Panel / Device Manager - Imaging - writing down of the brand and model of camera.
    on this subject and on the tab of the driver is version. Now, click on update drivers (who are unable to do anything as MS
    is far behind the pilots of certification). RIGHT click on the camera - UNINSTALL - REBOOT - it
    will update the driver stack.

    Now, go to the system manufacturer's website and download the latest driver for the camera and the other related camera
    software (if not more recent get the same).

    Download - SAVE - go to them and RIGHT CLICK - RUN AS ADMIN - reboot after each driver.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    Installation and update of drivers to 7 (update drivers manually using the methods above is preferred
    to make sure that the latest drivers from the manufacturer of system and device manufacturers are located)
    http://www.SevenForums.com/tutorials/43216-installing-updating-drivers-7-a.html

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Changes in LV 8.6 with the placement of the object while that paste from the Clipboard

    Hi all

    I noticed a change in behaviour of LV 8.6. When I want to place an object on the Clipboard (constant or terminal to the block diagram or control to FP) in earlier versions, that I could make a click at some point and after Ctrl + C the object appeared to this same position. This is useful if you want to place a control in a FP-specific or component within a structure on the comic. This does not work in 8.6 more and I find it very annoying to collect the object to the center of the window. Is this a bug or I have not found the box in the Options dialog box? I understand that it makes it easier for novices, but this very useful feature of collage predetermined's too bad to remove this feature.

    Welcome, Dave


  • (1) is there a function for all the object of the same size?

    (1) is there a function for all the object of the same size?

    Sorry, I thought you wanted to align the objects.

    We do not have the function to make items of the same size. You must change one by one. To change the .lks file may be more effective.

Maybe you are looking for

  • HP DC5750s CPU Upgrade

    I upgraded my CPU from an Athlon 64 Processor 3500 + to an AMD Athlon X 2 6000 + (ADA6000IAA6CZ)My computer starts up fine and everything works. My problem is in system properties, it shows unknown AMD processor model. I don't know if I need to updat

  • Connect to problems after Restore Point

    My DSL worked very slow and this past weekend, I lost the volume on my Media Player.  I did a reset of my computer and a comprehensive analysis of Norton Internet Security, now I am unable to connect to MSN and my call last night to support has been

  • system does not recognize the CD drive

    I must be crazy. Suddenly, my Windows XP Tablet in the non recognition of my CD drive which is connected with a USB cable. There are in position and work, drive Local (c) new Volume (e) which is equipped with a USB plug in hard drive for backups. But

  • SYNCHRONIZATION with Microsoft Outlook 2003...

    I would also like to sync to Outlook, so I can transfer my data to Date, address and Notepad to my Blackberry Torch 9810. I have the Palm 4.1.4 version and I have Outlook 2003. Do I have to change my settings for Outlook 2003? Can you PLEASE help? I

  • HP ENVY laptop - 15-k103nx (ENERGY STAR) Bios fan problem

    Dear Sir. I just got my new HP ENVY laptop - 15-k103nx (ENERGY STAR) for 7 days now It was a prefect job until she can make update started giving an error when booting up to the "THE system BIOS has detected a possible problem with the cooling fan.