ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file - Fixed

Requirement - When starting up database following error occurs:

SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/opt/oracle/product/11.2.0/dbhome_1/dbs/inittest01.ora’

I have faced this problem, while setting up an new image of VMware. I am starting server and I got this error.
What does this mean –

Reason-
Database start using spfile (Default)
In Unix default path is $ORACLE_HOME/dbs
If spfile is not present it looks for pfile at same path. If pfile is also not present it will give above message.

Implementation -
If you have spfile then you can copy default values from spfile to pfile and create pfile. But what if you don’t have spfile
You have to create an pfile

How to create pfile –

When database starts it writes list of non default parameters in alert log files. We can use these values to create a pfile and start the database.

Find your Alert log file and open it, this is Database Management Software Oracle 11g
Here you will see entry like this:

processes = 150
sga_target = 512M
control_files = “/opt/oracle/test01/dbs/control01.ctl”
control_files = “/opt/oracle/test01/dbs/control02.ctl”
control_files = “/opt/oracle/test01/dbs/control03.ctl”
db_block_size = 8192
compatible = “10.2.0.1.0”
log_archive_dest_1 = “LOCATION=/opt/oracle/test01/archive”
log_archive_dest_state_1 = “ENABLE”
log_archive_format = “%t_%s_%r.dbf”
log_archive_max_processes= 10
log_checkpoint_interval = 9999
log_checkpoint_timeout = 0
db_file_multiblock_read_count= 16
db_recovery_file_dest = “/opt/oracle/test01/flash_recovery_area”
db_recovery_file_dest_size= 2G
undo_management = “AUTO”
undo_tablespace = “UNDOTBS1”
remote_login_passwordfile= “EXCLUSIVE”
db_domain = “agilis.com”
job_queue_processes = 32
core_dump_dest = “/opt/oracle/test01/diag/cdump”
audit_file_dest = “/opt/oracle/test01/adump”
open_links = 10
db_name = “test01”
open_cursors = 500
optimizer_index_cost_adj = 20
optimizer_index_caching = 90
pga_aggregate_target = 128M
diagnostic_dest = “/opt/oracle/test01/diag”

Create pfile using these values:
$ cd /opt/oracle/product/11.2.0/dbhome_1/dbs/
vi inittest01.ora

Copy non default parameter values from alert log in this file and save it. This is your pfile,
Start the database using this pfile

Start the Database using Pfile:

[oracle@ dbs]$ export ORACLE_SID=test01
 [oracle@ dbs]$ sqlplus sys as sysdba
 SQL*Plus: Release 11.2.0.2.0 Production on Fri Jun 24 15:53:16 2011
 Copyright (c) 1982, 2010, Oracle. All rights reserved.
 Enter password:
 Connected to an idle instance.
 SQL> startup pfile=’$ORACLE_HOME/dbs/inittest01.ora’
ORACLE instance started.
 Total System Global Area 534462464 bytes
 Fixed Size 2228200 bytes
 Variable Size 163577880 bytes
 Database Buffers 360710144 bytes
 Redo Buffers 7946240 bytes
 Database mounted.
 Database opened.
 SQL>

Create spfile from pfile:

SQL> create spfile from pfile=’$ORACLE_HOME/dbs/inittest01.ora’;
File created.

Shutdown the database and restart it will use spfile (Default) and problem is solved.

Install JAVA

The instructions below are for installing version Java 8 Update 73 (8u73). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal

Example: For Java 8u79 replace 8u73 with 8u79

Note that, as in the preceding example, the version number is sometimes preceded with the letter 'u' and sometimes it is preceded with an underbar, for example jre1.8.0_73

1. Become root by running su and entering super-user password

2. Change to the directory in which you want to install. Type:

cd directory_path_name

For example to install the software in /usr/java/ directory, Type:

cd /usr/java

3. Uninstall any earlier installations of the Java packages

 rpm -e package_name

4. Install the package

rpm -ivh jre-8u73-linux-x64.rpm

To upgrade a package

rpm -Uvh jre-8u73-linux-x64.rpm 

5. Delete '.rpm' file if you want to save disk space 

6. Exit the root shell. No need

ORA-00106: cannot startup/shutdown database when connected to a dispatcher

