#进入oracle
su - oracle
#打开监听服务
lsnrctl start
#进入oracle数据库
sqlplus / as sysdba
或者
sqlplus 用户名/密码
startup
#查看实例名
select instance_name from v$instance;
#查看服务名
select global_name from global_name;
或
show parameter names
测试一下是否能外部链接oracle成功
报错no matching authentication protocol
vi /usr/local/products/oracle12c/network/admin/sqlnet.ora
#添加如下内容
SQLNET.ALLOWED_LOGON_VERSION=8
链接报错 listener does currently know of server requested in connect descriptor
vi /usr/local/products/oracle12c/network/admin/samples/tnsnames.ora
#添加如下内容,修改对应数据库服务名和本机IP地址
3.10 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = CDB1)
)
)
忘了用户密码,修改用户密码
alter user system identified by 123456;
文章知识点与官方知识档案匹配,可进一步学习相关知识