Cannot create a user in oracle 19c - oracle

I am unable to create a user in oracle 19c and test the connectivity. Please see the steps that i had followed in the image link.

You need to use a connection string that points to the container that you created the user in. If you don’t have an entry in your tnsnames.ora already then create one for your orclpdb PDB (there’ll be a default service with the same name as your container name), then refer to it in your connection command.

Related

How to connect to Oracle on SSMA tool?

Hope you can help. I'm trying to connect to an Oracle database using SSMA for Oracle.
I have created an Oracle VM on azure as highlighted below
and
the VM got created
I have added the firewall rule to allow 1521 port.
and created the DB as mentioned below
however I could not connect to the Oracle instance using SSMA
it is throwing the below error
and if I try with that account
it is not accepting the password
What is the Username and password to be used?
Reference: https://lovekesh.tech/how-to-install-oracle-database-in-microsoft-azure-vm/
I was able to fix this issue by using the "system" account instead of "sys" or "sysdba", passsword for "system" account is same as "sys" account.
and could convert the schema
and I see the progress as highlighted below
as well as I could migrate the data
and status is as shown below

Connecting an oracle database to TOAD for Oracle using a Cloud Wallet

I have recently downloaded toad for oracle and i want to connect it to my databases but all I have is a cloud wallet for the database.
I have tried to unzip the cloud wallet and point the toad to that location so it can read the tnsnames.ora file but it did not work. I tried editing the current TOAD tns file and adding the host, port, service name and the credentials but it still did not connect. I kept getting a lot of different errors for example connection failed. file could not open
I do not know how to configure TOAD for it to connect.
Can anyone guide me in the process, I researched it a lot but nobody seem to do it often.
Thanks
This is entirely an Oracle Client configuration issue; there is nothing to do in TOAD itself. You need to either unzip the cloud wallet into your ORACLE_HOME/network/admin directory, or unzip it to a custom directory and set the TNS_ADMIN environment variable to point that directory. Note that TNS_ADMIN must be set before you start TOAD.
Here's one reference I found:
https://forums.toadworld.com/t/toad-connection-to-oracle-cloud-autonomous-database-using-wallet/48202

Oracle on Docker :: Warning: You are no longer connected to ORACLE. SP2-0640: Not connected

In the screenshot below you can see how I can successfully connect to the database but the command is rejected because... I'm not connected to the database...
I login into SQL*Plus and I receive the confirmation I'm connected: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
Just to be sure I re-enter the connection: connect SYSTEM/SYSTEM#localhost:1521/ORCLCDB and I receive as a response Connected.
I follow the official instruction of Oracle Database Sample Schemas and I run #/home/oracle/db-sample-schemas-master/mksample.sql systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /var/opt/oracle/log/ localhost:1521/ORCLCDB and here is when things start to get nasty.
First I receive an ERROR: ORA-01017: invalid username/password; logon denied.
Then a Warning: You are no longer connected to ORACLE. SP2-0640: Not connected
How can it be, that is the Administrator password.
Should I grant anything else to this user?
The "no longer connected" warning is simply because the script issued its own connect that failed with ORA-01017. A connect attempt necessarily disconnects the current session first, so when the new connection fails there is no active connection at all. You have to reconnect successfully to be able to do anything useful.
The documentation you linked to says:
Start SQL*Plus and run the top level installation script as discussed in README.txt:
sqlplus system/systempw#connect_string
#mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /your/path/to/log/ connect_string
Note: Use an absolute path and also append a trailing slash to the log directory name.
Use your current SYSTEM and SYS passwords, and also your actual default and temporary tablespace names. The passwords for the new HR, OE, PM, IX, SH and BI users will be set to the values you specify.
You have to supply your actual current password for the SYSTEM and SYS accounts, not the examples in that command; and sensible password for the new sample-schema accounts that will be created. For example, from your successful connect, the first argument to #mksample should be SYSTEM rather than the example systempw.
I was trying to load the sample schemas inside oracle database inside the docker container using the guide. What worked for me was to use localhost:1521/ORCLPDB1 as connection string in place of the SID. After this all of the tables got loaded.

