localhost:5500/em Username/Password error -------Oracle18c Express Edition - oracle

I followed a YouTube Video, and installed Oracle 18c Express Edition, gave password for localhost during installation. After successful installation I tried to access https://localhost:5500/em but couldn't login because of username/password incorrect issue. I tried usernames like: sys and sysdba but failed.

It's not at all clear what you did. You said "gave password for localhost during installation. ", but 'localhost' is not an account and so doesn't have a password. 'localhost', is a network name, used to indicate where network requests are to be routed. Specifically, 'localhost' is the network name that equates to ip address 127.0.0.1, which is the local loopback address.
If you cannot remember the password you created for a database account, such as SYS or SYSTEM, you can log on locally as SYSDBA and change what you need. From a command prompt on the database server:
oracle:cdb$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 1 09:23:37 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> alter user sys identified by "halftrack";
User altered.
SQL>

Related

SQL*Plus issues with connection to DB from Command Prompt

I am on SQL*Plus: Release 21.0.0.0.0, on a Windows machine.
In the command prompt, when I do
C:\users\TOMMY> sqlplus /nolog
I see this
SQL>
Here I connect to the Database using a connection string(EZ Connect format)
With Credentials,
username -> dddd
pwd -> wefm#vrev
host -> local
port -> 15210
ServiceName -> abcd.xysp.gthe.com
SQL> connect dddd/"wefm#vrev"#local:15210/abcd.xysp.gthe.com
And I see Output(after a few seconds),
Connected.
My issue begins when I decide to connect from Windows directly with sqlplus. Mentioned below
C:\users\TOMMY> sqlplus -S
dddd/"wefm#vrev"#local:15210/abcd.xysp.gthe.com
Results in an error, I am baffled. What am I missing
ERROR: ORA-12154: TNS:could not resolve the connect identifier
specified
I have also tried putting the connection string in single quotes (').
When I do that I get this whole thing printed out, which I assume is indicative of me passing the wrong args.
SQL*Plus: Release 21.0.0.0.0 - Production Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Use SQLPlus to execute SQL, PL/SQL and SQLPlus statements.
Usage 1: sqlplus -H | -V
-H Displays the SQL*Plus version and the
usage help.
-V Displays the SQL*Plus version.
Usage 2: sqlplus [ [] [{logon | /nolog}] [] ]
is: [-C ] [-F] [-L] [-M ""]
[-NOLOGINTIME]
[-R ] [-S]
-C <version> Sets the compatibility of affected commands to the
version specified by <version>. The version has
the form "x.y[.z]". For example, -C 10.2.0
-F This option improves performance in general. It changes
the default values settings.
See SQL*Plus User's Guide for the detailed settings.
-L Attempts to log on just once, instead of
prompting on error.
-M "<options>" Sets automatic HTML or CSV markup of output. The options
have the form:
{HTML html_options|CSV csv_options}
See SQL*Plus User's Guide for detailed HTML and CSV options.
-NOLOGINTIME Don't display Last Successful Login Time.
-R <level> Sets restricted mode to disable SQL*Plus commands
that interact with the file system. The level can
be 1, 2 or 3. The most restrictive is -R 3 which
disables all user commands interacting with the
file system.
-S Sets silent mode which suppresses the display of
the SQL*Plus banner, prompts, and echoing of
commands.
is: {[/][#<connect_identifier>] | / }
[AS {SYSDBA | SYSOPER | SYSASM | SYSBACKUP | SYSDG
| SYSKM | SYSRAC}] [EDITION=value]
Specifies the database account username, password and connect
identifier for the database connection. Without a connect
identifier, SQL*Plus connects to the default database.
The AS SYSDBA, AS SYSOPER, AS SYSASM, AS SYSBACKUP, AS SYSDG,
AS SYSKM and AS SYSRAC options are database administration privileges.
<connect_identifier> can be in the form of Net Service Name
or Easy Connect.
#[<net_service_name> | [[//]Host[:Port]/<service_name>] |
[[[protocol:]//]host1{,host12}[:port1]{,host2:port2}[/service_name]
[:server][/instance name][?[parameter name=value]
{&parameter name=value}]]]
<net_service_name> is a simple name for a service that resolves
to a connect descriptor.
Example: Connect to database using Net Service Name and the
database net service name is ORCL.
sqlplus username/mypassword#ORCL
Host specifies the host name or IP address of the database
server computer.
Port specifies the listening port on the database server.
<service name> specifies the service name of the database you
want to access.
Example: Connect to database using Easy Connect and the
Service name is ORCL.
sqlplus username/mypassword#Host/ORCL
The /NOLOG option starts SQL*Plus without connecting to a
database.
The EDITION specifies the value for Session Edition.
is: #|[.] [ ...]
Runs the specified SQL*Plus script from a web server (URL) or the
local file system (filename.ext) with specified parameters that
will be assigned to substitution variables in the script.
When SQLPlus starts, and after CONNECT commands, the site profile
(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
(e.g. login.sql in the working directory) are run. The files may
contain SQLPlus commands.
Refer to the SQL*Plus User's Guide and Reference for more information.
I would like a solution that only involves using a connection string. I don't want to be using tns_ora file
Also without any manual intervention. I don't want to separately enter the password after I put in 'username#connect-identifier'.
Please ignore security related issues of passing in the password visibly in the cmd prompt. That is fine with me.
Solution powershell script test-connect2.ps1:
$username = "demin"
$password = '"test#test"'
$connect_string ="10.241.33.71:1521/DEV"
$log_file = "log.txt"
$list_scripts = "connect $username/$password#$connect_string"
$list_scripts = $list_scripts + "
select 1,sysdate from dual;
#file1.sql
#file2.sql"
$list_scripts | sqlplus -s /nolog >>$log_file
Run script:
C:\instantclient_21_3>powershell .\test-connect2.ps1
output log.txt
1 SYSDATE
---------- ---------
1 27-MAY-22
2 SYSDATE
---------- ---------
2 27-MAY-22
3 SYSDATE
---------- ---------
3 27-MAY-22
SQL*Plus: Release 11.2.0.4.0 Production on Fri May 27 06:34:41 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> alter user DEMIN identified by "test#test";
User altered.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
C:\>sqlplus demin/"test#test"#dev19
SQL*Plus: Release 11.2.0.4.0 Production on Fri May 27 06:35:14 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
C:\>sqlplus demin/\"test#test\"#dev19
SQL*Plus: Release 11.2.0.4.0 Production on Fri May 27 06:35:23 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> show user
USER is "DEMIN"
SQL>
C:\app\product\18.0.0\dbhomeXE\bin>sqlplus demin/\"test#test\"#dev19
SQL*Plus: Release 18.0.0.0.0 - Production on Fri May 27 10:28:18 2022
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Last Successful login time: Fri May 27 2022 06:35:29 +03:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL>
C:\instantclient_19_15>sqlplus demin/\"test#test\"#dev19
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 27 11:23:35 2022
Version 19.15.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Last Successful login time: Fri May 27 2022 10:31:49 +03:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL>
C:\instantclient_21_3>sqlplus demin/\"test#test\"#dev19
SQL*Plus: Release 21.0.0.0.0 - Production on Fri May 27 11:18:08 2022
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

I am trying to install Apex 5.1 locally but i couldn't connect as a sys user from Apex directory (ERROR: ORA-01031: insufficient privileges)

e:\apex.5\apex_5.1\apex>sqlplus no/log
sql>conn sys as sysdba
ERROR:
ORA-01031: insufficient privileges
so i couldn't continue to the next step of installing Apex.
You should really post what you exactly did, and how Oracle responded.
This is what your code produces in reality:
c:\Temp>sqlplus no/log
SQL*Plus: Release 11.2.0.2.0 Production on Sub Srp 10 13:19:01 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
That is, you're connecting to user named no whose password is log, and there's no such user (as Oracle responded). I presume you meant to use /nolog, which is something quite different.
Here's how it works on my database:
c:\Temp>sqlplus /nolog
SQL*Plus: Release 11.2.0.2.0 Production on Sub Srp 10 13:17:30 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> conn sys as sysdba
Enter password:
Connected.
SQL>
As you can see, no problem in connecting to the database if I provide valid credentials. I have no idea what you did wrong, because, there are inconsistencies in what you say vs. what you show.
By the way, why installing Apex 5.1. I'd suggest the latest available version (21.1 at the moment).

What to do whenever I opens my browser it shows "ORACLE DATABASE 10g EXPRESS EDITION LICENSE AGREEMENT"?

None of my browser are working whenever I query in browser I get the message "ORACLE DATABASE 10g EXPRESS EDITION LICENSE AGREEMENT". What to do?
I too faced same issue and fixed the issue by following these steps. Please have a try.
From Start | Run open a command window. Assuming your environmental variables are set correctly start with the following:
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 26 10:40:44 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect
Enter user-name: system
Enter password: <enter password if will not be visible>
Connected.
SQL> Exec DBMS_XDB.SETHTTPPORT(3010); [Assuming you want to have HTTP going to this port]
PL/SQL procedure successfully completed.
SQL>quit
Now restart the PC and check.

11g XE GUI From Remote

I installed Oracle 11g Express Edition Release 11.2.0.2.0 - 64bit to a CENTOS 7 machine and opened up SSH so I can configure the machine from my windows laptop via putty. 11g installed successfully, but I can't seem to access 11g XE GUI from the web browser (http://127.0.0.1:8080/apex). I'm following this guide and haven't ran into any problems until this.
[root#localhost /]# sqlplus /nolog
SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 27 22:21:58 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect sys/**** as sysdba
Connected.
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
PL/SQL procedure successfully completed.
SQL>
Now when I navigate to http://127.0.0.1:8080/apex in Chrome, I'm hit with:
This site can’t be reached
127.0.0.1 refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED
I tried disabling my firewall on both my Linux machine and my windows machine, but it didn't have any effect. Any ideas on why I can't access it?
Refer to the below thread.
Oracle 10g express home page is not coming up
In another case, adding 127.0.0.1 into the hosts file for windows resolved my issue.

Connect to Oracle as SYSDBA using OCI or SQL*Plus, from client machine

I'm using Instant-Client 12.1.0.2.0, connecting to a 12.1.0.1.0 (Linux) server, in Multi-Tenant configuration.
Using either:
SQL*Plus
OCILogon2
OCIServerAttach + OCISessionBegin(OCI_RDBMS credentials, OCI_DEFAULT mode)
I can connect (using EZCONNECT, no environment variables at all) from a client machine to a PDB on the server, using SYSTEM. E.g.
c:\>sqlplus system#'//host/pdb12c_1.domain.net'
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 20 11:14:10 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Last Successful login time: Tue Oct 20 2015 11:10:10 +02:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> quit
But as soon as I add as SYSDBA to the command line, it fails:
c:\>sqlplus system#'//host/pdb12c_1.domain.net' as SYSDBA
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 20 11:14:22 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
I've modified my OCI application to use OCI_SYSDBA as the mode to OCISessionBegin, and it fails the same way. I've tried SYSOPER with both SQL*Plus and my OCI client app, and it also fails the same way.
What am I missing? What kind of restriction are placed on connection that want to gain SYSDBA? Is this mode impossible from a client machine? Or is that because I connect to a PDB instead of the CDB?
I'd appreciate some insights. Thanks.
PS: yes, I double and triple checked I typed the password in correctly
c:>sqlplus system#'//host/pdb12c_1.domain.net' as SYSDBA
You are using SYSTEM user which is incorrect. You need to use SYS.
For example,
C:\Users\lkb>sqlplus sys#pdborcl as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 20 15:11:25 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>

Resources