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.oraAITEST.LOCALDOMAIN = (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 220.194.56.182)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = AITEST)
)
)