Error ORA-27046

Yesterday applying recover to a Test database get the next error;

ORA-00279: change 400221459135 generated at 10/28/2018 09:25:32 needed for
thread 1
ORA-00289: suggestion : /dbtest/test/arch/log_dbsp_1_816009_655734277.arc
ORA-00280: change 400221459135 for thread 1 is in sequence #816009
ORA-00278: log file '/dbtest/test/arch/log_dbsp_1_816008_655734277.arc' no
longer needed for this recovery

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'/dbtest/test/arch/log_dbsp_1_816009_655734277.arc'
ORA-27046: file size is not a multiple of logical block size                    
Additional information: 1

I have moved the file from Production to Test by using sftp.The problem is the file it looks good but I have tranfered the file again. Maybe a binary comparison would show the problem and if the files (in source and destination) were equals.

HTH – Antonio Navarro

Advertisements

Changing Oracle_home Order (Windows)

Today I have report with the next error;

 

photo_problem

 

It looks like mismatched version of Oracle client. This computer have several ORACLE_HOME installed. The solution was change the current setting of ORACLE_HOME I show below a simple way by using the Oracle Installer.

 

Using my laptop like example (I have four OHs). Sorry about the language but I have setted Spanish like language. Start the OUI.

 

photo1

Click in Installed Products (Button circled)

photo2

Click the enviroment tab

photo3

Move the Oracle home directory that you want as your default to the top of the list.

photo4

It must be similar at the next screenshot.

photo5

Confirm the changes by click the apply button and exit.

HTH – Antonio NAVARRO

 

OSWatcher Don’t Want To Die

Today I have a strange problem, I was recolleting traces with OSWatcher but when I stop the trace by using stopOSWbb.sh shell script after a while it start again.

Looking for who is the process what were starting the OSWatcher I’ve discovered it is started by tfactl

 

 

grid@wolf-1./tmp $ tfactl

tfactl> toolstatus

.------------------------------------------------------------------.
|                   TOOLS STATUS - HOST : Wolf-1                   |
+----------------------+--------------+--------------+-------------+
| Tool Type            | Tool         | Version      | Status      |
+----------------------+--------------+--------------+-------------+
| Development Tools    | orachk       |   12.2.0.1.3 | DEPLOYED    |
|                      | oratop       |       14.1.2 | DEPLOYED    |
+----------------------+--------------+--------------+-------------+
| Support Tools Bundle | darda        | 2.10.0.R6036 | DEPLOYED    |
|                      | oswbb        |        8.0.1 | RUNNING     |
|                      | prw          | 12.1.13.11.4 | NOT RUNNING |
+----------------------+--------------+--------------+-------------+
| TFA Utilities        | alertsummary |   12.2.1.1.0 | DEPLOYED    |
|                      | calog        |   12.2.0.1.0 | DEPLOYED    |
|                      | changes      |   12.2.1.1.0 | DEPLOYED    |
|                      | dbglevel     |   12.2.1.1.0 | DEPLOYED    |
|                      | events       |   12.2.1.1.0 | DEPLOYED    |
|                      | grep         |   12.2.1.1.0 | DEPLOYED    |
|                      | history      |   12.2.1.1.0 | DEPLOYED    |
|                      | ls           |   12.2.1.1.0 | DEPLOYED    |
|                      | managelogs   |   12.2.1.1.0 | DEPLOYED    |
|                      | menu         |   12.2.1.1.0 | DEPLOYED    |
|                      | param        |   12.2.1.1.0 | DEPLOYED    |
|                      | ps           |   12.2.1.1.0 | DEPLOYED    |
|                      | pstack       |   12.2.1.1.0 | DEPLOYED    |
|                      | search       |   18.2.0.0.0 | DEPLOYED    |
|                      | summary      |   12.2.1.1.0 | DEPLOYED    |
|                      | tail         |   12.2.1.1.0 | DEPLOYED    |
|                      | triage       |   12.2.1.1.0 | DEPLOYED    |
|                      | vi           |   12.2.1.1.0 | DEPLOYED    |
'----------------------+--------------+--------------+-------------'

Note :-
  DEPLOYED    : Installed and Available - To be configured or run interactively.
  NOT RUNNING : Configured and Available - Currently turned off interactively.
  RUNNING     : Configured and Available.

Of course, stoping it from be started by tfa in the next way;

 
tfactl> stop oswbb
Stopped OSWatcher
tfactl>  toolstatus

