unable to import dump using "imp" - oracle

I am trying to import into oracle using imp command and the output of the command is as below.
invincible:/home/invincible# imp
Import: Release 10.2.0.1.0 - Production on Thu Aug 12 22:19:00 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: n_data
Password:
IMP-00058: ORACLE error 1034 encountered
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
Linux Error: 13: Permission denied
IMP-00005: all allowable logon attempts failed
IMP-00000: Import terminated unsuccessfully
invincible:/home/invincible#
user name and password are correct(I am able to connect using sqldeveloper). I have granted dba access to n_data. All the environment variables are set (I ran oracle_env.sh before running env ). So what might be the problem? I am running oracle on debian.

Check this blog post: ORA-27123: unable to attach to shared memory segment.
It describes same error as you have and problem was caused with incorrectly set permissions on oracle executable.
This is excerpt from the above blog post:
Here the oracle file permission has
-rwxrwxr-x i.e. 775, but this file must have the permission -rwsr-s- -x
i.e. 6751
Change the permissions for oracle
file.
$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle
$ ls -l oracle
-rwsr-s--x 1 oracle dba 119582976 Feb 3 2008 oracle
After changing the permissions on
oracle executable file, all the users
are now able to connect to the
database without any errors.
Read blog post for detailed information.

The error suggests it is trying to connect to an instance on the same host that isn't there. Generally I'd say the database isn't actually up and running, but if you can connect with SQL Developer, it suggests it is. But check you are on the correct machine.
Also try
echo :${ORACLE_SID}:
There may be some stray character in the SID. If you are using XE, you want to see :XE: (in upper case, not mixed or lower)
Have you tried
imp n_data/password#XE

Related

SQLPLUS not working if I pass variables to Shell Script

