- 浏览: 242890 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
lvye351:
照做了没用,报错依旧,覆盖安装才解决
eclipse 启动报错 Ensure that the org.eclipse.core.runtime bundle is resolved -
JimmyLincole:
tudopi 写道用Threadlocal还不是每个线程实例都 ...
SimpleDateFormat 多线程下解决 -
地毯毒蛇:
可以用
Eclipse国际化插件安装 -
地毯毒蛇:
不给力丫,只能看到英文的,看不了汉字
Eclipse国际化插件安装 -
地毯毒蛇:
Thanks
Eclipse国际化插件安装
启动数据库实例,分为两步:第一步,启动监听;第二步,启动数据库实例。
一、如何启动数据库实例
1.进入到sqlplus启动实例
[oracle@redhat ~]$ su - oracle --“切换到oracle用户”
Password:
[oracle@redhat ~]$ lsnrctl start --“打开监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:06:40
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/product/10g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /home/oracle/product/10g/network/admin/listener.ora
Log messages written to /home/oracle/product/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-OCT-2009 19:06:40
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/10g/network/admin/listener.ora
Listener Log File /home/oracle/product/10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@redhat ~]$ sqlplus /nolog --“进入到sqlplus”
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Oct 14 19:06:45 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba --“连接到sysdba”
Connected to an idle instance.
SQL> startup --“启动数据库实例”
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 88082024 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
SQL> shutdown immediate --“关闭数据库实例”
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@redhat ~]$ lsnrctl stop --“关闭监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:08:06
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
The command completed successfully
2.用dbstart和dbshut启动和关闭数据库实例
先启动监听 lsnrctl start
启动实例 dbstart
使用dbstart命令启动数据库比较方便,但是在linux上安装好oracle之后,第一次使用dbstart命令可能会报如下错误:
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME
原因:
dbstart和dbshut脚本文件中ORACLE_HOME_LISTNER的设置有问题,分别打开两个文件找到:用vi编辑dbstart,ORACLE_HOME_LISTNER=$1,修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
然后保存退出,此时再运行dbstart,已经不报错了,但是没有任何反应,ps一下进程,没有oracle的进程,说明oracle实例没有正常启动。
此时的原因是在/etc/oratab的设置问题,我们vi一下,发现
zgz:/home/oracle/product/10g:N
最后设置的是"N"(我的环境中只有一个实例,因此只有一行配置语句),我们需要把“N”修改为“Y”。
以上的工作做好之后,dbstart就可以正常使用了:
[oracle@redhat bin]$ lsnrctl start --“启动监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:44:53
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/product/10g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /home/oracle/product/10g/network/admin/listener.ora
Log messages written to /home/oracle/product/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-OCT-2009 19:44:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/10g/network/admin/listener.ora
Listener Log File /home/oracle/product/10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@redhat bin]$ dbstart --“启动数据库实例”
Processing Database instance "zgz": log file /home/oracle/product/10g/startup.log
[oracle@redhat bin]$ dbshut --“关闭数据库实例”
[oracle@redhat bin]$ lsnrctl stop --“关闭监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:45:33
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
The command completed successfully
二、如何使数据库实例和linux系统一起启动
在/etc/rc.d/rc.local中加入如下语句即可实现同系统启动实例:
su - oracle -c "lsnrctl start"
su - oracle -c "dbstart"
发表评论
-
linux批量修改文件属性值
2012-05-25 01:42 1456#!/bin/sh old=$1 new=$2 ... -
oracle 批量导入数据
2012-05-25 00:53 1494create or replace procedure ... -
Oracle在Linux下自动启动
2012-04-24 13:52 1317Linux中在Oracle安装完毕以后,如果重新启动Li ... -
Linux下查看网卡实时流量工具
2012-04-24 13:12 1870nload是一个网络流量统计工具,当前版本为0.7.2。 ... -
linux 基本命令
2012-03-31 21:51 1187linux统计文件数量和大小,如何用linux命令统计文件数量 ... -
linux JDK 安装
2011-10-22 21:17 1071三种配置环境变量的方法 1. 修改/etc/profile文 ... -
linux kill
2011-10-21 11:30 3578linux 杀进程 经常需要Kill多个进程,这些 ... -
oracle 树查询
2011-07-14 10:09 7116oracle树查询又称为递归查询,是最常用的查询方法之一, ... -
Oracle数据库删除表中重复记录的常见方法
2011-06-02 16:54 1074方法一: delete from tb_channe ... -
Liunx 忘记root密码
2010-06-08 15:11 969linux AS4 忘记密码解决办法: 重新启动的时候 ... -
oracle sql脚本导入导出
2010-06-03 17:56 3131三.使用示例 3.1 数据导出: 1 将数据库Sampl ... -
oracle 数据恢复
2010-06-03 17:40 1306恢复方法: 1,把原来的数据库文件备份,(D:\oracle\ ... -
oracle merge 使用
2010-05-24 23:38 1205create table test1( eid number ... -
oracle 10g 表复制
2010-05-18 22:25 1290环境:oracle 10g;条件:有A、B表;实现目标:B表复 ... -
oracle 忘记密码
2010-05-12 11:18 977忘记密码,很多种找回密码的方式。这里介绍一种: 使用PL/S ... -
oracle PL/SQL设置客户端编码
2010-05-12 11:15 4548也可更改相应注册表项 HKEY_LOCAL_MACH ... -
oracle10g 服务 XP下手动管理
2010-05-08 11:12 1415OracleDBConsoleorcl oem控制 ... -
oracle 查询用户权限
2010-05-05 23:23 1579-- 确定角色的权限select * from role_ta ...
评论