1
Bash
[oracle@rhel7 ~]$ dbca
接下来会弹出一个对话框来,对话框可能比较小,需要手动拖动放大
接下来会弹出一个对话框来,对话框可能比较小,需要手动拖动放大
接下来会弹出一个对话框来,对话框可能比较小,需要手动拖动放大
接下来会弹出一个对话框来,对话框可能比较小,需要手动拖动放大
到这一步的时间比较久根据电脑的配置决定完成的时间
到这一步的时间比较久根据电脑的配置决定完成的时间
到这一步的时间比较久根据电脑的配置决定完成的时间
登录格式:
Bash
sqlplus system/123456@edu
格式:
sqlplus [userbane]/[password]@[databases]
超级管理员的形式登录
Bash
[oracle@rhel7 ~]$ sqlplus "/as sysdba"
解释:
sqlplus
进数据库管理的工具
"/as sysdba"
超级管理员
退出
SQL
SQL> exit
第二种进入数据库的方法
Bash
[oracle@rhel7 ~]$ sqlplus /nolog
然后再登录到当前的数据库里面区
Bash
SQL> conn /as sysdba;
通过监听登录
Bash
[oracle@rhel7 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 10-OCT-2022 15:15:06
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rhel7.6-1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 10-OCT-2022 00:34:13
Uptime 0 days 14 hr. 40 min. 53 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/rhel7/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel7.6-1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "edu" has 1 instance(s).
Instance "edu", status READY, has 1 handler(s) for this service...
The command completed successfully
进入到目录里面/oracle/app/oracle/product/11.2.0/db_1/network/admin
Bash
[oracle@rhel7 ~]$ cd /oracle/app/oracle/product/11.2.0/db_1/network/admin
查看目录下的所有文件
Bash
[oracle@rhel7 admin]$ ls
listener.ora samples shrept.lst tnsnames.ora
查看tnsnames.ora里面的内容
Bash
[oracle@rhel7 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
EDU =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rhel7.6-1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = edu)
)
)
利用tnsping命令ping一下edu这个库,最后显示ok说明是没有问题的
Bash
[oracle@rhel7 admin]$ tnsping edu
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 10-OCT-2022 15:19:41
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rhel7.6-1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = edu)))
OK (0 msec)
从这里面可以看到一些信息
HOST = rhel7.6-1
主机名称
PORT = 1521
监听的端口
SERVICE_NAME = edu
服务名
登录
Bash
[oracle@rhel7 admin]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 10 15:23:44 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn sys/123456@edu as sysdba;