Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Mass change using Runcat replace via CLI

Received Response
61
Views
4
Comments

I have run the following command to change a string in all catalog elements in the given path:

/u01/oracle/config/domains/bi/bitools/bin/runcat.sh -cmd replace -credentials "/mypathtocredentials/file" -online "https://.../analytics-ws/saw.dll" -folder "/shared/Testing/Chris/mass_change" -old "MyOldString" -new "MyNewString"

This works pretty handy. The drawback is that any string like the path which is included in an element like report is also being changed 😕.

Example 1: In a report a filter was added with the name “FI_MyOldString”. After running replace command its name inside the report is “FI_MyNewString“, but this filter isn´t existing.
Example 2: In a dashboard a report with the name "Report_MyOldString" is embedded. The report name inside that dasbhoard will be replaced by "Report_MyNewString", but this report isn´t existing.

Q1: Is there another way, other then to do a 2nd step where I am going to rename the catalog elements including "MyOldString", but this would mean to also change paths 😫.

Q2: Is there probably a way to identify what is going to be changed beforehand? Meaning that I would like to have a list of catalog elements with potential changes inside this element beforehand.

Answers

  • Hi Christian,

    welcome to the Oracle Analytics community and forum.

    What product and version are you working with?

    Because you are running Catalog Manager on linux, it looks like you are on-premises (OBIEE or OAS).

    All the OBIEE versions have the catalog on disk, allowing you to do a full text search by using linux commands on the files on disk. This would let you find all the places where the replace will happen, and maybe adjust your replace syntax. Sometimes doing 2-3 replaces works better, each time you work on a smaller subset of matches to avoid the wrong matches like you described.

    If you are on OAS, the catalog is in the database, you could do the same search via a SQL query (I would still use the Catalog Manager tool to do the replace if you aren't familiar with the details of how the catalog objects are encoded in the database, the various hashes etc.).

    Both these options cover your Q2: in Catalog Manager there isn't just a "search" option, therefore you can't easily get the list of objects (maybe you could get close to it by doing a report, to get all objects code and then filter those by searching your text etc.).

    For Q1, not really: the Catalog Manager does have that "basic" search & replace. It does work, but it has limited options and control. You can define some extra details on what you want to replace if you use a file containing the various search and replace options, but if you really want to replace a piece of text (and not a column etc.), you don't have many options.

  • Christian Lex
    Christian Lex Rank 2 - Community Beginner

    Hi Gianni,

    thanks a lot for the warm welcome and the information. Yes, we are using on-prem OAS 7.6.

    So, it looks like there is no way to skip the replacement of a folder path even if using an input file 😐️.

    I will take a look into the db to check if I can readout the affected elements from the catalogue incl. relevant tags.

  • Gianni Ceresa
    edited Apr 10, 2025 3:16PM

    Some info to get you started with the OAS catalog in the database.

    Everything is in the BIPLATFORM database schema.

    The table css_si_files contains the list of files in the catalog (and other things as well), filter by column namespace = 'content:catalog' to have only catalog objects. You can use full_path to have the absolute path of each object, and content_id is the foreign key to the table with the catalog objects content.

    The files content is in the table css_file_content, the key is content_id, that you get from the previous table.
    The content of the file is in the column data, but you need to pay attention to the column compressed_type: if it's 'gzip', it means that the data is compressed and you need to uncompress it first.
    In an Oracle database you can use utl_compress.lz_uncompress(data) to uncompress the value.
    On the data column you can make SQL queries because it either contains XML or JSON, and the database "speaks" both these formats (for some other files it can be binary content, but you aren't meant to play with those files anyway, anything in /system you better stay away ;-) )

    Remember: it is not supported to edit the database directly (can be done, but you better be sure about what you are doing). But you can freely use it in a read-only approach to find interesting things etc. For example you can find all the matches that will be replaced, and from there either have a list of things to fix after the replace, or be able to look into optimizing your search & replace strategy.

  • Christian Lex
    Christian Lex Rank 2 - Community Beginner

    Yes, thanks. Very helpful, I have already joined the tables you mentioned and uncompressed the data field. Now I need to find a way to extract the tags where the string is included :-).