Friday, August 4, 2017

RMAN-06034: at least 1 channel must be allocated to execute this command

Sometimes we are in hurry and overlook at things or copy paste the scripts and get into all sorts of troubles.

I was trying to speed up the creation of dataguard instance for our huge database and my script was erroring

RMAN-06034: at least 1 channel must be allocated to execute this command

Now what is this I did the things alright but why I am getting the error.

My script was :

RMAN> run {
2> allocate auxiliary channel ch1 type disk;
3> allocate auxiliary channel ch2 type disk;
4> allocate auxiliary channel ch3 type disk;
5> allocate auxiliary channel ch4 type disk;
6> allocate auxiliary channel stby1 type disk;
7> allocate auxiliary channel stby2 type disk;
8> allocate auxiliary channel stby3 type disk;
9> allocate auxiliary channel stby4 type disk;
10> duplicate target database for standby from active database
11> spfile
12> set audit_file_dest='/u01/app/oracle/admin/dev1tstd/adump'
13> set db_unique_name='dev1tstd'
14> set fal_server='dev1tstp1','dev1tstp2'
15> set instance_number='1'
16> NOFILENAMECHECK;
17> }


and error was

Starting backup at 03-AUG-17
released channel: ch1
released channel: ch2
released channel: ch3
released channel: ch4
released channel: stby1
released channel: stby2
released channel: stby3
released channel: stby4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/03/2017 11:41:11
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06034: at least 1 channel must be allocated to execute this command

After having a closer look what I have found the issue. I was only allocating the auxiliary channels and that is what the error was saying as well. So it was fixed by 

run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
allocate auxiliary channel stby3 type disk;
allocate auxiliary channel stby4 type disk;
duplicate target database for standby from active database
spfile
set audit_file_dest='/u01/app/oracle/admin/dev1tstd/adump'
set db_unique_name='dev1tstd'
set fal_server='dev1tstp1','dev1tstp2'
set instance_number='1'
NOFILENAMECHECK;
}


Allocating more channels definitely helped my creating the dataguard instance much quicker but I still have to test how helpful were those multiple auxiliary channels.


ORA-27191: sbtinfo2 returned error

While creating the standby database from active database with

duplicate target database for standby from active database
spfile
set audit_file_dest='/u01/app/oracle/admin/dev1tstd/adump'
set db_unique_name='dev1tstd'
set fal_server='dev1tstp1','dev1tstp2'
set instance_number='1'
NOFILENAMECHECK;

I was getting the error:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/03/2017 10:48:17
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
ORA-27191: sbtinfo2 returned error
Additional information: 3475


Please note that I am running the duplicate database from primary database. 

The reason for this issue was simple, I had a wrong configuration setup in RMAN for primary and that was 

CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';

I had to clear it so that it starts using disk a device 

CONFIGURE DEFAULT DEVICE TYPE clear;

This fixed the issue.

ORA-17628: Oracle error 19505 returned by remote Oracle server

I am trying to rebuild dataguard for a recently refreshed database in our development environment.

While creating the duplicate database from active database using RMAN I am getting the error:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/03/2017 09:58:18
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/03/2017 09:58:18
ORA-17628: Oracle error 19505 returned by remote Oracle server

As the error says that there are some issues with the remote database and that in my case is the new DR database.

While looking at the alert logs of the DR database what I have found that I was getting the error as below:

NOTE: failed to open SPFILE +DATA/dev1tstd/parameterfile/spfiledev1tstd.ora

Reason was that $ORACLE_HOME/dbs already had an initdev1tstd1.ora file which stores spfile location and that was going to +DATA/dev1tstd/parameterfile/spfiledev1tstd.ora . After the refresh of primary database what I did was rm -rf +DATA/dev1tstd and rm -rf +FRA/dev1tstd which wiped the spfile.

To fix it I just had to rename the initdev1tstd1.ora to initdev1tstd1.ora.old and try the duplicate command again and it fixed the issue.


ORA-00371: not enough shared pool memory, should be atleast 1034490288 bytes

I am trying to setup dataguard for one of our database and while starting the DG instance in nomount mode I am getting an ORA-00371 error

SQL> startup nomount pfile='inittst_aux.ora';
ORA-00371: not enough shared pool memory, should be atleast 1034490288 bytes
SQL>
SQL> !cat inittst_aux.ora
db_name=dev1tstp
SQL> 

This is a bug in Oracle 11.2 and as a workaround what I have done is added a parameter sga_target to ensure that instance has enough memory to start with

[oracle@comp01 (dev1tstd1) dbs]$ cat inittst_aux.ora
db_name=dev1tstp
sga_target=2560M
[oracle@comp01 (dev1tstd1) dbs]$ 

After setting up the parameter the instance started alright.

[oracle@comp01 (dev1tstd1) dbs]$ sqlplus "/ as sysdba"
 set pages 10000 lines 270 long 10000
SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 3 09:48:14 2017
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> SQL>
SQL>
SQL> startup nomount pfile='inittst_aux.ora';
ORACLE instance started.
Total System Global Area 2672361472 bytes
Fixed Size                  2231352 bytes
Variable Size             654312392 bytes
Database Buffers         1979711488 bytes
Redo Buffers               36106240 bytes
SQL> 


Tuesday, August 1, 2017

How to install xclock on raspberry pi

Sometimes we need x session to raspberry pi and for that we need to have X apps installed on raspberry pi.

I am getting the error that xclock is not installed

pi1@rasp:~/temp$ xclock
-bash: xclock: command not found
pi1@rasp:~/temp$

So I tried installing the xclock and received the message that I should install x11-apps

pi1@rasp:~/temp$ sudo apt-get install xclock
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package xclock is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  x11-apps
E: Package 'xclock' has no installation candidate
pi1@rasp:~/temp$ 


Well that is the solution, so I went on installing x11-aps


pi1@rasp:~/temp$ sudo apt-get install x11-apps
Reading package lists... Done
Building dependency tree    
.
.
.
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for systemd (215-17+deb8u7) ...
pi1@rasp:~/temp$ 


After the installation I just made sure that my DISPLAY variable is set to correct value and xauth is set as well.

pi1@rasp:~/temp$ echo $DISPLAY
localhost:10.0
pi1@rasp:~/temp$
pi1@rasp:~/temp$
pi1@rasp:~/temp$ xauth list | grep -i '10.'
raspberrypi/unix:10  MIT-MAGIC-COOKIE-1  527dd72ade8c37eed6066df0ea8d33bf
pi1@rasp:~/temp$ 


I am also running xming with default settings on client, after running the xclock on terminal I got

pi1@rasp:~/temp$ xclock
Warning: Missing charsets in String to FontSet conversion