Problem Description

We are running a multi-threaded server and are trying to shutdown the database. But it fails through below message

ORA-00106: cannot startup/shutdown database when connected to a dispatcher

In simplest, ORA-00106 means following according to oracle documentation

Cause: An attempt was made to startup/shutdown database when connected to a shared server via a dispatcher.
Action: Re-connect as user INTERNAL without going through the dispatcher.
For most cases, this can be done by connect to INTERNAL without specifying a network connect string

Cause of the Problem
The problem happened because you are trying to shutdown the database while connected to a shared server process.
Because you cannot startup or shutdown a database while connected to a shared server process via a dispatcher.
To shutdown or startup a database you must connect via a dedicated server process.

Solution of the Problem

In order to startup/shutdown a database, you must connect via a dedicated server process and not a shared process.
If you are connecting to database server through TNS entry then add the following entry to your tnsnames.ora file in the address_list section:

(SERVER=DEDICATED)

Example of a TNS entry that establish a dedicated connection:

 service_name=
      (DESCRIPTION =
          (ADDRESS_LIST =
             (ADDRESS =
              (PROTOCOL = PROTOCOL_NAME)
                (Host = server_name)
                (Port = port_number)
             )
          )
         (CONNECT_DATA =
             (SID = sid_name)
             (SERVER=DEDICATED)
         )
       )

Another solution is login to the server and issue startup/shutdown from that computer by connecting as sysdba without any TNS entry

Catuppst.sql fails with "GGUSER.DDLREPLICATION" does not exist after upgrading the database

ORA-00604: error occurred at recursive SQL level 1
ORA-04045: errors during recompilation/revalidation of GGUSER.DDLREPLICATION
ORA-04067: not executed, package body "GGUSER.DDLREPLICATION" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "GGUSER.DDLREPLICATION"
ORA-06512: at line 1027
ORA-04067: not executed, package body "GGUSER.DDLREPLICATION" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "GGUSER.DDLREPLICATION"

Followed by this, utlrp.sql would also result the same error.

Database components "Oracle XML Database" and "Oracle Database Packages and T" (CATPROC) will be in INVALID state.

Solution:

According to below Metalink note

ORA-03113: During an Upgrade while Running Catuppst.sql ORA-6508 "GGUSER.DDLREPLICATION" in alert.log (Doc ID 1506156.1)

we need to disable the system trigger that was enable for DDL replication during Golden gate setup.

SQL> alter trigger sys.GGS_DDL_TRIGGER_BEFORE disable;

Now, re run catuppst.sql and utlrp.sql

Once this goes successfully, enable the trigger again.

SQL> alter trigger sys.GGS_DDL_TRIGGER_BEFORE enable;

Install JDK / JRE in Oracle Linux / RHEL

To install Java in RHEL or Oracle Linux based Desktop machine, open a browser and navigate to Java SE official download page and grab the latest .rpm binary package in your system.

Install Java JDK / JRE 

After Java .rpm file download completes, navigate to the directory where Java package has been downloaded and install Java JDK/JRE by issuing the below command

# yum install jdk-<Version>_linux-x64_bin.rpm

# yum install jre-<Version>_linux-x64_bin.rpm

Setup Java Environment Variables

Next, insert Java environment variables and executable files path into your system $PATH variable by issuing the below commands
This method ensures that Java environment variables and executable will be accessible system wide

-------- Set JAVA_HOME and Path Variable JDK -------- 

# export JAVA_HOME=/usr/java/jdk-<Version>
# export PATH=$PATH:/usr/java/jdk-<Version>/bin

-------- Set JAVA_HOME and Path Variable JRE --------

# export JAVA_HOME=/usr/java/jre-<Version>
# export PATH=$PATH:/usr/java/jre-<Version>/bin

Check Java JDK / JRE Version

