DB2 Express in MAC SQL0805N issue - macos

I have db2 express on mac, db2start works, and db2 connect works.
However when I do anything on the database it gives me an error (eg. db2 list tables):
SQL0805N Package "NULLID.SQLC2J23 0X4141414141564962" was not found.
SQLSTATE=51002
I try doing this:
/Users/myuser/sqllib/bnd> db2 bind #db2ubind.lst blocking all grant public
And get these errors:
LINE MESSAGES FOR db2ubind.lst
------ --------------------------------------------------------------------
SQL0061W The binder is in progress.
LINE MESSAGES FOR db2ajgrt.bnd
------ --------------------------------------------------------------------
SQL0551N "TESTDB" does not have the required authorization or
privilege to perform operation "BIND" on object
"NULLID.SQLABJ02". SQLSTATE=42501
LINE MESSAGES FOR db2ueiwi.bnd
------ --------------------------------------------------------------------
SQL0551N "TESTDB" does not have the required authorization or
privilege to perform operation "BIND" on object
"NULLID.SQLUAJ19". SQLSTATE=42501
I also already did this (which seems to not help):
sudo chown root /Users/$(whoami)/sqllib/security/db2ckpw
sudo chmod u+rxs /Users/$(whoami)/sqllib/security/db2ckpw
sudo chmod o+rx /Users/$(whoami)/sqllib/security/db2ckpw
Did I miss something?
#client
> db2level
DB21085I Instance "blahblah" uses "64" bits and DB2 code release "SQL10010"
with level identifier "0201010E".
Informational tokens are "DB2 v10.1.0.0", "s120905", "DARWIN64101", and Fix
Pack "0".
Product is installed at "/Users/username/sqllib".
#server
Instance server = DB2/AIX64 10.5.5
Is it not possible to connect from a 10.1 client to 10.5.x server?

The meesage says that you do not have the BIND right in the database.
So ask your DBA to grant you the bind right and redo the bind command.
The DBA has to issue
grant bindadd on database to user testdb
grant bind on database to user testdb
Alternatively the right could be granted to a group or role or the DBA has to run the bind under his authority.

Related

ora2pg fails to connect but sqlplus works

I am using the setup from https://oracle-base.com/articles/19c/minimum-viable-oracle-database-19c-installation-on-ol8#download-software that does this:
sqlplus / as sysdba <<EOF
alter session set container=ORCLPDB1;
create user testuser1 identified by testuser1 quota unlimited on users;
grant connect, resource to testuser1;
exit;
EOF
Login to the DB is successful with:
sqlplus testuser1/testuser1#//localhost:1521/ORCLPDB1
But with an ora2pg.conf file set up thusly:
ORACLE_DSN dbi:Oracle:host=localhost;service_name=ORCLCDB;port=1521
ORACLE_USER testuser1
ORACLE_PWD testuser1
...I fail to login. I have tried
Changing the DSN and it properly says it cannot find the database at all; good
Changing the service_name and it says no such service exists; good
Trying both service_name=ORCLCDB (as it appears in tnsnames.ora) and service_name=ORCLCDB1 in the ORACLE_DSN. ORCLCDB waits for a bit then fails; ORCLCDB1 fails fast with:
FATAL: 12514 ... ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)
The ora2pg.conf is a copy from the dist version with just DNS, USER, and PWD changed.
Any ideas?
Service name of your pluggable database is ORCLPDB1, so use it instead of CDB service name(ORCLCDB):
ORACLE_DSN dbi:Oracle:host=localhost;service_name=ORCLPDB1;port=1521
ORACLE_USER testuser1
ORACLE_PWD testuser1

Oracle 11g XE - Can't login and database is down

