linux下oracle 基本操作

1.su oracle
2.sqlplus /logon
3.connect test/test as sysdba(test/test是oracle用户和密码)
4.startup
5.lsnrctl


首选启动数据库
su - oracle
sqlplus /nolog
conn /as sysdba
startup
然后启动监听:
进入/opt/oracle/product/9.2.0/bin/
lsnrctl start


运行shudown命令关闭数据库
[oracle@wing /oracle]$ sqlplus " / as sysdba" //以sysdba用户登陆数据库
SQL> shutdown

启动Oracle 9i 数据库
[oracle@wing bin]$ sqlplus " / as sysdba"
SQL> startup

启动Oracle 9i监听程序
Oracle的监听程序主要是为客户端的连接提供接口
[oracle@wing bin]$ lsnrctl
LSNRCTL> start

关闭Oracle 9i监听程序
[oracle@wing bin]$ lsnrctl
LSNRCTL> stop





先看看ORACLE_SID 环境变量设置是否正确。
9i:
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup
$ lsnrctl start

8i:
$ svrmgrl
SVRMGR> connect internal
SVRMGR> startup
$ lsnrctl start

在哪里报错??
一般只要设置这2处就好了~
/etc/oratab
ora2:/oracle/app/oracle/product/8.1.7:Y
/etc/inittab
oralce:2:wait:/bin/su - oracle -c '/oracle/app/oracle/product/8.1.7/bin/lsnrctl start'
oracle:2:wait:/bin/su - oracle -c '/oracle/app/oracle/product/8.1.7/bin/dbstart'



启动步骤:

su - oracle

[oracle@websvr1 oracle]$ sqlplus /nolog

SQL> connect / as sysdba

SQL> startup

SQL> quit

[oracle@websvr1 oracle]$ lsnrctl start

可用 [oracle@websvr1 oracle]$ lsnrctl status 查看监听是否已经启动

关闭步骤:

su - oracle

[oracle@websvr1 oracle]$ lsnrctl stop

[oracle@websvr1 oracle]$ sqlplus /nolog

SQL> connect / as sysdba

SQL> shutdown immediate

SQL> quit

二.linux下配置SID
进入$ORACLE_HOME/network/admin/,编辑tnsnames.ora
AITEST.LOCALDOMAIN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 220.194.56.182)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = AITEST)
    )
  )

 

posted @ 2008-07-10 17:28  New Yang Bo Element  阅读(1200)  评论(0编辑  收藏  举报