Not able to create a DB link

I am trying to create a db link by giving this command
CREATE DATABASE LINK dblink
CONNECT TO qqitsmrep_read IDENTIFIED BY etl#t0pread
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=pldbitsr0031vm.bmwgroup.net)(PORT=1708))
(CONNECT_DATA=(SERVICE_NAME=ITSM Reporting))
)';
but not sure the service name is correct or not and also when i test the db link i get the below error
The connection looks like this
SQL Developer connection says that
Host is pldbdco0024vm.bmwgroup.net, but you used pldbitsr0031vm.bmwgroup.net
DCODB is SID, while you used Service Name which doesn't seem to be correct
Port is 1595, while you used 1708
Basically, you should check what TNSNAMES.ORA says (or ask your DBA).
Try
CREATE DATABASE LINK dblink
CONNECT TO qqitsmrep_read IDENTIFIED BY etl#t0pread
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=pldbdco0024vm.bmwgroup.net)(PORT=1595))
(CONNECT_DATA=(SID=dcodb))
)';

Communication between two databases (Oracle, VirtualBox)

Currently I am trying to understand how can two databases communicate to each other (for instance: get data from one to another).
Detailed description
I have two Oracle databases, one on Windows and latter on Oracle VirtualBox. On Windows DB I have one user (PAI) with single table called TESTME. On VirtualBox, only user (PAI_VB) was created. Now, I want to display the content of the TESTME table from SQL Developer from VB.
I have done
I want to display table TESTME using LINK statement:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))';
Note: data from 'DESCRIPTION' section were taken from tnsname.ora file on Windows.
Having that, via following query I will manage to display table:
SELECT * FROM PAI.TESTME#LINK_TO_PAI;
Unfortunately, it does not work.
Error from console
ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
*Action:
- If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the
NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
Questions
Could you please propose solution to my problem (I know that in *Action section there is a hint but still I cannot solve it).
Maybe, you could introduce me another way to make communication between two databases possible.
EDIT
I managed to connect from my VB machine to one on Win10 via SQLDeveloper and SQLPlus. Unfortunately, using Oracle LINK I can not access data from database.
SOLVED !!
I managed to solve my issue. The problem laid in LINK. Since following part:
'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))'
was inside tnsnames.ora file i should define my link as follows:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'xe';
After that minor change, I was able to freely us LINK in my example. Cheers :)
Here's what you need to have for a working database link:
Network connectivity between the two hosts.
Oracle Listener process running on the host you want to connect to.
Correct TNS entry while creating the link.
Correct username and password to connect to the remote database.
The TNS-12154 error you're getting means the database running on the virtual host can't get to XE's listener using the description you gave it.
Make sure you're using the correct IP address when trying to connect to your Windows host from your virtual machine.
Run tnsping from your virtual environment to see if it can get to the Windows host listener.
tnsping 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=your_windows_host_ip_from_step_1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE))'
or just tnsping XE if you have the TNS entry stored as XE in tnsnames.ora file on your virtual machine.
See also: Oracle documentation — Testing Connections.
Once you get OK response from tnsping try connecting to XE with sqlplus (sqlplus PAI/PAI#XE) or via SQL Developer running on the virtual host. If you can connect that way your database link should also work with the same TNS entry.
This is a tricky part of oracle because there are a number of diverent ways to make a connection.
I suggest that you begin to make sure that you have a tnsnames.ora file both on windows and in your virtualbox environment. What os are you running in VirtualBox by the way?
In both tnsnames.ora files both databases should be named. Easiest to make them identical.
Then connect with sql*plus from windows to your database in VirtualBox and from VirtualBox to your database on Windows.
Just to make sure your network and tns config are OK.
If this works recreate your db-link with the servce alias from tnsnames after using. This should work.

Resources