1.远程连接到数据库
通过’ssh + space +用户名@服务器IP’的方式连接到远程的数据库服务器
2.切换到Orcale用户
su – orcale
3.进入Sqlplus控制台
sqlplus / nolog
4.退出Sqlplus控制台
exit
5.以系统管理员登录
connect / as sysdba
6.启动数据库
startup
7.关闭数据库
shutdown immediate
8.进入监听控制台
lsnrctl
9.启动监听
启动
10.退出监听
退出
其他有关监听的详细方式https:// www .cnblogs.com / lingbing / p / 6071745.html
11.监听的配置文件的目录在
cd $ ORACLE_HOME / network / admin /
/oracle/app/11.2.0/db_1/network/admin
监听的文件名
listener.ora监听
的文件模板在
admin下的样本文件夹下
例:[oracle @ HostName admin] $ cat listener.ora
模板:
SID_LIST_LISTENER =
(SID_LIST =
(
SID_DESC = #BEQUEATH CONFIG
(GLOBAL_HostName = HostName)#数据库名
(SID_NAME = HostName)#数据库名
(ORACLE_HOME = /oracle/app/11.2.0/db_1/network/admin)#配置文件目录
#PRESPAWN CONFIG
(PRESPAWN_MAX = 20)
(PRESPAWN_LIST =
(PRESPAWN_DESC =(PROTOCOL = tcp))(POOL_SIZE = 2)(TIMEOUT = 1))
)
)
)
LISTENER =
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = TCP)(HOST = HostName)(PORT = 1521))#主机名和端口号
)
12。网络配置文件的目录在
/oracle/app/11.2.0/db_1/network/admin
文件名
tnsnames.ora
例:[oracle @ HostName admin] $ cat tnsnames.ora
模板:
#tnsnames.ora网络配置文件:/ oracle / app / 11.2.0 / db_1 / network / admin / tnsnames.ora#
由Oracle配置工具生成
.HostName =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = TCP)(HOST = HostNam e)(PORT = 1521))#
主机名(ADDRESS =(PROTOCOL = TCP)(HOST = *。*。*。*)(PORT = 1521))#主机IP和端口号
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = HostName)
)
)( )
=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = TCP)(HOST = 10.0.63.125)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = crc)
)
)