# java --version
java <Version{
Java(TM) SE Runtime Environment (build <Version>)
Java HotSpot(TM) 64-Bit Server VM (build <Version>, mixed mode)

OLEDB provider "OraOLEDB.Oracle" for linked server

SQL Server Linked Server to Oracle Fails with Cannot Initialize Data Source Object error

You have a running SQL Server and you need to create a linked server to Oracle.
You follow these steps

Install Oracle client in the SQL Server
Setup tnsnames.ora and sqlnet.ora files
Test connection to Oracle using tnsping and sqlplus
Add Linked Server

Now when you test it, you get a long error message saying

Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "ORATEST"
OLEDB provider "OraOLEDB.Oracle" for linked server "ORATEST" returned message "ORA-12154: TNS: Could not resolve the connect identifier specified". (Microsoft SQL Server, Error: 7303)

This has been an issue with Linked Server to Oracle from the beginning of time. SQL Server does not see Oracle driver after you install it until you restart the SQL Server.

Restart your SQL Server service your linked server will start working.

How to resolve ORA-24247: network access denied by access control list (ACL)

sqlplus sys as sysdba

SQL>SELECT * FROM dba_network_acl_privileges;

SQL>select * from dba_network_acls;

SQL>GRANT EXECUTE ON UTL_TCP TO scott;
SQL>GRANT EXECUTE ON UTL_SMTP TO scott;
SQL>GRANT EXECUTE ON UTL_MAIL TO scott;

Assign Privileges to already present ACL

BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
 acl => 'acl_for_accd.xml',
principal => 'scott',
is_grant => true,
privilege => 'connect');
COMMIT;
END;
/

BEGIN
dbms_network_acl_admin.assign_acl (
acl => 'acl_for_accd.xml',
host => 'IP Address of Email Server',
lower_port => 25,
upper_port => 80
);
COMMIT;
END;
/

OR

BEGIN
dbms_network_acl_admin.assign_acl (
acl => 'acl_for_accd.xml',
host => '*',
);
COMMIT;
END;
/

Oracle Data Pump Backup Day Wise

#!/bin/sh

export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export BKP_HOME=$ORACLE_BASE/data_pump
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID = oratrg

echo 'Exporting Full Oracle Database Backup....'

expdp hr/hr directory=<directory name> dumpfile=FULL-$(date +%A).dmp logfile=FULL-$(date +%A).log full=y

tar -cvzf $BKP_HOME/FULL-$(date +%A).tar.gz $BKP_HOME/FULL-$(date +%A).dmp
cat $BKP_HOME/FULL-$(date +%A).log

echo 'Transferring Oracle Export Dump file to Remote location ....'

cd $BKP_HOME
smbclient //<Remote_Location>/D$ -U <Windows Domain Name>/<User>%<Password-c "put FULL-$(date +%A).log"
smbclient //<Remote_Location>/D$ -U <Windows Domain Name>/<User>%<Password -c "put FULL-$(date +%A).tar.gz"

Export Database using smbclient

#!/bin/sh

export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export BKP_HOME=$ORACLE_BASE/data_pump
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID = oratrg

echo 'Exporting Full Oracle Database Backup....'

expdp hr/hr directory=data_pump dumpfile=full.dmp logfile=full.log reuse_dumpfiles=y full=y

tar -cvzf $BKP_HOME/full.tar.gz $BKP_HOME/full.dmp
cat $BKP_HOME/full.log

echo 'Transferring Oracle Export Dump file to Remote location ....'

cd $BKP_HOME
smbclient //<Remote_Location>/D$ -U <Windows Domain Name>/<User>%<Password -c "put full.dmp"
smbclient //<Remote_Location>/D$ -U <Windows Domain Name>/<User>%<Password-c "put full.log"
smbclient //<Remote_Location>/D$ -U <Windows Domain Name>/<User>%<Password -c "put full.tar.gz"

Oracle 12c SEC_CASE_SENSITIVE_LOGON and ORA-01017

The init.ora/spfile parameter SEC_CASE_SENSITIVE_LOGON got deprecated since Oracle Database 12.1.0.1
This means, we don’t do any further developments to it, you shouldn’t change it from its default TRUE and if you still do you’ll receive a nice warning during STARTUP of your database:

SQL> alter system set sec_case_sensitive_logon=false scope=spfile;
System altered.

SQL> startup force
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Recently a user asked me if we’d changed the behavior of this parameter in Oracle Database 12c Release 2 as he receives now an ORA-01017: Invalid username or password error when having SEC_CASE_SENSITIVE_LOGON=FALSE with every user except SYSDBAs

In which situations may you receive an ORA-01017?

