10.2.0.1.1 grid control的啟動和關閉,10.2.0.1.1grid
一、Stopping Grid Control and All Its Components
1.停止OMS服務[oracle@ocm2 oms10g]$ cd /u01/app/oracle/OracleHomes/oms10g/bin/[oracle@ocm2 bin]$ ./emctl stop omsOracle Enterprise Manager 10g Release 10.2.0.1.0 Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.Oracle Management Server is Down.[oracle@ocm2 bin]$ 2.停止Application Server Control Console[oracle@ocm2 bin]$ ./emctl stop iasconsoleOracle Enterprise Manager 10g Release 10.2.0.1.0 Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Stopping Oracle 10g Application Server Control ... ... Stopped. [oracle@ocm2 bin]$ 3.切換目錄至OPMN並停止Application Server components[oracle@ocm2 oms10g]$ cd opmn/[oracle@ocm2 opmn]$ cd bin/[oracle@ocm2 bin]$ pwd/u01/app/oracle/OracleHomes/oms10g/opmn/bin[oracle@ocm2 bin]$ ./opmnctl stopallopmnctl: stopping opmn and all managed processes...[oracle@ocm2 bin]$ 4.切換目錄並停止agent
[oracle@ocm2 bin]$ pwd/u01/app/oracle/OracleHomes/agent10g/bin[oracle@ocm2 bin]$ ./emctl stop agentOracle Enterprise Manager 10g Release 10.2.0.1.0. Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.Stopping agent ... stopped.[oracle@ocm2 bin]$ 5.停止Repository資料庫[oracle@ocm2 bin]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 22 18:15:48 2014
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining options
SYS@EMREP> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SYS@EMREP> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining options[oracle@ocm2 bin]$ 6.停止Repository資料庫監聽程式[oracle@ocm2 bin]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 22-JUL-2014 18:17:53
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ocm2.localdomain)(PORT=1521)))The command completed successfully[oracle@ocm2 bin]$ 停止結束
二、Starting Grid Control and All Its Components
1.啟動Repository資料庫對應的監聽程式和資料庫(注意SID)[oracle@ocm2 bin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 22-JUL-2014 18:20:06
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.2.0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm2.localdomain)(PORT=1521)))Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ocm2.localdomain)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 10.2.0.2.0 - ProductionStart Date 22-JUL-2014 18:20:06Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.logListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm2.localdomain)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))Services Summary...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully[oracle@ocm2 bin]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 22 18:20:30 2014
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to an idle instance.
SYS@EMREP> startupORACLE instance started.
Total System Global Area 285212672 bytesFixed Size 1260420 bytesVariable Size 125830268 bytesDatabase Buffers 155189248 bytesRedo Buffers 2932736 bytesDatabase mounted.Database opened.SYS@EMREP> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining options[oracle@ocm2 bin]$ 2.切換路徑並啟動OMS[oracle@ocm2 bin]$ cd /u01/app/oracle/OracleHomes/oms10g/bin/[oracle@ocm2 bin]$ pwd/u01/app/oracle/OracleHomes/oms10g/bin[oracle@ocm2 bin]$ ./emctl start omsOracle Enterprise Manager 10g Release 10.2.0.1.0 Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.opmnctl: opmn startedStarting HTTP Server ...Starting Oracle Management Server ...Checking Oracle Management Server Status ...Oracle Management Server is Up.[oracle@ocm2 bin]$ 3.切換路徑啟動OracleAS Web Cache[oracle@ocm2 bin]$ pwd/u01/app/oracle/OracleHomes/oms10g/opmn/bin[oracle@ocm2 bin]$ ./opmnctl status
Processes in Instance: EnterpriseManager0.ocm2.localdomain-------------------+--------------------+---------+---------ias-component | process-type | pid | status -------------------+--------------------+---------+---------DSA | DSA | N/A | Down HTTP_Server | HTTP_Server | 17072 | Alive LogLoader | logloaderd | N/A | Down dcm-daemon | dcm-daemon | 17039 | Alive OC4J | home | N/A | Down OC4J | OC4J_EMPROV | N/A | Down OC4J | OC4J_EM | 17116 | Alive WebCache | WebCache | N/A | Down WebCache | WebCacheAdmin | N/A | Down
[oracle@ocm2 bin]$ ./opmnctl startproc ias-component=WebCacheopmnctl: starting opmn managed processes...[oracle@ocm2 bin]$ ./opmnctl status
Processes in Instance: EnterpriseManager0.ocm2.localdomain-------------------+--------------------+---------+---------ias-component | process-type | pid | status -------------------+--------------------+---------+---------DSA | DSA | N/A | Down HTTP_Server | HTTP_Server | 17072 | Alive LogLoader | logloaderd | N/A | Down dcm-daemon | dcm-daemon | 17039 | Alive OC4J | home | N/A | Down OC4J | OC4J_EMPROV | N/A | Down OC4J | OC4J_EM | 17116 | Alive WebCache | WebCache | 17205 | Alive WebCache | WebCacheAdmin | 17197 | Alive
[oracle@ocm2 bin]$4.切換路徑並啟動agent
[oracle@ocm2 bin]$ pwd/u01/app/oracle/OracleHomes/agent10g/bin[oracle@ocm2 bin]$ ./emctl start agentOracle Enterprise Manager 10g Release 10.2.0.1.0. Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.Starting agent ..... started.[oracle@ocm2 bin]$最後確認ias-component全部已經啟動[oracle@ocm2 bin]$ cd /u01/app/oracle/OracleHomes/oms10g/opmn/bin/[oracle@ocm2 bin]$ ./opmnctl status
Processes in Instance: EnterpriseManager0.ocm2.localdomain-------------------+--------------------+---------+---------ias-component | process-type | pid | status -------------------+--------------------+---------+---------DSA | DSA | N/A | Down HTTP_Server | HTTP_Server | 17072 | Alive LogLoader | logloaderd | N/A | Down dcm-daemon | dcm-daemon | 17039 | Alive OC4J | home | N/A | Down OC4J | OC4J_EMPROV | N/A | Down OC4J | OC4J_EM | 17116 | Alive WebCache | WebCache | 17205 | Alive WebCache | WebCacheAdmin | 17197 | Alive
[oracle@ocm2 bin]$ ./opmnctl startproc ias-component=DSAopmnctl: starting opmn managed processes...[oracle@ocm2 bin]$ ./opmnctl startproc ias-component=LogLoaderopmnctl: starting opmn managed processes...[oracle@ocm2 bin]$ ./opmnctl startproc ias-component=OC4Jopmnctl: starting opmn managed processes...[oracle@ocm2 bin]$ ./opmnctl status
Processes in Instance: EnterpriseManager0.ocm2.localdomain-------------------+--------------------+---------+---------ias-component | process-type | pid | status -------------------+--------------------+---------+---------DSA | DSA | 18173 | Alive HTTP_Server | HTTP_Server | 17072 | Alive LogLoader | logloaderd | 18197 | Alive dcm-daemon | dcm-daemon | 17039 | Alive OC4J | home | 18326 | Alive OC4J | OC4J_EMPROV | 18324 | Alive OC4J | OC4J_EM | 17116 | Alive WebCache | WebCache | 17205 | Alive WebCache | WebCacheAdmin | 17197 | Alive
[oracle@ocm2 bin]$
gridcontrol使用
private void mnuLoad_Click(object sender, System.EventArgs e)
{
// TODO: Load Customers
Database db = null;
db = DatabaseFactory.CreateDatabase();
DataSet ds = db.ExecuteDataSet(
CommandType.Text,
"SELECT ID,Name,Age From UserInfo");
gridControl1.DataSource = ds.Tables[0];
//設定成一次選擇一行,並且不能被編輯
this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
this.gridView1.OptionsBehavior.Editable = false;
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
//設定列的標題
gridView1.Columns[0].Caption = "編號";
gridView1.Columns[1].Caption = "名稱";
gridView1.Columns[2].Caption = "年齡";
//設定列的名稱,便於進行分組和Foot的統計等資訊顯示
gridView1.Columns[0].Name = "ID";
gridView1.Columns[1].Name = "Name";
gridView1.Columns[2].Name = "Age";
//增加一個Group列進行分組
this.gridView1.GroupSummary.AddRange(new DevExpress.XtraGrid.GridSummaryItem[] {
new DevExpress.XtraGrid.GridGroupSummaryItem(DevExpress.Data.SummaryItemType.Count, "ID", null, "(Count={0})")});
//增加一個Group列進行分組
this.gridView1.GroupSummary.AddRange(new DevExpress.XtraGrid.GridSumm......餘下全文>>
gridControl1裡面添加內建分頁條,點擊刪除按鈕後gridview會顯示刪除兩行?(實際上只刪除了一行)怎消除?
點擊刪除 會刪除兩行到是個問題、
你在發現這個問題的時候,需要查明這個問題是怎麼影響到的。
就本人以往的編碼習慣上說,可能會用下面的方式做這塊實現:
1,gridview 資料繫結。
DataTable dt = DBUtil.GetDateBind(/..../);這個是從資料庫查處資料來源;
GridView1.DataSource=dt;這個是給Gridview 資料來源
GridView1.DataBind();這個是GridView 的資料繫結
2,你添加了刪除按鈕。不知道你的刪除按鈕是怎麼寫的呢??(2種:I:用checkbox做選擇,然後在GridView 上面 放一個 刪除 的linkbutton 即可;II:每一行放一個 刪除 的linkbutton)
至於第一種:你可以迴圈 GridViewRows,然後用FindControl 去找到每行的 checkbox ,看是否被選,選中的存到一個string 裡面,如果有兩個的話 就是 string sid = " 'a1','a1' ";然後用 delete from table1 where ID in (sid);即可。
第二種:你可能 需要 在刪除的 linkbutton 的CommandName 和 CommandArgument 上寫上刪除 ,例:CommandName ="ufdel" CommandArgument =“<%# Eval(“...”)%>”,然後你可以在 RowCommand 事件中 用 if(e.CommandName == "ufdel"){...這裡就是刪除的代碼.},ok了。
3,刪除完了。那麼就需要從新做一次資料繫結:
DataTable dt = DBUtil.GetDateBind(/..../);這個是從資料庫查處資料來源;
GridView1.DataSource=dt;這個是給Gridview 資料來源
GridView1.DataBind();這個是GridView 的資料繫結
重複 第一步即可。