RHEL7: rc.local service not starting

Found this on some Red Hat blog:

“Systemd is a system and service manager for Linux operating systems. It is designed to be backwards compatible with SysV init scripts, and provides a number of features such as parallel startup of system services at boot time, on-demand activation of daemons, support for system state snapshots, or dependency-based service control logic. In Red Hat Enterprise Linux 7, systemd replaces Upstart as the default init system.”

chmod +x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl status rc-local

https://grepora.com/2016/07/15/rhel7-rc-local-service-not-starting/

Remove Extra member from standby redo group

Tips , Reset below parameters before create standby redo group
db_create_online_log_dest_1=+DATA1 and db_create_online_log_dest_2=+DATA2

If you have set these parameters and you create standby redo log then it will be multiplexed in +DATA1 and +DATA2, Not recommended in Prod:)

@Primary
SQL> show parameter standby_file_management=MANUAL;
SQL> alter system set standby_file_management=MANUAL;

System altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_5.319.922465363’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_6.310.922465367’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_7.311.922465371’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_8.299.922465375’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_9.872.922465379’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_10.874.922465383’;

Database altered.

SQL> select member from v$logfile;

MEMBER
——————————————————————————–
+ORADATA/BLRDB/ONLINELOG/group_2.305.922465353
+ORADATA/BLRDB/ONLINELOG/group_2.622.922465353
+ORADATA/BLRDB/ONLINELOG/group_1.307.922465349
+ORADATA/BLRDB/ONLINELOG/group_1.306.922465351
+ORADATA/BLRDB/ONLINELOG/group_3.620.922465355
+ORADATA/BLRDB/ONLINELOG/group_3.323.922465357
+ORADATA/BLRDB/ONLINELOG/group_4.322.922465359
+ORADATA/BLRDB/ONLINELOG/group_4.320.922465361
+ORADATA/BLRDB/ONLINELOG/group_5.313.922465365
+ORADATA/BLRDB/ONLINELOG/group_6.301.922465369
+ORADATA/BLRDB/ONLINELOG/group_7.302.922465373

MEMBER
——————————————————————————–
+ORADATA/BLRDB/ONLINELOG/group_8.300.922465377
+ORADATA/BLRDB/ONLINELOG/group_9.873.922465381
+ORADATA/BLRDB/ONLINELOG/group_10.875.922465385
+ORADATA/BLRDB/ONLINELOG/group_11.1351.927649007

15 rows selected.

SQL> show parameter standby_file_management=AUTO scope=both;
SQL> ALTER SYSTEM SET standby_file_management=AUTO scope=both;

System altered.

SQL> select member from v$logfile;

MEMBER
——————————————————————————–
+ORADATA/BLRDB/ONLINELOG/group_2.305.922465353
+ORADATA/BLRDB/ONLINELOG/group_2.622.922465353
+ORADATA/BLRDB/ONLINELOG/group_1.307.922465349
+ORADATA/BLRDB/ONLINELOG/group_1.306.922465351
+ORADATA/BLRDB/ONLINELOG/group_3.620.922465355
+ORADATA/BLRDB/ONLINELOG/group_3.323.922465357
+ORADATA/BLRDB/ONLINELOG/group_4.322.922465359
+ORADATA/BLRDB/ONLINELOG/group_4.320.922465361
+ORADATA/BLRDB/ONLINELOG/group_5.313.922465365
+ORADATA/BLRDB/ONLINELOG/group_6.301.922465369
+ORADATA/BLRDB/ONLINELOG/group_7.302.922465373

MEMBER
——————————————————————————–
+ORADATA/BLRDB/ONLINELOG/group_8.300.922465377
+ORADATA/BLRDB/ONLINELOG/group_9.873.922465381
+ORADATA/BLRDB/ONLINELOG/group_10.875.922465385
+ORADATA/BLRDB/ONLINELOG/group_11.1351.927649007

15 rows selected.

SQL>
SQL> alter system switch logfile;

System altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1

@DR

alter system set standby_file_management=MANUAL;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_5.319.922465363’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_6.310.922465367’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_7.311.922465371’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_8.299.922465375’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_9.872.922465379’;

Database altered.