This is outlined in the Oracle 12.1 documentation already:
•Ensure that the SEC_CASE_SENSITIVE_LOGON parameter is not set to FALSE if the SQLNET.ALLOWED_LOGON_VERSION_SERVER parameter is set to 12 or 12a
This is because the more secure password versions used for this mode only support case-sensitive password checking.
For compatibility reasons, Oracle Database does not prevent the use of FALSE for SEC_CASE_SENSITIVE_LOGON when SQLNET.ALLOWED_LOGON_VERSION_SERVER is set to 12 or 12a
Setting SEC_CASE_SENSITIVE_LOGON to FALSE when SQLNET.ALLOWED_LOGON_VERSION_SERVER is set to 12 or 12a causes all accounts to become inaccessible.

The key is the sqlnet.ora parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER and here’s the difference between Oracle Database 12.1 and Oracle Database 12.2:
•Oracle Database 12.1: SQLNET.ALLOWED_LOGON_VERSION_SERVER defaults to 11 out of the box
•Oracle Database 12.2: SQLNET.ALLOWED_LOGON_VERSION_SERVER defaults to 12 out of the box

Behavior difference Oracle 12.1 vs Oracle 12.2

See this simple example after switching SEC_CASE_SENSITIVE_LOGON=FALSE in both databases (as shown above):
•Oracle Database 12.1.0.2:

SQL> alter user system identified by oracle;
User altered.

SQL> connect system/oracle
Connected.

•Oracle Database 12.2.0.1:

SQL> alter user system identified by oracle;
User altered.

SQL> connect system/oracle
ERROR:
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE

How to workaround the ORA-01017?

First of all you need to edit your sqlnet.ora adding (or lowering) the parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER to a value below 12
But if you try to connect directly after restarting your listener you will receive the same ORA-01017 again
The secret is mentioned in the above documentation link as well, you will have to recreate the user’s password if you need the logon process to work as it did work before Oracle Database 12.2

sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11

Check in DBA_USERS

SQL> select username, password_versions 
from DBA_USERS 
where username='SYSTEM';

USERNAME      PASSWORD_VERSIONS
------------- ---------------------
SYSTEM        11G 12C

There’s no “10G” mentioned. This will prevent the connection.

Solution: You will have to specify the password again respective ALTER the user(s):

SQL> alter user system identified by oracle;
User altered.

SQL> select username, password_versions 
from DBA_USERS 
where username='SYSTEM';

USERNAME       PASSWORD_VERSIONS
-------------- ----------------------
SYSTEM         10G 11G 12C

SQL> connect system/oracle
Connected.

How to check if Replication components are installed on your SQL Server

If you need to check as to whether or not SQL Replication components are installed on a specific instance of your SQL Server
Execute the following command on that instance which will give you the answer

EXEC sp_ms_replication_installed

ODBC error: SQLSTATE 37000 native database error 4060

Now, when you go to start the extract/replicat, you may get the following error:
ERROR OGG-00551 Database operation failed: Couldn’t connect to [ dns ]. ODBC error: SQLSTATE 37000 native database error 4060. [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot open database “db_name” requested by the login. The login failed.
The error message is a little bit misleading. It tells you that the process cannot connect to the database which you were able to connect to from the GGSCI command prompt with no issue.

Why is this?
The issue lies in the fact that the manager (MGR) process is running as a service and does not have the correct permissions to access the database from the service.

In searching MOS for this error, I was found Note ID: 1633138.1.
In this note, notice that this issue is known as of Oracle GoldenGate version 12.1.2.x.x. The note also provides you a fix to this issue. In simple terms, since the manager process is running as a service; additional permissions have to be granted to manger.

To grant the SYSADMIN privilege for the manager process follow the below sequence of steps (on windows after all):
1. Manager is installed as service:
Open SQL Server Management studio -> Security ->login>select NT AUTHORITY\SYSTEM ->Right Click -> Properties–>Server Role –>Enable sysadmin role
2. ggsci>stop mgr
3. ggsci>start mgr
4. ggsci>start extract <extract-name>

After granting the sysadmin role, the extract will start.

How to fix: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Open your terminal and type mysql -u root -p Enter your password. Hopefully your MySQL is logged in now.