通过SQL*Plus远程启动Oracle数据库实例

有很多搞技术的朋友最近问我,通过客户端的SQL*Plus能否远程启动Oracle实例呢?
有些人认为可以,而另一此则认为不可以.
查看了官方文档中关于Oracle Net Service的部分内容后,从理论上确定是没有问题的,而且给出了实现的方法.
实践出真知,下面让我们一起来完成这个实验。

--1. 在服务器端配置一个静态监听程序

LISTENER0 =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS_LIST =

        (ADDRESS = (PROTOCOL = TCP)(HOST = S1011.cuug.net)(PORT = 1522))

      )

    )

  )

 

SID_LIST_LISTENER0 =

  (SID_LIST =

    (SID_DESC =

      (GLOBAL_DBNAME = TestDB11.cuug.net)

      (SID_NAME = TestDB11)

      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)

    )

  ) 

 

--2. 启动静态监听程序LISTENER0

[oracle@S1011:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin]$ lsnrctl start LISTENER0

 

LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 01-MAR-2014 16:53:41

 

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

 

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

 

TNSLSNR for Solaris: Version 11.2.0.3.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=S1011.cuug.net)(PORT=1522)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=S1011.cuug.net)(PORT=1522)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER0

Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production

Start Date                01-MAR-2014 16:53:42

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=S1011.cuug.net)(PORT=1522)))

Services Summary...

Service "TestDB11.cuug.net" has 1 instance(s).

  Instance "TestDB11", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully 

 

--3. 配置客户端的tnsnames.ora,添加如下内容

 

TESTDB11_STA_LSN =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = S1011.cuug.net)(PORT = 1522))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = TestDB11.cuug.net)

    )

  )

 

-- 从客户端远程启动Oracle实例

C:\Users\Administrator>sqlplus sys/sys@testdb11_sta_lsn as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3 1 18:02:29 2014

 

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

 

已连接到空闲例程。

 

SQL> startup

ORACLE 例程已经动。

 

Total System Global Area  855982080 bytes

Fixed Size                  2230792 bytes

Variable Size             641730040 bytes

Database Buffers          209715200 bytes

Redo Buffers                2306048 bytes

数据库装完毕。

数据库已经打开。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1150218/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17013648/viewspace-1150218/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值