SQL> ALTER DATABASE DROP STANDBY LOGFILE MEMBER ‘+ORADATA/BLRDB/ONLINELOG/group_10.874.922465383′;

Database altered.

Standby redo logs without multiplexting:-

SQL> SELECT MEMBER FROM V$LOGFILE WHERE TYPE=’STANDBY’;

MEMBER
——————————————————————————–
+ORADATA/BLRDB/ONLINELOG/group_5.313.922465365
+ORADATA/BLRDB/ONLINELOG/group_6.301.922465369
+ORADATA/BLRDB/ONLINELOG/group_7.302.922465373
+ORADATA/BLRDB/ONLINELOG/group_8.300.922465377
+ORADATA/BLRDB/ONLINELOG/group_9.873.922465381
+ORADATA/BLRDB/ONLINELOG/group_10.875.922465385

SQL> SELECT GROUP#,THREAD#,STATUS FROM V$STANDBY_LOG;

GROUP# THREAD# STATUS
———- ———- ———-
5 1 UNASSIGNED
6 1 UNASSIGNED
7 1 UNASSIGNED
8 2 UNASSIGNED
9 2 UNASSIGNED
10 2 UNASSIGNED

Set PASSWORD UNLIMITED for PDB Application Schema

SQL> SELECT dba_users.USERNAME,
dba_users.ACCOUNT_STATUS,
dba_users.EXPIRY_DATE
FROM dba_users
WHERE ACCOUNT_STATUS=’OPEN’;
2 3 4 5
USERNAME ACCOUNT_STATUS EXPIRY_DA
——————————————————————————————————————————– ——————————– ———
NETVERTEXBLR OPE 17-APR-17
PDBADMIN OPE 17-MAR-17
ELITELDAPBLR OPE 21-MAR-17
ELITEPMRO OPE 13-APR-17
ELITEPROXYBLR OPE 17-APR-17
SYSTEM OPE 17-MAR-17
SYS OPE 17-MAR-17

7 rows selected.

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.

SQL> SELECT dba_users.USERNAME,
dba_users.ACCOUNT_STATUS,
dba_users.EXPIRY_DATE
FROM dba_users
WHERE ACCOUNT_STATUS=’OPEN’; 2 3 4 5

USERNAME ACCOUNT_STATUS EXPIRY_DA
——————————————————————————————————————————– ——————————– ———
NETVERTEXBLR OPEN
PDBADMIN OPEN
ELITELDAPBLR OPEN
ELITEPMRO OPEN
ELITEPROXYBLR OPEN
SYSTEM OPEN
SYS OPEN

7 rows selected.

SQL>

If you want to remove password expiry date for your schema then you have to use “ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;”

How to protect your cronjob in linux ?

https://en.wikipedia.org/wiki/Chattr

A very useful Linux tip on how to make files and directories undeletable even by the root user. You can apply this tip on all important configuration files so that no one accidentally or intentionally deletes it. To achieve this the chattr (Change Attribute) command is used it Linux. The chattr command “immunizes” the file not only from deletion but also modification. The chattr command does care about chmod values, even if a file has 777 permissions immunizing the file will prevent it from being deleted or modified.

chattr +i /path/to/filename

How to view file attributes ?
lsattr /path/to/directory

How to remove the immutable flag ?
chattr -i /path/to/file

http://websistent.com/make-undeletable-files-and-directories-linux/

ORA-01110

My Database Setup is :

Primary : 2 Node RAC 12.1.0.2 with Multitenant Architecture and ASM file structure

Standby : 2 Node RAC 12.1.0.2 with Multitenant Architecture and ASM file structure

During Data Guard Configuration, the standby file management was kept to manual (by mistake). After that we have created one new tablespace in primary database and which has shutdown the MRP process in Data Guard with below errors in alert log of standby instance.

ORA-01111: name for data file 87 is unknown – rename to correct file

ORA-01110: data file 87: ‘/u01/app/oracle/product/12.1.0/db_1/dbs/UNNAMED00087’

ORA-01157: cannot identify/lock data file 87 – see DBWR trace file

ORA-01111: name for data file 87 is unknown – rename to correct file

