管理oracle企業管理資料庫控制器

來源:互聯網
上載者:User

標籤:網格   pfile   3.0   ***   pad   查看   ready   one   mct   

  Oracle企業管理資料庫控制器是一個web介面的oracle資料庫管理工具。你可以執行管理員的操作,比如說建立實體物件(表,視圖,索引),備份與恢複你的資料庫,匯入匯出資料等等操作。

理解企業管理器的目錄

  當你安裝資料庫時,預設安裝oracle 企業管理器。它在$oracle_home目錄下安裝一些列的企業管理器目錄。

emctl工具

$ORACLE_HOME/sysman 所有執行個體的公用檔案與共用檔案都存放在這個目錄下面

$ORACLE_HOME/hostname_dbuniquename/ 單獨的資料庫執行個體存放的企業管理器檔案

理解oracle企業管理器的服務的目錄結構

在安裝過程中或安裝後設定資料庫控制器 配置選項預覽

如下的組態工具可以協助你配置oracle資料庫控制器

1. Oracle統一安裝(Oracle universal installer)

2. DBCA

3. 資料庫升級工具

4. Net 組態工具

5. Net 組態工具可以輔助你配置listener與名稱方法的工具

在安裝時設定資料庫控制器

  當你在安裝資料庫時,建立資料庫,你可以配置你的資料庫使用oracle 資料庫控制器或者使用oracle 網格控制器。

  在你安裝oracle網格控制器時,你需要安裝oracle管理服務(Oracle management service)與oracle管理代理程式(Oracle management agent)

在絕大部分安裝類型中,當你安裝資料庫時,你必須選擇安裝oracle資料庫控制器或者網格控制器。 但是你可以在下列安裝過程中,你可以不設定資料庫控制器。

  在企業版或標準版安裝時,你選擇進階配置選項

使用DBCA建立資料庫時

1. 使用DBCA建立資料庫控制器

在安裝選項中,選擇configure Enterprise manager 工具與Configure Database control for local management。

注意:理解Oracle Enterprise manager的Database control與Grid Control(網格控制)

Database control用來管理本機資料庫

Grid Control 可以用來管理本地與其它資料庫

2. 在已經存在的資料庫,也可以使用DBCA來添加企業管理器

在DBCA建立嚮導中,選擇configure the database options

3. 使用EMCA命令配置oracle企業管理

3.1 查看Oracle 資料庫控制器的狀態

emctl 命令 emctl status/start/stop dbconsole.

***************************************************************************

C:\Users\Administrator>set oracle_unqname=new02 # 設定oracle_unqname

C:\Users\Administrator>emctl status dbconsole

Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0

Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

https://win-db:1158/em/console/aboutApplication

Oracle Enterprise Manager 11g is running.

------------------------------------------------------------------

Logs are generated in directory C:\app\Administrator\product\11.2.0\dbhome_1/win-db_new02/sysman/log

C:\Users\Administrator>

***************************************************************************

3.2 配置oracle 資料庫控制器

使用emca命令設定資料庫控制器,在使用命令之前,需要滿足如下配置條件

*******************************************************************************

1. Listener port 1521 provided is incorrect. Provide the correct port.

2. Listener is not up. Start the Listener.

3. Database service dbservice is not registered with listener. Register the database service.

4. Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.

5. Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=.

6. /etc/hosts does not have correct entry for hostname.

7. $ORACLE_HOME/database need exist the corresponding password file

*******************************************************************************

1)如下資訊是在oracle_home/database下添加密碼檔案

**************************************************************************

C:\app\Administrator\product\11.2.0\dbhome_1\database>orapwd file=PWDNEWDB.ora entries=20

Enter password for SYS:

2)使用命令建立database control

C:\app\Administrator\product\11.2.0\dbhome_1\database>emca -config dbcontrol db -repos recreate

STARTED EMCA at May 5, 2017 6:22:16 PM

EM Configuration Assistant, Version 11.2.0.3.0 Production

Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:

Database SID: newdb # 資料庫執行個體

Listener port number: 1521 #監聽器連接埠

Listener ORACLE_HOME [ C:\app\Administrator\product\11.2.0\dbhome_1 ]: #監聽器目錄,可以使用lsnrctl status查看

Password for SYS user:

Password for DBSNMP user:

