Linux 에서 Oacle 10g 켜 기 자동 시작 (감청, 인 스 턴 스)
데이터 베 이 스 를 설치 한 후 운영 체제 가 다시 시작 되면 데이터 베 이 스 는 자동 으로 시작 되 지 않 고 다음 절 차 는 oralce 데이터 베 이 스 를 운영 체제 에 따라 자동 으로 시작 합 니 다.
루트 사용자 수정 / etc / oratab 파일 사용: $ vi /etc/oratab orcl:/oracle/app/product/10.2.0/db_1: N 변경: orcl: / oracle / app / product / 10.2.0 / db1:Y ##마지막 N 을 Y 로 바 꾸 는 거 죠.
2. ORACLE 사용자 수정 $ORACLE 사용HOME / bin / dbstart 파일: \ # su - oracle $ cd $ORACLE_HOME / bin $vi dbstart 에서 ORACLE 찾기HOME_LISTNER = 이 줄, ORACLE 로 수정HOME_LISTNER=$ORACLE_HOME 3. dbshut 를 실행 하 는 지 테스트 합 니 다. dbstart 스 크 립 트 는 Oacle 서비스 와 listener 서 비 스 를 시작 할 수 있 는 지 확인 합 니 다. 1. dbstart 와 dbshut 의 로그 파일 을 수정 할 수 있 는 권한: $su - root \ # cd $ORACLEHOME \ # chown oracle: oinstall startup. log \ # chown oracle: oinstall shutdown. log 이상 로그 파일 이 존재 하지 않 거나 다음 단계 에 로그 파일 을 다시 볼 수 있 습 니 다. 2. 해당 스 크 립 트 를 실행 하여 테스트 합 니 다 \ # su - oracle $cd $ORACLEHOME / bin $. / dbstart (또는. / dbshut) $ps - efw | grep ora $lsnrctl status #감청 상태 보기 $ps - efw | grep LISTEN | grep - v grep
4: 자동 시작 실행 스 크 립 트 추가 $su - root \ # cd / etc / rc. d / init. d / \ # gedit oradbstart 다음 스 크 립 트 1 또는 스 크 립 트 2 내용 을 oradbstart 파일 로 복사 합 니 다.
스 크 립 트 1:
- #!/bin/bash
-
- # chkconfig: 345 99 10
-
- # description: Startup Script for oracle Databases
-
- # /etc/rc.d/init.d/dbstart
-
-
- export ORACLE_BASE=/u01/app/oracle/
-
- export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
-
- export ORACLE_SID=orcl
-
- export PATH=$PATH:$ORACLE_HOME/bin
-
-
- ORA_OWNR="oracle"
-
- # if the executables do not exist -- display error
-
- if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
-
- then
-
- echo "Oracle startup: cannot start"
-
- exit 1
-
- fi
-
- # depending on parameter -- startup, shutdown, restart
-
- # of the instance and listener or usage display
-
- case "$1" in
-
- start)
-
- # Oracle listener and instance startup
-
- echo -n "Starting Oracle: "
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbstart"
-
- touch /var/lock/oracle
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl start"
-
- echo "OK"
-
- ;;
-
- stop)
-
- # Oracle listener and instance shutdown
-
- echo -n "Shutdown Oracle: "
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl stop"
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
-
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
-
- rm -f /var/lock/oracle
-
- echo "OK"
-
- ;;
-
- reload|restart)
-
- $0 stop
-
- $0 start
-
- ;;
-
- *)
-
- echo "Usage: `basename $0` start|stop|restart|reload"
-
- exit 1
-
- esac
-
- exit 0
대본 2
- #!/bin/bash
-
- # chkconfig: 345 99 10
-
- # description: Startup Script for oracle Databases
-
- # /etc/rc.d/init.d/oradbstart
-
- export ORACLE_BASE=/u01/app/oracle/
-
- export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
-
- export ORACLE_SID=orcl
-
- export PATH=$PATH:$ORACLE_HOME/bin
-
- case "$1" in
-
- start)
-
- su oracle -c $ORACLE_HOME/bin/dbstart
-
- touch /var/lock/oracle
-
- echo "OK"
-
- ;;
-
- stop)
-
- echo -n "Shutdown oracle: "
-
- su oracle -c $ORACLE_HOME/bin/dbshut
-
- rm -f /var/lock/oracle
-
- echo "OK"
-
- ;;
-
- *)
-
- echo "Usage: 'basename $0' start|stop"
-
- exit 1
-
- esac
-
- exit 0
주의 점 (1). \ # 시작 하 는 줄 이 적 으 면 안 됩 니 다. 그렇지 않 으 면 나중에 chkconfig 명령 을 실행 하면 오류 가 발생 합 니 다. oradbstart 서 비 스 는 chkconfig (2) 를 지원 하지 않 습 니 다. 자신의 환경 에 따라 환경 변수 설정 부분 을 수정 합 니 다.
마지막 으로 터미널 실행 열기: $su - root \ # chown oracle. osit / etc / rc. d / init. d / oradbstart \ # chmod 775 / etc / rc. d / init. d / oradbstart 다음 실행: chkconfig -- add oradbstart chkconfig -- list oradbstart
chkconfig --list oradbstart
실행 결과: oradbstart 0: off 1: off 2: off 3: on 4: on 6: off 주: 위의 실행 결과 에 따라 해당 하 는 실행 단계 가 on 일 때 (예: 5: on) 대응 하 는 / etc / rc. d / rcN. d (예: 5: on 과 대응 하 는 것 은 / etc / rc. d / rc5. d) 아래 에 파일 이 생 성 됩 니 다: S99oradbstart, vi S99oradbstart 를 사용 하여 이 파일 을 엽 니 다.이 파일 의 내용 은 / etc / rc. d / init. d / oradbstart 내용 과 같 습 니 다. 설정 이 성공 적 임 을 표시 합 니 다.
마지막 으로 운영 체제 테스트 를 다시 시작 합 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바 작업 은 Clob 또는 NClob 데이터 형식의 저장 프로 세 스 인 스 턴 스 를 포함 합 니 다.텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.