Moved Oracle 11.2 XE Database Directory, Connected to Idle Instance - database

So I will start off by stating I have moved the regular install location of Oracle 11.2 XE to a logical volume (/oracle) I had created on my RHEL 6.6 server. After shutting down both the database and the Oracle listener, I performed...
$ cp -R /u01/app/* /oracle
$ rm -rf /u01/app/oracl
$ ln -s /oracle/oracle /u01/app/oracle
Then restarted the listener and the database. Now when I attempt to run the following as the user 'oracle' I get a message...
$ sqlplus
Enter user-name: sys / as sysdba
Enter password: ****
Connected to idle instance.
Further, when I attempt a startup I get an error.
> startup
ORA-45301: XE Edition single instance violation error
I have attempted the solutions found here to no avail.
Here is the output for my listener controller:
bash-4.1$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAR-2015 10:26:25
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 10-MAR-2015 10:25:57
Uptime 0 days 0 hr. 0 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
I'm really quite lost as to what to attempt next. I know I could just reinstall and keep the directory in its proper location but I need it to be in it's own logical volume.
EDIT
Some further information to help clarify my system...
bash-4.1$ env | grep ORA
ORACLE_SID=XE
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=/oracle/oracle/product/11.2.0/xe
bash-4.1$ env | grep TNS
TNS_ADMIN=/oracle/oracle/product/11.2.0/xe/network/admin
bash-4.1$ ps -aux | grep pmon
oracle 2431 0.0 0.2 1265956 16652 ? Ss 11:43 0:00 xe_pmon_XE
FURTHER EDIT
Attempting to sign in to sqlplus using the SYSTEM user returned an error:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
FURTHER EDIT
Output of the ipcs command
bash-4.1$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0xc0a59444 32768 oracle 660 4096 0
------ Semaphore Arrays --------
key semid owner perms nsems
0xd4a9963c 229378 oracle 660 104
0x884d8f34 491523 oracle 660 104
------ Message Queues --------
key msqid owner perms used-bytes messages

Check output of ipcs command and try to delete all shared memory segments/semaphores owned by Oracle.
When Oracle starts it uses two strings ORACLE_SID(uppercase) and ORACLE_HOME, hashes these two strings and uses this hash value a key for shmget call. So even if you append slash / to ORACLE_HOME everything is different from Oracle's perspective - even if the disk path is the same.
So I think you moved ORACLE_HOME into some other location, but the old value was preserved somewhere and now Oracle thinks that you are trying to start multiple instances.
EDITED: I'm not sure about XE, but regular Oracle editions are shipped as a bunch of .o object files. These files are linked during installation, but you can also re-link Oracle anytime. Check the script $ORACLE_HOME/bin/relink if the old ORACLE_HOME is hardcoded in it. And then try to re-link all libraries by executing relink all. Also note that Oracle uses link option -Wl,-rpath=..., so some Oracle binaries have library search patch compiled in them.
For Standard/Enterprise edition it is not problem to copy binaries into different Oracle home.

Check in /u01/app/oracle/product/11.2.0/xe/dbs/ if you have renamed your XE database or attempted to create a new one, you must be sure there is only one database known by xe. It's limited to one instance.
/etc/init.d/oracle-xe stop
cd /u01/app/oracle/product/11.2.0/xe/dbs/
rename any unused pwfile and spfile to .old
/etc/init.d/oracle-xe start

Issue was a wrong entry in tsnnames.ora (I had added a line that shouldn't of been there) and as well the permissions for my /oracle directory were incorrect. Thank you to everyone who tried to help, it was greatly appreciated.

Related

Ubuntu mssql server Corruption detected in persistent registry: \SystemRoot\security.hiv

I started having this issue today on our production sql server. I have tried a variety of different fixes proposed online. We are using MSSQL server 2017 (14.0.3257.3-13). I'm out of ideas on what could be causing the server to crash. Below is the recent crash log.
This program has encountered a fatal error and cannot continue running at Sat Feb 1 14:21:21 2020
The following diagnostic information is available:
Reason: 0x00000007
Status: 0xc000014c
Message: Corruption detected in persistent registry: \SystemRoot\security.hiv.
Stack Trace:
000000006b137250
000000006b1345bf
000000006b1347a3
000000006b1337d3
000000006b1326f2
000000006b175c31
Process: 8815 - sqlservr
Thread: 8819 (application thread 0x4)
Instance Id: e5a2f812-0426-4d92-b9b2-1db1e60d957c
Crash Id: 60073e70-4042-4275-9fcd-a05ae84d26f5
Build stamp: 9726a6583fe7826f57b03fd1c7adf12bebe7692cb64630fccb0541c06820af4d
Distribution: Ubuntu 16.04.6 LTS
Processors: 9
Total Memory: 8589934592 bytes
Timestamp: Sat Feb 1 14:21:21 2020
Last errno: 2
Last errno text: No such file or directory
Thank you for the ideas, Toret.
I have faced the same issue, but I solved it just by deleting the security.hiv file.
rm /var/opt/mssql/.system/system/security.hiv
After that the mssql-server service started normaly.
After working through multiple proposed solutions online nothing worked. Some of the things I tried:
Upgrading mssql-server to latest version.
Repairing missing files or dependencies.
Changing access permissions to the directory.
Elevating access permissions for the mssql user.
Changing user access to root for the .hiv files located in the mssql .system/system folder
The only way to for me to get it to work was to:
Delete all the folders manually from /var/opt/mssql/ except for the
data folder.
Re-link python from 3.5 to 2.7
Then I downgraded the mssql-server version to Microsoft SQL Server 2017 14.0.3192.2.
Run the sudo /opt/mssql/bin/mssql-conf setup
**Python Re-link**
sudo rm /user/bin/python
sudo ln -s /user/bin/python[version] /user/bin/python
After that everything worked again.

Configuring MSSQL Server on ubuntu - Cannot open or read the persistent registry: \SystemRoot\security.hiv

I'm using the following guide to install MSSQL server on my ubuntu 16.04 machine
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017
when I'm running:
sudo /opt/mssql/bin/mssql-conf setup
no matter what kind of SQL Server edition I choose, I'm getting the following error:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
This program has encountered a fatal error and cannot continue running at Mon Apr 1 16:06:07 2019
The following diagnostic information is available:
Reason: 0x00000007
Message: Cannot open or read the persistent registry: \SystemRoot\security.hiv.
Process: 19600 - sqlservr
Thread: 19604 (application thread 0x4)
Instance Id: 7ebfcf27-db60-460d-afd3-6d852b70069e
Crash Id: d99ba388-d323-43f3-b758-e116f42bb2e8
Build stamp: 70437f6583b8ef39b1ef70539ef84690980315dc7a4436c9c40015f28610e4aa
Distribution: Ubuntu 16.04.6 LTS
Processors: 8
Total Memory: 16673366016 bytes
Timestamp: Mon Apr 1 16:06:07 2019
Ubuntu 16.04.6 LTS
Capturing core dump and information to /var/opt/mssql/log...
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
/usr/bin/tail: cannot open '/var/log/syslog' for reading: Permission denied
Attempting to capture a dump with paldumper
Captured a dump with paldumper
Core dump and information are being compressed in the background. When
complete, they can be found in the following location:
/var/opt/mssql/log/core.sqlservr.04_01_2019_16_06_07.19600.tbz2
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG
in /var/opt/mssql/log for more information.
also I found this post, which look like this guy had a similar problem, but sadly no solution
does any one knows how to solve my problem?
Thank you
Edit:
after implementing the answer I got another error:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG in /var/opt/mssql/log for more information
To make some clean in the mess that I had in the log folder I decided to delete it completely using
sudo rm -rf /var/opt/mssql/log
and re-run the setup, Apparently that solved my last problem and finally:
Setup has completed successfully. SQL Server is now starting.
You'll find further information in
/var/opt/mssql/log
Mine said:
{
"reason": "0x00000007",
"processName": "sqlservr",
"pid": "5773",
"instanceId": "d7df749c-50e6-4f3b-b894-2aa7c743f33d",
"crashId": "281e772a-5946-4349-aa9e-671cd0a3772c",
"threadId": "5777",
"libosThreadId": "0x4",
"buildStamp": "70437f6583b8ef39b1ef70539ef84690980315dc7a4436c9c40015f28610e4aa",
"message": "Cannot open or read the persistent registry: \\SystemRoot\\lsa.hiv.",
"last_errno": "13",
"last_errno_text": "Permission denied",
"distribution": "Ubuntu 16.04.6 LTS",
"processors": "4",
"total_memory": "16732037120",
"timestamp": "Fri Apr 12 22:02:44 2019"
}
So I ran locate to see where "systemroot" is located:
locate security.hiv
/var/opt/mssql/.system/system/security.hiv
I didn't know which permissions should be applied, so I just gave read&write to "others".
then the same with
lsa.hiv
licensing.hiv
re-run
sudo /opt/mssql/bin/mssql-conf setup
and then, sql-server starts, plus the permissions for others are gone again.
By the way, you can run sql-server without service, then it works even if the service fails:
/opt/mssql/bin/sqlservr
In my case (#Mine) it was not only licensing.hiv.
My /var/opt/mssql/.system/instance_id was somehow destroyed and there were more files with owner root.
After deleting /var/opt/mssql/.system/instance_id and changing all root.root files to mssql.mssql (chown mssql.mssql /var/opt/mssql/.system/system/*), I was able to rerun "/opt/mssql/bin/mssql-conf setup"
Afterwards mssql runs fine again
I very goog hint was that "/var/opt/mssql/.system/instance_id" runs on his own.

ORA 01034 and ORA 27101- ORACLE Error

I'm using CentOS 7. My ORACLE_HOME and ORACLE_XE is properly set. Yet when I try to configure my oracle 11g, I get the following error:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
LRM-00116: syntax error at 'sessions' following '='
ORA-01078: failure in processing system parameters
I'm configuring using /etc/init.d/oracle-xe command.
Please help.
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
ORACLE_SID= XE
Below are the steps we should take to ensure the correct installation and Configuration of Oracle XE on CentOS 7
Install libaio1, bc (yum install libaio1 and yum install bc)
Allocate a proper swap space
Set ORACLE_HOME and ORACLE_SID
Check is your IP and hostname is present in /etc/hosts file.
Other than this, https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7 gives a good checklist but the above 4 MUST be done.
I was facing this issue because Bouncy Castle was not installed

No start database manager command was issued. SQLSTATE=57019

I am new to DB2 and I have installed DB2 9.7.
I created an instance which is shown below
[sathish#oc3855733574 ~]$ db2ilist
sathish
Settings of /etc/services is shown below
DB2_sathish 60000/tcp
DB2_sathish_1 60001/tcp
DB2_sathish_2 60002/tcp
DB2_sathish_END 60003/tcp
DB2_TMINST 50000/tcp
But, when I start using 'db2start' it throws the following error
07/31/2015 10:26:20 0 0 SQL1042C An unexpected system error occurred.
SQL1032N No start database manager command was issued. SQLSTATE=57019
I installed DB2 using 'root' and starting 'DB2' from 'instance' (sathish in this case)
Any help or URL link will be of great use
Thanks
Sathish Kumar
I had a look into db2diag.log file and I got a unusual hack from one of the website
I followed the steps mentioned below and it worked
a) db2trc on -f db2trace.out
b) db2start
c) db2trc off
This problem generally occurs if you have recently changed the password of the account which is the owner of that db2 instance what you need to do is go to services-> properties of the db2 instance -> and then from log on part select local system account
This looks like something is wrong with the installation. There should be some hints on what DB2 ran into in the db2diag.log file (look under ~/sqllib/db2dump/db2diag.log).
What you could do if the db2diag.log does not provide a clue is to verify your installation is correct. DB2 includes a tool for that named "db2val". Here is the link to the documentation of db2val for version 9.7. Just run "db2val" as the instance owner and check the output.
Try
sudo -i -u db2inst1 /database/config/db2inst1/sqllib/adm/db2start
For more information
https://dba.stackexchange.com/questions/49807/sql1641n-error-on-linux-while-running-db2start-using-db2-express-c-on-linux-luw

Can't create test file /var/lib/mysql/Daniil-Myasnikovs-MacBook-Pro.lower-test

My environment:
Mac Snow Leopard 10.6.8
MySQL Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1
I was using this version until I tried to install MAMP on top of that. After that I have stoped MySQL server, and now I can't start it again. In terminal it writes me back:
110825 17:09:04 [Warning] Can't create test file /var/lib/mysql/Daniil-Myasnikovs-MacBook-Pro.lower-test
110825 17:09:04 [Warning] Can't create test file /var/lib/mysql/Daniil-Myasnikovs-MacBook-Pro.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
110825 17:09:04 [ERROR] Aborting
110825 17:09:04 [Note] mysqld: Shutdown complete
If you can give me a hand with this, that would be more than helpful, thank you very much.
Have you checked that the directory /var/lib/mysql does actually exist and corresponds to your data directory?
If it does not, then you probably must specify otherwise the datadir parameter under the mysqld section
[mysqld]
datadir=/var/lib/mysql

Resources