I wrote a sample shell script trying to execute a SQL file using SQLPLUS.
Here is my shell script
#!/bin/bash
username=$1
password=$2
TNS_entry=$3
schema_version=$(sqlplus -S '$username/$password#$TNS_entry' #schema.sql)
echo "Schema_number: $schema_version";
#./schema.sh username password '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=SANDBOX.domain)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=orcl))'
After executing this I am getting below SQLPLUS error.
Schema_number: ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
However if I run this manually I can connect to Oracle DB with out any issues, that concludes my SQLPLUS connection string has no issues. I am guessing shell is the culprit here, but couldn't figure out where it causing issue.
sqlplus username/password#'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SANDBOX.domain)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))' #schema.sql
SQL*Plus: Release 12.2.0.1.0 Production on Wed Mar 14 21:07:37 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
Can some one take a look at this and help me identify the issue.
Thanks and Regards
Saint
I got this working by editing as below. shell acting weird to parse quotes. Not sure this is ideal solution but this hack served the purpose.
#!/bin/bash
username=$1
password=$2
TNS_entry=$3
schema_version=$(sqlplus -S ''"$username'"/'"$password'"#'"$TNS_entry'"' #schema.sql)
echo "Schema_number: $schema_version";

Unable to login to Oracle Database from OSX

I've downloaded and installed Oracle Instant Client on my Mac Sierra.
I have also created the tnsnames.ora files and exported its path.
However, when I try to login to the remote Oracle server, I get the following error:
Mridulas-MacBook-Pro:~ mridulaprabhu$ sqlplus demo$security/password#ERPONWEB
SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 18 16:37:03 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
When my colleague connects to the same server using the same credentials on windows, he can login.
Someone told me it could be because of the characterset on my MAC. So I have set NLS_LANG to AMERICAN_AMERICA.US7ASCII but it still doesn't work.
How can I fix this?
OS X is a Unix variant, and you're running this from a shell. So the $ in your username is being interpreted as an environment variable.
If you do:
echo demo$security/password#ERPONWEB
you'll see that it only shows demo/password#ERPONWEB - unless you happen to have an envorinment variable called security, in which case that will be substituted.
You can escape the dollar symbol to stop that interpretation:
sqlplus demo\$security/password#ERPONWEB
or enclose the entire argument in single (not double) quotes:
sqlplus 'demo$security/password#ERPONWEB'

ora-09925 unable to create audit trail file no such file or directory

I have just installed a oracle 12c 12.1.0 DB on a linux machine.
after completing the installation i tried to login to database as sysdba
[oracle#bjorn adump]$ sqlplus sys as sysdba/welcome
SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 12 16:41:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
Now i tried to startup the DB using below command
SQL> startup mount
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
and this error pop up !
my ENV variable are --
[oracle#bjorn adump]$ echo $ORACLE_BASE
/oracle
[oracle#bjorn adump]$ echo $ORACLE_HOME
/oracle/product/12.1.0/db_1
I have checked into pfile which is $ORACLE_HOME/dbs/init.ora
there is the entry for audit file
audit_file_dest="/oracle/admin/orcl/adump"
I also go to this location and check if the folder exists or nt but the folder was there and it aleady has some files in it like
orcl_m000_21634_20161012143245012051143795.aud
there are lots of file with names like this.
I gave permission to this folder
chmod -R 755 /oracle/admin/orcl/adump
tried creating a new file using
touch afile
and file get created.
It also got connect to the idle session but when i tried to do a startup the error pops up !
Please suggest what i am overlooking here which needs to be corrected.
Usually this could happen because:
AUDIT_FILE_DEST is not writable(chown +w $AUDIT_FILE_DEST)
$ORACLE_BASE/admin/$ORACLE_SID/adump exists and is not writable
$ORACLE_HOME/rdbms/audit is not writable
PS: Make sure to check permissions for the oracle user
Also please check for disk space availability
In our case, one of the drives in one of our 2-node RAC servers was failing - the reason why the OS (Linux) limited anyone's access, including root, to read-only.
The amber light was suppose to turn on but it didn't. It only turned on when we restarted that particular node.
You also have 3 things to verify:
- As already mentionned, check free space with df -have
- Check if the file system are Read/Write or read-only: cat /proc/mounts
- Finally, you can check free inodes space with df -i
Detailled information can be found here: https://www.oracle-scripts.net/unable-to-create-audit-trail-file-read-only-file-system/

ORA-12154: TNS:could not resolve the connect identifier specified

The issue started when i installed the server version with already existing client version of Oracle 10g.
Background : The Oracle client version 10g was installed (at c:/oracle) to connect to a database residing in other country. So we can just connect to it and have limited access to it.
Path => c:/oracle/ora_client/network/admin/listener.ora
So to work as admin I installed 10g server at the same location c:/oracle on windows. I can now work as server.
Path => c:/oracle/product/db_1/network/admin/listener.ora
But the issue arises when I try to connect with my application installed to setup connection as a client (to server residing in other country), it fails and throws an error ORA-12154.
So, do I have to uninstall my server version (just in case the confusion might have arrived due to the presence of two Oracle databases)?
How can I fix it? What has been the probable cause for it? Please advise!
When you installed the server version it updated the environment variables to point to the server installation and not the client installation. The definition of TNS aliases is done in tnsnames.ora and no the listener.ora. So you would have to copy the already existing entries from c:/oracle/ora_client/network/admin/tnsnames.ora to c:/oracle/product/db_1/network/admin/tnsnames.ora. Be careful that you obey the tnsnames.ora format.
I faced this error today. Spent a lot of time checking what I did wrong while configuring listener. Even after I configured it using netca I still had the same error:
ORA-12154: TNS:could not resolve the connect identifier specified
It appeared that the cause was bad password for sys containing '#' character.
For example when you connect as below:
$sqlplus sys as sysdba
The response is
SQL*Plus: Release 11.2.0.4.0 Production on Wed May 27 08:24:19 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password: ple#se ERROR: ORA-12154: TNS:could not resolve the
connect identifier specified
That is it. Very easy case.

How to connect to newly installed Oracle XE instance?

I have installed Oracle XE on Win7 x64 machine. Installation completed successfully without problem, or perhaps installer didn't tell about them. But after installation I can't connect to database; its web interface is not working. I have looked through list of open ports, and there is no 8080 port as was noted during installation. Also I can't connect via SQLPlus.
SQL> connect SYSTEM
Enter password:
ERROR:
ORA-12638: Credential retrieval failed
Somewhere in the web it was told to edit sqlnet.ora file, I have changed it in the following way:
# SQLNET.AUTHENTICATION_SERVICES = (NTS)
SQLNET.AUTHENTICATION_SERVICES = (NONE)
and now I get next error
SQL> connect SYSTEM
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
What do I need to change so that I can connect to it?
I figured out the issue.
I was using domain login to install Oracle XE. If you are using domain login to install Oracle XE then the database creation will fail (though you may not get any error messages on that regard).
Solution:
Install Oracle using a local admin user.
Change SQLNET.AUTHENTICATION_SERVICES to (NONE) in sqlnet.ora.
Now login with your domain user to use oracle XE.
Check the Oracle services are started
Did you set your ORACLE_SID environment variable to the name of the instance you're connecting to?
Make sure oracle service is started.
did to ran netca after installation? - if not you can ran it from cmd
You can't connect using system if the instacne is down only as sysdba (user sys)
Make sure your ORACLE_HOME,ORACLE_SID,PATH environment variables are ok
If everything was ok then you can try to start/connect to the instance manually
Sample:
C:\Documents and Settings\asafm>
C:\Documents and Settings\asafm>
C:\Documents and Settings\asafm>sqlplus "sys as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri May 11 16:21:42
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 535662592 bytes
Fixed Size 1375792 bytes
Variable Size 360710608 bytes
Database Buffers 167772160 bytes
Redo Buffers 5804032 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>select status from v$instance;
As Rejeev Divakaran said, installing oracle XE with local windows user, and switching back to domain user account, started db, able to connect.
Config
Office Laptop
Windows 7 64 Bit
Oracle 11g XE
Can you connect this way from the command line:
sqlplus / as sysdba
if so at the SQL prompt enter
SQL>startup
If the command returns ok then try to connect with a username and password.
This error message usually occurs when the database could not be started. The windows service may be running, but still Oracle might not be able to spawn server threads and hand out client connections.
Have a Look into app\oracle\admin\xe\bdump\alert_xe.log for any error messages during the last start of the Oracle service.
Just in case someone is as "lucky" as me: I recently couldn't install Oracle with a local user (as suggested here before) because the target machine (Win2k8 x64) was also the Domain Controller of that network.
All users were in domain - no local users available :(
Here are the steps I performed:
Installed Oracle XE in my local machine (that works fine). Made a backup (using the built-in backup.bat);
Transferred the fast_recovery_area folder to my target machine;
Installed the Oracle XE in the target machine normally;
Edited the %ORA_HOME%\network\admin\sqlnet.ora file and performed this well-known edit:
SQLNET.AUTHENTICATION_SERVICES= (NONE)
Edited the %ORA_HOME%\bin\restore.bat file:
Replaced every entry rman target / (...) by rman target sys/MySysDbaPass (...)
Replaced every entry (...) connect / as sysdba^; by (...) connect sys/MySysDbaPass as sysdba^;
Runned restore.bat - when prompted, pointed to the fast_recovery_area I've transferred before.
Done! (pheew!)
Sorry for answering this YEARS old question, but I managed to make it work...
Make sqlnet.ora change.
Run StopDB.bat
Run MakeDB.bat
This will create a demo database, reset the password to 'oracle', and will also allow you to connect without error.

Resources