Just installed Oracle 11g XE (Windows), but can't connect in SQL Developer or run any command in CLI.
When try to connect in CLI using SYS or SYSTEM with password defined during the install, get the following error:
ORA-12638: credential retrieval failed
When I tray to connect via SQL Developer (tried via SID and Service Name, hostname=localhost, port=1521, SID=xe), get this error:
Status : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in
connect descriptor
Already tried change SQLNET.AUTHENTICATION_SERVICES = (NTS) to (NONE) in sqlnet.ora file. When I do this, get the following error when try to connect with the SYS or SYSTEM user and password:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Already tried every solution in Google results, like reinstall, stop and start services... Mostly ask for first connect in CLI to make some changes, but even this I can't accomplish.
Any suggestions on how connect to the database?
Found the solution:
I was installing in my company Windows user domain.
First uninstall any instance of Oracle XE 11g.
Switch to a local administrator Windows user and install Oracle XE 11g.
Sign off and back to company Windows user.
Edit the file C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\sqlnet.ora (or equivalent to your installation path). Change SQLNET.AUTHENTICATION_SERVICES = (TNS) to SQLNET.AUTHENTICATION_SERVICES = (NONE).
This change will allow you connect to database from you company Windows user.
As seen here: Error ORA-12638 in Oracle Database 11g
Try the following: Open command window, cd to Oracle bin directory, enter sqlplus /nolog. If you get a prompt enter connect / as sysdba. If you get connected then you can try "startup".
- -
Did you try to start the Oracle RDBMS service via Services (services.msc)?
Do you use an spfile? Check the registry for ORA_SID_NAME_PFILE that is different from default location of $ORACLE_HOME/dbs. Also check the default location. Use only the default location or the registry entry removing either the registry entry or the file in the default location depending on which you want to use.

Oracle 11g XE initialization on ubuntu 12.04

I was following this tutorial:
http://sysadminnotebook.blogspot.com/2012/10/installing-oracle-11g-r2-express.html
and I sucessfully installed and started oracle database. Now I wanted to connect to that DB from bash, so I found that command:
sqlplus sys as sysdba
It asks for password, which in my case is oracle, and after I supply it, I get:
ORA-01031: insufficient privileges
What should I do?
EDIT:
I needed to add group dba and add myself to that group. However I've got other problem now. I wanted to create user, so I did:
CREATE USER myuser IDENTIFIED BY password
default tablespace users
temporary tablespace temp;
And I got: ORA-01034: ORACLE not available.
I tried: STARTUP But I got:
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/xe/dbs/initXE.ora'
I have '/u01/app/oracle/product/11.2.0/xe/dbs/init.ora' file but not initXE.ora
Is the o/s user a member of the dba group?
If this is a new installed Oracle and you do not have initXE.ora parameter file here /u01/app/oracle/product/11.2.0/xe/dbs/, that means you need to create XE DB first. To do that run /u01/app/oracle/product/11.2.0/xe/bin/createdb.sh script first.

CruiseControl.rb throwing exception with Postgres

In a VPS I have Postgres installed and 2 Rails projects. Both are running on production mode and connecting PG as different users.
Now I want to set CruiseControl.rb for one of them. Everything went perfectly, except when cruise is trying to run the test it's throwing this error:
PGError: ERROR: permission denied to create database
: CREATE DATABASE "myProject" ENCODING = 'utf8'
This test database is created with a different owner name, and all of them are specified correctly in ~/.cruise/projects/myProject/work/config/database.yml.
When I am running these following series of commands manually inside ~/.cruise/projects/myProject/work, they are working perfectly.
RAILS_ENV=test rake db:migrate
rake test
I've created the database using these following commands:
create user test_user with password 'abcxyz';
create database test_database TEMPLATE template0 owner test_user;
grant all privileges on database test_database to test_user;
After hitting the Build Now button, the test_database is getting deleted, and then its trying to create it again and throwing that exception.
I'm puzzled, why the test db is getting deleted on the first place? Is there anything I'm missing here?
It sounds like you haven't granted access to your test user to create a new database, even though you issued permissions for the test_user on the existing test_database.
You may need to grant privileges to create a new DB like so:
GRANT CREATE ON SCHEMA public TO test_user;
The commands you executed before created the test_user and so must have been executed as an admin or the postgres user.
TL;DR
You should compare the permissions for your cruise user to the user you executed these steps with manually, something is wrong preventing the test db creation during db:test:prepare

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