2011年1月9日 星期日

oracle multiple instance

oracle啟動順序為:監聽器→資料庫→資料庫控制。
關閉相反為:資料庫控制→資料庫→監聽器。
啟動
$lsnrctl start
$export ORACLE_SID=TEST
$echo $ORACLE_SID
$sqlplus / as sysdba
SQL>startup
SQL>exit
$emctl start dbconsole
關閉
$emctl stop dbconsole
$export ORACLE_SID=TEST
$echo $ORACLE_SID
$sqlplus / as sysdba
SQL>shutdown immediate
SQL>exit
$lsnrctl stop

可在監聽器、orcl資料庫、資料庫控制啟動狀態下,直接開啟一個TEST的instance
開機啟動
/etc/sysconfig/oracle
START_ORACLE_DB_LISTENER="yes"
START_ORACLE_DB="yes"
START_ORACLE_DB_EMANAGER="yes"
/etc/oratab
orcl:/opt/oracle/product/11gR2/db:Y
TEST:/opt/oracle/product/11gR2/db:Y



Running Multiple Instances

To run multiple instances, ensure that you have already created each instance. You then run multiple instances by starting each of the instances using SQL*Plus.

To run multiple instances:

1. Ensure that you have already created each instance.

2. Set the ORACLE_SID configuration parameter at the MS-DOS command prompt to the SID for each instance you want to run:

C:\> SET ORACLE_SID=SID

where SID is the name of the Oracle8i database instance.

3. Start SQL*Plus:

C:\> SQLPLUS

4. Connect as INTERNAL:

SQL> CONNECT INTERNAL

5. Start up the database with the new instance:

SQL> STARTUP PFILE=ORACLE_BASE\ADMIN\DB_NAME\PFILE\INIT.ORA

where ORACLE_BASE is C:\ORACLE by default (unless you changed it during installation) and DB_NAME is the name of the instance.

沒有留言: