There are three steps
1. Download the installation package: there is a detailed installation tutorial in it
Link: https://pan.baidu.com/s/1Of2a72pNLZ-DDIWKrTQfLw?pwd=8NAx
Extraction code: 8NAx
2. After installation, perform initialization: it takes a long time
/etc/init.d/oracledb_ORCLCDB-19c configure
3. Configure environment variables, if you do not configure environment variables, the sqlplus command will not take effect.
Note: After the installation is complete, an oracle user will be created automatically, which can be seen in the /etc/passwd file
Configure environment variables
//This step needs to be switched to the oracle user
su oracle
# Execute the command
vim .bash_profile in the oracle home directory# Add environment variables after the file, as shown in the figure below
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export ORACLE_PDB_SID=ORCLPDB1
export PATH=$ORACLE_HOME/bin:$PATH :$HOME/.local/bin:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export NLS_LANG=american_america.ZHS16GBK
After configuring the environment variables, try the sqlplus connection
My oracle service is stopped and I need to restart the oracle service
//Query the current service name For example: url:jdbc:oracle:thin:@server ip:1521:service name
select global_name from global_name; //This check is the service name
----------------------------------------------- Log in again and report an error!!! !As follows ORA-01012: not logged on -------------------------------------------- -----------------------
reboot
Specific solutions: http://t.csdn.cn/Xqndl
-------------------------------------------------- --Finish----------------------------------------------- --------------------------------
Modify user password, use external connection
Use navicat to connect
Create a new database, I added a new user qianyi
Solve the problem: the way I use is to change the container to pdb
When this problem occurs, it may be because the container for creating the role is cdb.
If you want to continue creating, you can add "c##" before the role name, that is, c##role nameOr change the container to pdb
before you must log in with sysdba, otherwise you have no permission to modify1. SQL>sqlplus system/[email protected]:152x/orcl as sysdba
xxxx is your own login password
192.168.x.xx is the host number of the computer (you can check it by typing ipconfig /all in the cmd command line)
152x is The port number you connect to the database yourself
2. Query whether the container is CDB
select name, cdb, open_mode, con_id from v$database;
3. View the current container
show con_name;
4. View the created pdb
show pdbs;
5. Open the corresponding container I Here is orclpdb1
alter pluggable database orclpdb1 open;
6. Switch the current container to the specified PDB container
alter session set container = ORCLPDB;
7.
Create user qianyi create user qianyi identified by qianyi default tablespace USERS temporary tablespace TEMPfor both username and passwordprofile DEFAULT;
//Assign a separate permission
grant sysdba to qianyi ; //Give dba permission directly
SQL> grant dba,connect,resource,create view to qianyi;
Grant succeeded.
SQL> grant select any table to qianyi;
Grant succeeded.
SQL> grant update any table to qianyi;
Grant succeeded.
SQL> grant insert any table to qianyi;
Grant succeeded.
SQL> grant delete any table to qianyi;
Grant succeeded.
SQL> grant create session to qianyi;
Grant succeeded.
Log in again with the qianyi user, and report an error again...
sqlplus login also reports an error, there will be garbled characters
Changing the password doesn't work either,
ALTER USER qianyi IDENTIFIED BY 123456;
--------------------------------The correct solution is as follows:--------------- -------------------------------------------------- ------------------
Modify the /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora file
vim /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora
Restart listening.lsnrctl stop
lsnrctl start
After restarting the monitor, log in again
Try it with sqlplus first
sqlplus 用户名/密码@PDB
(The name of the new PDB in tnsnames.ora (that isORCLPDB1
))For example, log in like this on my side: sqlplus qianyi/qianyi@ORCLPDB1
Note: ORCLPDB1 is not case sensitive
Log in with navicat