Recently, I reinstalled my computer (dual-system windows10+ubuntu16), and upgraded my software. As a result, I installed the latest oracle12c, and a series of problems appeared. I don’t like to torment, L once said that I like what torment, waste of time, money can solve, let yourself relax. After installing Oracle12C this time, the login name and password are not correct, so it took me a whole morning.

See this article for the installation and use of oracle12c. Oracle 12C Windows Installation, Introduction and Simple Use

##### Oracle12c, feel a lot of changes, first remember to open oracle services, in computer, management, services. If SQL Server is not enabled, it cannot be accessed, and Oracle should be no different.

1.0 SQL Plus login, username/password invalid; Login denied problem. Oracle the network Adapter could not establish the connection.

The problem is shown as follows:

If you have this problem, you’ve come to the right place. Hee hee, it took me all morning to solve it.

I read more than 10 tutorials on the Internet, and finally got it done under my own contingency. This is to write a blog, convenient encounter the same problem small partners.


The Network Adapter could not establish The connection

Oracle the network adapter could not establish the connection


First I run the LSNRCTL command #### and the result is as follows:

C:\Users\dflx>lsnrctl

LSNRCTL for64-bit Windows: Version 12.2.0.1.0 - Production Copyright (C) 1991, 2016, Oracle. All rights reserved. Welcome to LSNRCTL, please type"help"To get information. LSNRCTL> status Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)) tnS-12541: TNS: No listener TNS-12560: TNS: protocol adapter Error TNS-00511: No listener 64-bit Windows Error: 61: Unknown Error Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=58.195.5.164)(PORT=1521)) TNS-12543: TNS: Failed to connect to destination host TNS-12560: TNS: protocol adapter Error TNS-00513: Failed to connect to destination host 64-bit Windows Error: 51: Unknown Error LSNRCTL>Copy the code

Oracle12 installation directory: Windows10 file storage is not the same, Oracle12 is also the latest, looking for a long time, what everything search also did not find \bin directory, modify the registry also calculate.


You should first log in to SQL Plus. You can find three default logins: id: system. Passward: manager. If not, follow the default login below. id:sqlplus / as sysdba passward:manager.

And then look at the user

select username from dba_users;
Copy the code

Results:

SYS
SYSTEM
XS$NULL
OJVMSYS
LBACSYS
OUTLN
SYS$UMF
DBSNMP
APPQOSSYS
DBSFWUSER
GGSYS
ANONYMOUS
CTXSYS
SI_INFORMTN_SCHEMA
DVSYS
DVF
GSMADMIN_INTERNAL
ORDPLUGINS
MDSYS
OLAPSYS
ORDDATA
XDB
WMSYS
ORDSYS
GSMCATUSER
MDDATA
SYSBACKUP
REMOTE_SCHEDULER_AGENT
GSMUSER
SYSRAC
AUDSYS
DIP
C##DFLX
SYSKM
ORACLE_OCM
SYSDG
SPATIAL_CSW_ADMIN_USR
Copy the code

See article: 12c Creating public and local users

So here’s the solution: prefix the username with c##

create user c##master identified by zxk123456789;
Copy the code

The results of

User C##MASTER created.
Copy the code

Important permissions, Oracle permissions are important, I like God permissions

grant connect,resource,dba to c##master;
Copy the code

The results of

Grant success.Copy the code

For more information, see Oracle-04- Creating user & New user authorization with SQL*PLUS


Format for:

 update user$ set name='MY_USER2' where name='MY_USER1';
Copy the code

I seem to have failed:

Perform the following operations in SQLPlus:

SQL> update user$ set name='master' where name='c##master'; Row 0 has been updated. On the client, the error looks like this. SQL error: ORA-00942: table or view does not exist 00942.00000 -"table or view does not exist"
*Cause:    
*Action:
Copy the code

Prepare to try the following statement:

update dba_users set username='master' where username='c##master';
Copy the code

Results:

SQL error: ORA-01031: permission insufficient 01031.00000 -"insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges
Copy the code

Have thought SQL plus login, use dba to execute above statement, result

Ora-01031: Insufficient permissionsCopy the code

I think it’s still about access.

Change password:

The format is as follows: ALTER user User name identified by New password;Copy the code

My operation is as follows:

alter user c##master identified by mm123456;
Copy the code

Results:

User C##MASTER has changed.

Copy the code

SQL Plus link successful.

Please enter user name: c##masterEnter password: connect to: Oracle Database 12C Enterprise Edition Release 12.2.0.1.0-64bit ProductionCopy the code

#### link name, should be arbitrary, I default and user the same. Username and password, you can install the above tutorial, through SQL Plus to create your own. — Important: change the selection type to local/inherited. ################## that’s how I succeeded. If not, try other options in the Oracle12C interface. I find them very useful.


If the article solves your problem, like it, hee hee.

No running today, no… Finally, the computer basically according to the good.