oracle

Oracle Database “RMAN-20216: backup piece is missing”

Got dizzy the other day when, after moving around backup files, a final “restore database preview summary;” got me a :

A web search straight away pointed me to Restore Database Preview Not Working (Doc ID 2652539.1) on metalink, proposing a solution. First off, rman needs to be started in debug/trace mode as follows (credits to https://oraclespin.com/2010/11/28/how-to-turn-on-debugtrace-when-running-rman) :

We’ll now need to identify the backup piece causing the problem by looking out for some pattern like “... getBackupPiece with error 20216“. In this case, a backup piece in backup set 6803 was incorrectly registered obviously :

ID 2652539.1 now recommends to do a crosscheck on the backup piece by tag name, followed by an uncatalog and a (re-)catalog. The tag name can be found by executing a "list backup of database;", the “select * from RC_BACKUP_PIECE where BS_KEY = 6803;” from the document didn’t work for me.

Now the crosscheck and the uncatalog :

The (re-)catalog, as given, failed due to a language error, maybe the document is already out of date in that respect :

I instead just did the well-known cataloging by file pattern and succeeded :

Yet another “crosscheck …” of the backup piece only returned one file, as compared to the output above :

And now, finally, the “restore … preview …” is working again :

Enjoy

Have the “Oracle Software Delivery Cloud” wget.sh authentication actually work

Downloading from https://edelivery.oracle.com/osdc/faces/SoftwareDelivery offers the option to catch a wget-oriented download script for server side console use.

The script manages the follow up authentication of the server session against Oracle using a re-logon and a cookie file. Nothing fancy, just the web on the console and that much efficient.

Now the funny thing: due to some output channel directives in the script, entering the re-logon credentials will get stuck after the username <enter> input.

The problem is, that the password prompt, although only stderr is redirected, will not find its way to the console but will end up in the download log file :-))

So I recommend to remove this wget call output redirection at all. On top of that, I also opt to remove any wget call output redirections in the file, so you can follow the download progress on the console and log file will stay readable.

Have fun.

Install the Oracle OE- and SH-schemata for the OrderEntry- and SalesHistory-benchmarks

# - oe takes intermedia, sh takes partitioning and bitmap-indexes, so ee is a must
# - https://oracle-base.com/articles/misc/install-sample-schemas

# [ oracle@my.host.de.de $ ~ ]
mkdir sample-schemas ; cd sample-schemas
wget https://github.com/oracle/db-sample-schemas/archive/v12.2.0.1.zip
unzip v12.2.0.1.zip
cp -R db-sample-schemas-12.2.0.1/* $ORACLE_HOME/demo/schema
cd $ORACLE_HOME/demo/schema
perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat

# yet install
rlsqlplus system/oracle@my_db_srv
show con_name -- MY_DB_SRV
-- system_password sys_password hr_password oe_password pm_password ix_password sh_password
--   bi_password tablespace_name temp_tablespace_name log_location ez_connect_string
@mksample oracle oracle hr oe pm ix sh bi users temp /u01/app/oracle/product/12.2.0/dbhome_1/demo/schema/log/ my_db_srv
^d

# see the oe/sh log files
less $ORACLE_HOME/demo/schema/log/oe_oc_v3.log
less $ORACLE_HOME/demo/schema/log/sh_v3.log

Very cool bind overwrite to mimic sqlplus script optional parameters

This is just a reblog of On SQL*Plus Defines directed by SQL*Plus default values for script parameters, so credits go elsewhere. However, it’s such fun to recognize this guy employing the schortcomings of a 1st/2nd generation language such as sqlplus to actually overcome another distressing deficiency which is the lack of optional, at least fixed left-to-right positional command line parameters.
So what Vlad just does is to overwrite the binding value of an unprotected intrinsic variable for command line input transfer. Namely, he knows that command line input bindings like &1 and &2 and so forth will always exist in the runtime realm of the processor and purposeful overwrites one or the other positional binding by declaring a column blabla new_value 1,2,... slots of just the same name. That’s cool stuff, really, since it provides for a default value setting on a missing input. Something, sqlplus does not deliver, according to the manuals.

Real fun, have it

OTRS Dashboard / Set up an agent statistic element (widget)

OTRS does provide agent statistics to show on the dashboard. However, this settings is not active by default, so you’ll have to enable this feature in Admin->SysConfig under the UseAgentElementInStats identifier first.
Go and search for it, using the upper left input field, as usual, then switch it on.

(more…)