Password for SYSMAN user:

Email address for notifications (optional):

Outgoing Mail (SMTP) server for notifications (optional):

-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ C:\app\Administrator\product\11.2.0\dbhome_1

Local hostname ................ win-db

Listener ORACLE_HOME ................ C:\app\Administrator\product\11.2.0\dbhome_1

Listener port number ................ 1521

Database SID ................ newdb

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------

----------------------------------------------------------------------

WARNING : While repository is dropped the database will be put in quiesce mode.

----------------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: y

部分自動完成資訊省略

INFO: >>>>>>>>>>> The Database Control URL is https://win-db:5500/em <<<<<<<<<<<

May 5, 2017 6:29:30 PM oracle.sysman.emcp.EMDBPostConfig invoke

WARNING:

************************ WARNING ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: C:/app/Administrator/product/11.2.0/dbhome_1/win-db_NEWDB/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************

Enterprise Manager configuration completed successfully

FINISHED EMCA at May 5, 2017 6:29:30 PM

3) 1-5的資訊檢查,都可以使用lsnrctl status命令查看

***************************************************************************

C:\Users\Administrator>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.3.0 - Production on 06-MAY-2017 21:58:16

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=win-db)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for 64-bit Windows: Version 11.2.0.3.0 - Production

Start Date 06-MAY-2017 21:54:30

Uptime 0 days 0 hr. 3 min. 49 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora

Listener Log File C:\app\Administrator\diag\tnslsnr\WIN-DB\listener\alert\log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=win-db)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))

Services Summary...

Service "CLRExtProc" has 1 instance(s).

Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "new02" has 1 instance(s).

Instance "new02", status READY, has 1 handler(s) for this service...

Service "newdb" has 1 instance(s).

Instance "newdb", status READY, has 1 handler(s) for this service...

The command completed successfully

C:\Users\Administrator>

*******************************************************************************

4) /etc/hosts中注意添加IP地址與主機名稱

192.168.56.14 win-db

使用輸入檔案配置EMCA參數

  當你運行EMCA時,使用輸入檔案的方式替代一些列的輸入資訊。你可以指定-respFile參數來指定檔案位置。

emca config dbcontrol db -respFile imput_file_path

在rac環境下使用EMCA

  在rac環境下,使用emca配置命令 emca config dbcontrol db -cluster em_node nodename em_node_list listname,

emca config dbcontrol db -cluster

管理資料庫控制器 啟動與停止oracle資料庫控制器進程

為了通過瀏覽器訪問資料庫控制器,資料庫控制台進程(dbconsole)必須處於運行狀態。

查看資料庫控制台進程的狀態可以使用emctl命令查看,對於windows作業系統,可以查看dbconsole服務狀態。

訪問oracle資料庫首頁

在資料庫控制器中,Oracle 資料庫首頁是主要的資料庫管理網頁。訪問oracle資料庫首頁,需要如下步驟:

  1. 需要確保dbconsole進程在運行

  2. 訪問database control首頁Https://hostname:portnumber/em,在windows作業系統中可以在$oracle_home/install\portlist.ini中查看資料庫配置EM的連接埠

比如說使用database control 啟用與關閉資料庫

建立資料庫控制器管理使用者

為了合理利用資料庫的安全特性,避免使用最高許可權sys/system/sysman進行系統管理。需要對oracle建立資料庫使用者,併合理分配使用者角色與許可權,實現對資料庫控制器(database control)的管理。

在database control中的已經存在的使用者,分配到Administrators 組,具有Administrators許可權

Setup->Administrators->create

非管理使用者訪問database control

非管理使用者訪問database control需要用select_catalog_role角色

刪除與建立database control對象

1. 刪除database control對象

C:\Users\Administrator>emca -deconfig dbcontrol db -repos drop

STARTED EMCA at May 6, 2017 4:58:58 PM

EM Configuration Assistant, Version 11.2.0.3.0 Production

Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:

Database SID: newdb

Listener port number: 1521

Password for SYS user:

Password for SYSMAN user:

建立database control對象

建立database control對象

C:\Users\Administrator>emca -config dbcontrol db -repos recreate

Invalid username/password.

Password for SYSMAN user:

May 6, 2017 5:10:49 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly

管理oracle企業管理資料庫控制器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.