ORA-01110: data file 87: ‘/u01/app/oracle/product/12.1.0/db_1/dbs/UNNAMED00087’

MRP0: Background Media Recovery process shutdown (blrdr2)

SQL> show parameter standby

NAME TYPE VALUE
———————————— ———– ——————————
standby_archive_dest string ?/dbs/arch
standby_file_management string MANUAL
http://www.oracle-ckpt.com/unnamed-file-in-standby-after-adding-new-file-to-primary-ora-01111-ora-01110-ora-01157/
http://www.oracle-ckpt.com/unnamed-file-in-standbypdb-after-adding-new-file-to-primarypdb/

https://community.oracle.com/thread/3980984

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

Problem

Dataguard – Standby duplication process failed with ORA-17628

Hand On Senario

bash-3.2$ rman TARGET sys/*******@pdb AUXILIARY sys/******@sdb
Recovery Manager: Release 11.2.0.3.0 – Production on Thu Oct 20 15:19:09 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: orcl (DBID=3171721304)
connected to auxiliary database: orcl (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck;
Starting Duplicate Db at 20-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=991 instance=orcl2 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile ‘/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcldr2’ auxiliary format
‘/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl2’ ;
}
executing Memory Script
Starting backup at 20-OCT-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1499 instance=orcldr2 device type=DISK
Finished backup at 20-OCT-16
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format ‘+ORAREDO/orcl/controlfile/current.256.925744863’;
restore clone controlfile to ‘+ORAFRA/orcl/controlfile/current.256.925744863’ from
‘+ORAREDO/orcl/controlfile/current.256.925744863’;
sql clone “create spfile from memory”;
shutdown clone immediate;
startup clone nomount;
sql clone “alter system set control_files =
”+ORAREDO/orcl/controlfile/current.256.925744863”, ”+ORAFRA/orcl/controlfile/current.256.925744863” comment=
”Set by RMAN” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Starting backup at 20-OCT-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=+ORAFRA/orcldr/snapshot/snapcf_orcldr.f tag=TAG20161020T151933 RECID=10 STAMP=925744774
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 20-OCT-16
Starting restore at 20-OCT-16
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 20-OCT-16
sql statement: create spfile from memory
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 8551575552 bytes
Fixed Size 2245480 bytes
Variable Size 5066722456 bytes
Database Buffers 3472883712 bytes
Redo Buffers 9723904 bytes
sql statement: alter system set control_files = ”+ORAREDO/orcl/controlfile/current.256.925744863”, ”+ORAFRA/orcl/controlfile/current.256.925744863” comment= ”Set by RMAN” scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 8551575552 bytes
Fixed Size 2245480 bytes
Variable Size 5066722456 bytes
Database Buffers 3472883712 bytes
Redo Buffers 9723904 bytes
contents of Memory Script:
{
sql clone ‘alter database mount standby database’;
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
{
set newname for tempfile 1 to
“+orasys”;
switch clone tempfile all;
set newname for datafile 1 to
“+orasys”;
set newname for datafile 2 to
“+orasys”;
set newname for datafile 3 to
“+orasys”;
set newname for datafile 4 to
“+orasys”;
set newname for datafile 5 to
“+orasys”;
sql ‘alter system archive log current’;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to +orasys in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 20-OCT-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00110 name=+PUBWIFI/orcldr/datafile/elitewifi.257.866043479
output file name=+PUBWIFI/orcl/datafile/elitewifi.257.925744929 tag=TAG20161020T152038
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00035 name=+ORADATA1/orcldr/datafile/tbsidxusernamestatistics.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/20/2016 15:21:36
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run

Analysis

Some datafiles are not using OMF name while the rest of the datafiles are using OMF name

http://selvathiruppathi.blogspot.in/2015/04/ora-17628-ora-19505-during-rman.html

http://selvathiruppathi.blogspot.in/2015/04/ora-17628-ora-19505-during-rman.html

alter system set db_file_name_convert=’orcldr’,’orcl’ scope=spfile sid=’*’;
alter system set log_file_name_convert=’orcldr’,’orcl’ scope=spfile sid=’*’;

Thanks to 🙂 http://selvathiruppathi.blogspot.in/2015/04/ora-17628-ora-19505-during-rman.html