3. 改变文件权限
# chmod 755 /etc/init.d/Oracle
4. 添加服务
# chkconfig --level 35 oracle on
5. 需要在关机或重启机器之前停止数据库,做一下操作
# ln -s /etc/init.d/oracle /etc/rc0.d/K01oracle //关机
# ln -s /etc/init.d/oracle /etc/rc6.d/K01oracle //重启
6. 使用方法
# service oracle start //启动oracle
# service oracle stop //关闭oracle
# service oracle restart //重启oracle
7. 测试
a. 开机自启动
Last login: Mon Nov 26 19:57:06 2012 from 10.0.0.145
[root@ORS ~]# su - oracle
[oracle@ORS ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 26 20:07:33 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> set linesize 300;
SQL> set pagesize 30;
SQL> select * from scott.emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
SMITH CLERK 7902 17-DEC-80 800 20
ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
WARD SALESMAN 7698 22-FEB-81 1250 500 30
JONES MANAGER 7839 02-APR-81 2975 20
MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
BLAKE MANAGER 7839 01-MAY-81 2850 30
CLARK MANAGER 7839 09-JUN-81 2450 10
SCOTT ANALYST 7566 19-APR-87 3000 20
KING PRESIDENT 17-NOV-81 5000 10
TURNER SALESMAN 7698 08-SEP-81 1500 0 30
ADAMS CLERK 7788 23-MAY-87 1100 20
JAMES CLERK 7698 03-DEC-81 950 30
FORD ANALYST 7566 03-DEC-81 3000 20
MILLER CLERK 7782 23-JAN-82 1300 10
rows selected.
SQL>