.------------------------------------------------------------------.
|                   TOOLS STATUS - HOST : Wolf-1                   |
+----------------------+--------------+--------------+-------------+
| Tool Type            | Tool         | Version      | Status      |
+----------------------+--------------+--------------+-------------+
| Development Tools    | orachk       |   12.2.0.1.3 | DEPLOYED    |
|                      | oratop       |       14.1.2 | DEPLOYED    |
+----------------------+--------------+--------------+-------------+
| Support Tools Bundle | darda        | 2.10.0.R6036 | DEPLOYED    |
|                      | oswbb        |        8.0.1 | STOPPED     |
|                      | prw          | 12.1.13.11.4 | NOT RUNNING |
+----------------------+--------------+--------------+-------------+
| TFA Utilities        | alertsummary |   12.2.1.1.0 | DEPLOYED    |
|                      | calog        |   12.2.0.1.0 | DEPLOYED    |
|                      | changes      |   12.2.1.1.0 | DEPLOYED    |
|                      | dbglevel     |   12.2.1.1.0 | DEPLOYED    |
|                      | events       |   12.2.1.1.0 | DEPLOYED    |
|                      | grep         |   12.2.1.1.0 | DEPLOYED    |
|                      | history      |   12.2.1.1.0 | DEPLOYED    |
|                      | ls           |   12.2.1.1.0 | DEPLOYED    |
|                      | managelogs   |   12.2.1.1.0 | DEPLOYED    |
|                      | menu         |   12.2.1.1.0 | DEPLOYED    |
|                      | param        |   12.2.1.1.0 | DEPLOYED    |
|                      | ps           |   12.2.1.1.0 | DEPLOYED    |
|                      | pstack       |   12.2.1.1.0 | DEPLOYED    |
|                      | search       |   18.2.0.0.0 | DEPLOYED    |
|                      | summary      |   12.2.1.1.0 | DEPLOYED    |
|                      | tail         |   12.2.1.1.0 | DEPLOYED    |
|                      | triage       |   12.2.1.1.0 | DEPLOYED    |
|                      | vi           |   12.2.1.1.0 | DEPLOYED    |
'----------------------+--------------+--------------+-------------'

 

Now it don’t start again anymore and I’m be a little more happy

 
HTH – Antonio NAVARRO

 

Security Breach Due To Erroneous Configuration Of The Path

Today I found a security bug quite important in a Unix system. In fact the problem is very old and known. It was already used in the years 90. Looking at the PATH variable I found the following (for several users);

 
WOF-3(ora18):/ext/home4/ora18/ant# echo $PATH
.:/usr/bin:/bin:/bdpd/prod/server/181/bin:/bdpd/prod/server/181/OPatch

Apparently it may look like it’s okay, but it’s not like that. The problem is the first character, the “.”, We are telling the shel to run the that executes (if we do not put absolute way to the commands to him) it looks for it in the directory in which we are. The risk in this case is that they strain us a kind of trojan, this is a program that does what it has and “something else”. The normal thing when you enter a directory is to see what there is, so the usual thing is to execute an ls, now, what happens if I create an ls, in this case a shell script, although I am more in favor of creating it in c and compiling to have a binary.

 
WOF-3(ora18):/ext/home4/ora18/ant# cat ls
/usr/bin/ls
date >> when_my_ls

The shell file that I have created calls the ls, the real one for it to do an ls, the one that executes it will see its ls, and apart I have put a payload, in this quite simple case, which is to put the current time in a log file, a kind of “keylogger” or what we could call an “executelogger”. Every time my ls is executed it will leave a record.

In this case the payload is very simple, but you can elaborate more and do many things, from a rm, a copy of a shadow file, or escalate privileges very quickly.
For it to work we give permission to the script

 
WOF-3(ora18):/ext/home4/ora18/ant# chmod 777 ls
WOF-3(ora18):/ext/home4/ora18/ant# ls -lrt
total 11
drwxr-xr-x   2 orap12   oinstall       4 May 18 09:16 cron
drwxr-xr-x   3 orap12   oinstall       5 Jun 20 10:14 oneoff_218934948
drwxr-xr-x   2 orap12   oinstall       2 Sep 13 16:25 automateX
-rwxrwxrwx   1 orap12   oinstall      34 Sep 24 12:38 ls

After running a few times the false ls, we see what the log has recorded

 
WOF-3(ora18):/ext/home4/ora18/ant# cat when_my_ls
Monday, September 24, 2018 12:40:44 PM CEST
Monday, September 24, 2018 12:40:58 PM CEST
Monday, September 24, 2018 12:41:43 PM CEST

 

Recommendations;

 
#1 Never have the. As a first option, replace this .:/usr/bin:/bin: by /usr/ bin:/bin:.: first you look where you should look.

#2 Execute the commands with absolute path, although it can be quite heavy. It would do /usr/bin/ls instead of ls

HTH – Antonio NAVARRO

AWR tool is not supported on Active Data Guard

I have recently been asked for performance reports from a database in ADG (Active Data Guard), the problem has been that AWRs are not available in this architecture until version 12.2 of Oracle. In my case this is a 12.1 so it can not be used.

As an alternative Oracle proposes to use adapted version of the statpack, known as standby statspack. For more information about this process you can see the note ML / MOSĀ  “Installing and Using Standby Statspack (Doc ID 454848.1)”.

HTH – Antonio NAVARRO