當前位置:首頁 » 雲伺服器 » 如何刪除伺服器上的數據集

如何刪除伺服器上的數據集

發布時間: 2023-01-10 15:39:48

⑴ supermap iDesktop 處理數據集及生成場景緩存

一些相關視頻資料

SuperMap iClient3D for WebGL開發准備: http://support.supermap.com.cn/proct/VedioPlay.aspx?id=189

三維性能優化方法與策略: http://support.supermap.com.cn/proct/VedioPlay.aspx?id=289

註:以下操作均基於SuperMap iDesktop 9D(.NET)版,不同版本菜單及界面稍有不同。

一、數據源處理

1、點擊菜單欄 【開始】→【打開】→【數據源】→選擇數據源文件(UDB格式)

2、數據集類型轉換: CAD 數據集轉換為簡單數據集或模型數據集,轉換為這2種格式後面才能正常生成場景緩存 。如果數據集本身已經是簡單數據集或模型數據集,可跳過這一步。

左鍵選中需要轉換的數據集 →點擊菜單欄【數據】→【類型轉換】→選擇【CAD->簡單】或【CAD->模型】

如果選擇轉換為簡單數據源,將彈出以下界面,選擇需要轉換的源數據(包括數據源及數據集),點擊轉換即可。

如果選擇轉換為模型數據集,將彈出以下界面,直接點擊轉換即可( 如果這個界面沒有顯示數據,需點擊添加源數據按鈕手動添加數據 ,因為supermap會默認轉換當前選中的數據集,如果點擊類型轉換前沒有選中數據集將會出現界面無數據的情況)。

轉換成功後的數據集(這個步驟耗時會比較長,需要耐心等,這里我選擇轉換成模型數據集)

二、數據優化(含 BIM 簡化、移除重復點等)

當需要載入的數據非常大時,即使配置的獨顯再好,也難免出現卡頓掉幀現象。為了提高渲染速度,優化渲染幀率,可進行BIM簡化、移除重復點等操作。

1、添加數據集到球面場景中

點擊工作空間管理器中的【場景】→【新建球面場景】→將上一步轉換成功的簡單或模型數據集拖入新建的球面場景中

2、BIM簡化

菜單欄點擊【對象操作】→【BIM模型】→點擊【BIM簡化】

在彈出來的BIM簡化菜單中,可以選擇是對選中對象還是所有對象進行BIM簡化操作,同時根據需求設定簡化率,簡化率越高,簡化後的模型越粗糙,載入速度越快( 模型是由許多三角面組成的,三角面數越多,模型越精細,BIM簡化其實是過濾三角面數的一個過程,所以簡化後的模型會比原始模型粗糙,對模型精細度有高要求的建議不要進行這步操作 )。

拖動簡化信息下的簡化率後會自動開始BIM簡化,完成後點擊保存。可以查看場景中簡化前及簡化後的幀率信息,可以明顯看到平均幀率提升了,三角面數量也減少了。

幀率信息在場景的左下方可以看到,一般默認都是未開啟的,開啟步驟:場景中右鍵→點擊【屬性】→彈出的場景屬性面板中勾選【幀率信息】

3、移除重復點

重新新建一個球面場景,將上面進行了BIM簡化的數據集拖到新建的球面場景中。

點擊菜單欄【BIM模型】→【移除重復點】

在彈出的移除重復點界面中,可選擇移除的范圍(所有對象或選中對象)和進行參數設置,設置完畢後點擊另存即可。 進行移除重復點主要是移除一些重復的模型數據,例如場景中有許多相同的車子模型,他們除了空間位置信息外,其它的模型數據都相同,那麼實際上只需要保存一份模型數據,然後在不同位置多次繪制即可。

輸出窗口信息,成功移除重復點134個。

三、三維模型數據轉二維面數據

如果項目中有查看二維平面圖或實現二三維地圖聯動效果的需求,就需要把三維模型數據集轉換為二維面數據,進而轉換為二維平面地圖。如果項目不涉及到二維數據可跳過這一步。

1、生成二維面數據

左鍵選中要轉換的三維模型數據集→點擊菜單欄【數據】→【類型轉換】→【模型->二維面】

在彈出的模型數據->二維面數據菜單中,選擇要轉換的模型數據集,點擊轉換即可,轉換需要比較長的時間,具體視電腦配置及數據集數據大小而定。

生成二維面數據集後,雙擊數據集打開如下

2、編輯二維面數據

默認生成的二維數據集是不允許編輯的,如果要對數據集進行刪除、移動等操作,點擊菜單欄【地圖】→【圖層屬性】

在彈出的圖層屬性界面中,勾選【編輯】,就可以在主窗口中對二維面數據進行刪除、移動等操作了。

3、保存為地圖

二維數據需以地圖形式進行數據發布,直接在主窗口中右鍵→點擊【保存地圖】即可

四、生成場景緩存

當所有的數據處理完畢後,需要對處理好的數據進行生成場景緩存操作,如果不生成場景緩存,對於如此大的數據量,瀏覽器直接載入很容易導致卡頓甚至奔潰,載入速度也不理想。

選中最終處理後的數據集→右鍵→生成場景緩存

在彈出的生成場景緩存界面中,緩存類型選擇OSGB,文件類型選擇S3M,瓦片邊長、LOD層數、LOD層級對應的網格簡化率可以使用默認值,如果項目需要也可以根據需求更改,設置完畢後點擊生成。

生成的場景緩存數據會默認保存到當前工作空間所在的目錄

至此,supermap iDesktop 處理數據和生成場景緩存的所有步驟就結束了,接下來只需要把這些數據發布到伺服器即可。生成的數據如何發布詳見寫的另一篇文章: supermap iServer 發布地圖及數據服務

五、前端載入場景緩存

⑵ 重復數據刪除是什麼意思

盡管重復刪除技術已經逐漸成為一項熱門技術,但是很多分析師和用戶都提出,要謹慎的對待它,不要因為廣告大肆宣傳而盲目追捧。

重復數據刪除技術旨在刪除冗餘的備份數據、確保同樣的數據信息只被保存一次。最近,眾多廠商都相繼推出了整合該技術特性的解決方案。與此同時,一些用戶也開始使用這項技術來對海量數據進行管理與控制。

其他一些潛在的用戶在面對五花八門的重復數據刪除方案時也顯得有些無所適從。在這里,專家為用戶列出了以下幾條建議:

1、詳細了解這項技術。盡管現在關於重復數據刪除技術的宣傳鋪天蓋地,但這並不意味著這項技術適合所有用戶應用。StorageIO顧問公司的分析師Greg Schulz表示:「重復數據刪除並不是刪除冗餘數據的唯一方法。」他還說,用戶可以考慮採用其他一些管理、簡化數據的技術。

在這里,他特別提到Storewiz等廠商所提供的數據壓縮技術。他說:「數據壓縮技術的數據刪除率比重復數據刪除低,但是前者的數據刪除率要比後者穩定的多。」所以在通常情況下,數據壓縮技術的可靠性更高。

Storewiz提供的數據壓縮技術不僅可以刪除冗餘的備份數據,而且可以刪除冗餘的主存儲器。與重復數據20:1到50:1之間的數據壓縮率相比,Storewiz的數據壓縮技術的壓縮率則在2:1到5:1之間(取決於數據和應用程序的類型)。

2、明確你的需求是什麼。在應用重復數據刪除技術之前,用戶應該認真地想一想自己到底需要這項技術來實現什麼目標。「重復數據刪除的條件就是存在相同或者類似的信息。」Schulz這樣說道,例如姓名或地址等相同的數據信息很容易被重復數據刪除技術列為要刪除或壓縮的對象。

3、選擇一個合適的、帶有重復數據刪除功能的解決方案。目前,各廠商在其硬體或軟體產品中提供了形式多樣的重復數據刪除技術策略。例如,Data Domain和Quantum推出了一種專門的重復數據應用,而歸屬於EMC的Asigra和Avamar則推出了一種基於軟體的解決方案。此外,FalconStor和Sepaton等廠商還提供了一種為刪除的冗餘數據創建VTL的解決方案。

DragonSlayer咨詢公司的首席分析師Marc Staimer說:「我個人更傾向於將重復數據刪除技術整合加入到軟體產品中的解決方案,這樣我就可以自己決定使用哪一款軟體。」他認為VTL和基於應用的重復數據刪除都是有局限性的。「它限制了操作的靈活性,也就是說,如果我採用了其他廠商提供的VTL,就會帶來許多問題,」

4、Inline processing與Post processing。重復數據刪除技術被分為兩大類:Domain、Diligent等提供的Inline processing和由Sepaton、FalconStor等提供的Post processing。目前,只有昆騰能夠在一個解決方案中既提供Inline processing技術又提供Post processing技術。

Inline processing發生在數據從備份伺服器接收並存儲到磁碟的時候,而Post processing通常發生在備份處理之後,避免了備份和重復數據刪除之間發生沖突。目前,支持Inline processing和Post processing的兩大陣營不分上下,但是又有第三個陣營表示更傾向於將Inline processing和Post processing相互整合。

雖然Post processing技術不會減緩數據備份的處理過程,但是Post processing更適合那些大型企業,因為通常這些大型企業可以為那些還沒有被刪除的冗餘數據提供富餘的存儲空間。

5、提前考慮到安全問題。教育服務提供商Timecruiser的CTO James Wang認為,由於重復數據強調的是單實例存儲,所以這給用戶帶來了新的安全問題。他說:「如果你執行了重復數據刪除,數據信息的多個副本都會被刪除,最後只保留一個副本,於是你就不得不格外謹慎地保留這個副本。」

之前,Timecruiser每天都會保存當天所有的數據副本,而現在它只保存其中的一部分了。為了增強安全性,Wang和他的技術小組正研究向其重復數據刪除的基礎架構中整合加入遠程復制功能,將公司的數據信息復制到一台遠地的存儲設備上。

⑶ 怎麼查看和修改Oracle資料庫伺服器端的字元集

查看的話可以這樣:
select userenv(『language』) from al
修改:
sql>conn / as sysdba; 若此時資料庫伺服器已啟動,則先執行SHUTDOWN IMMEDIATE命令關閉資料庫伺服器,然後執行以下命令:

SQL>STARTUP MOUNT;

SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;

SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;

SQL>ALTER DATABASE OPEN;

SQL>ALTER DATABASE CHARACTER SET ZHS16GBK;

SQL>ALTER DATABASE national CHARACTER SET ZHS16GBK;

SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP

⑷ 調用資料庫的問題

新建一個數據集-----連接資料庫!---綁定表格-----Dataset1.xsd
private void Form1_Load(object sender, System.EventArgs e)
{
for(int i = dataGrid1.Controls.Count -1;i>=0;i--)//循環表格
{
Control ctr = dataGrid1.Controls[i];
if(ctr is DataGridTextBox)//刪除表格中的單元格
{
dataGrid1.Controls.RemoveAt(i);//刪除
}
}
sqlDataAdapter1.Fill(this.dataset11.Flight);
}
private Dataset1.FlightRow currentRow;
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)//表格改變事件CurrentCellChanged
{
this.dataGrid1.Select(dataGrid1.CurrentRowIndex);//選中整行
DataRowView view=(DataRowView)this.BindingContext//綁定數據行視圖[dataset11,"Flight"].Current;
currentRow=(Dataset1.FlightRow)view.Row;
this.txtcode.Text=currentRow.FlightCode;//選中的行在文本框中顯示
this.txtstart.Text=currentRow.Source;
this.txtover.Text=currentRow.Destination;
}
--------------------完整的例子--------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Flight
{
/// <summary>
/// Form1 的摘要說明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.TextBox txtcode;
private System.Windows.Forms.TextBox txtstart;
private System.Windows.Forms.TextBox txtover;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlConnection conn;
private Flight.Dataset1 dataset11;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn4;
/// <summary>
/// 必需的設計器變數。
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 調用後添加任何構造函數代碼
//
}

/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗體設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataset11 = new Flight.Dataset1();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn();
this.txtcode = new System.Windows.Forms.TextBox();
this.txtstart = new System.Windows.Forms.TextBox();
this.txtover = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.conn = new System.Data.SqlClient.SqlConnection();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataset11)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "Flight";
this.dataGrid1.DataSource = this.dataset11;
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 8);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.Brown;
this.dataGrid1.Size = new System.Drawing.Size(312, 208);
this.dataGrid1.TabIndex = 0;
this.dataGrid1.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
this.dataGrid1.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid1_Navigate);
this.dataGrid1.CurrentCellChanged += new System.EventHandler(this.dataGrid1_CurrentCellChanged);
//
// dataset11
//
this.dataset11.DataSetName = "Dataset1";
this.dataset11.Locale = new System.Globalization.CultureInfo("en-US");
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
this.dataGridTextBoxColumn1,
this.dataGridTextBoxColumn2,
this.dataGridTextBoxColumn4});
this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "Flight";
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "航班號";
this.dataGridTextBoxColumn1.MappingName = "FlightCode";
this.dataGridTextBoxColumn1.Width = 75;
//
// dataGridTextBoxColumn2
//
this.dataGridTextBoxColumn2.Format = "";
this.dataGridTextBoxColumn2.FormatInfo = null;
this.dataGridTextBoxColumn2.HeaderText = "起點";
this.dataGridTextBoxColumn2.MappingName = "Source";
this.dataGridTextBoxColumn2.Width = 75;
//
// dataGridTextBoxColumn4
//
this.dataGridTextBoxColumn4.Format = "";
this.dataGridTextBoxColumn4.FormatInfo = null;
this.dataGridTextBoxColumn4.HeaderText = "終點";
this.dataGridTextBoxColumn4.MappingName = "Destination";
this.dataGridTextBoxColumn4.Width = 75;
//
// txtcode
//
this.txtcode.Location = new System.Drawing.Point(336, 24);
this.txtcode.Name = "txtcode";
this.txtcode.Size = new System.Drawing.Size(168, 21);
this.txtcode.TabIndex = 1;
this.txtcode.Text = "";
//
// txtstart
//
this.txtstart.Location = new System.Drawing.Point(336, 72);
this.txtstart.Name = "txtstart";
this.txtstart.Size = new System.Drawing.Size(168, 21);
this.txtstart.TabIndex = 2;
this.txtstart.Text = "";
//
// txtover
//
this.txtover.Location = new System.Drawing.Point(336, 120);
this.txtover.Name = "txtover";
this.txtover.Size = new System.Drawing.Size(168, 21);
this.txtover.TabIndex = 3;
this.txtover.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(344, 152);
this.button1.Name = "button1";
this.button1.TabIndex = 4;
this.button1.Text = "添加";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(344, 192);
this.button2.Name = "button2";
this.button2.TabIndex = 5;
this.button2.Text = "刪除";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(432, 152);
this.button3.Name = "button3";
this.button3.TabIndex = 6;
this.button3.Text = "修改";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(432, 192);
this.button4.Name = "button4";
this.button4.TabIndex = 5;
this.button4.Text = "退出";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Flight", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("FlightCode", "FlightCode"),
new System.Data.Common.DataColumnMapping("Source", "Source"),
new System.Data.Common.DataColumnMapping("Destination", "Destination")})});
this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = "DELETE FROM Flight WHERE (FlightCode = @Original_FlightCode) AND (Destination = @" +
"Original_Destination OR @Original_Destination IS NULL AND Destination IS NULL) A" +
"ND (Source = @Original_Source OR @Original_Source IS NULL AND Source IS NULL)";
this.sqlDeleteCommand1.Connection = this.conn;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_FlightCode", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "FlightCode", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Destination", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Destination", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Source", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Source", System.Data.DataRowVersion.Original, null));
//
// conn
//
this.conn.ConnectionString = "workstation id=PC210;packet size=4096;integrated security=SSPI;initial catalog=Ai" +
"r;persist security info=False";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO Flight(FlightCode, Source, Destination) VALUES (@FlightCode, @Source," +
" @Destination); SELECT FlightCode, Source, Destination FROM Flight WHERE (Flight" +
"Code = @FlightCode)";
this.sqlInsertCommand1.Connection = this.conn;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FlightCode", System.Data.SqlDbType.VarChar, 10, "FlightCode"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Source", System.Data.SqlDbType.VarChar, 50, "Source"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Destination", System.Data.SqlDbType.VarChar, 50, "Destination"));
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT FlightCode, Source, Destination FROM Flight";
this.sqlSelectCommand1.Connection = this.conn;
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE Flight SET FlightCode = @FlightCode, Source = @Source, Destination = @Destination WHERE (FlightCode = @Original_FlightCode) AND (Destination = @Original_Destination OR @Original_Destination IS NULL AND Destination IS NULL) AND (Source = @Original_Source OR @Original_Source IS NULL AND Source IS NULL); SELECT FlightCode, Source, Destination FROM Flight WHERE (FlightCode = @FlightCode)";
this.sqlUpdateCommand1.Connection = this.conn;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FlightCode", System.Data.SqlDbType.VarChar, 10, "FlightCode"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Source", System.Data.SqlDbType.VarChar, 50, "Source"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Destination", System.Data.SqlDbType.VarChar, 50, "Destination"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_FlightCode", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "FlightCode", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Destination", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Destination", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Source", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Source", System.Data.DataRowVersion.Original, null));
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(528, 229);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.txtover);
this.Controls.Add(this.txtstart);
this.Controls.Add(this.txtcode);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.button4);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataset11)).EndInit();
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 應用程序的主入口點。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void button4_Click(object sender, System.EventArgs e)
{
Application.Exit();

}

private void Form1_Load(object sender, System.EventArgs e)
{

for(int i = dataGrid1.Controls.Count -1;i>=0;i--)
{
Control ctr = dataGrid1.Controls[i];
if(ctr is DataGridTextBox)
{
dataGrid1.Controls.RemoveAt(i);
}
}
sqlDataAdapter1.Fill(this.dataset11.Flight);
}
private Dataset1.FlightRow currentRow;
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
{
this.dataGrid1.Select(dataGrid1.CurrentRowIndex);//選中整行
DataRowView view=(DataRowView)this.BindingContext[dataset11,"Flight"].Current;
currentRow=(Dataset1.FlightRow)view.Row;
this.txtcode.Text=currentRow.FlightCode;
this.txtstart.Text=currentRow.Source;
this.txtover.Text=currentRow.Destination;

}

private void button3_Click(object sender, System.EventArgs e)
{
currentRow.FlightCode=this.txtcode.Text;
currentRow.Source=this.txtstart.Text;
currentRow.Destination= this.txtover.Text;
sqlDataAdapter1.Update(this.dataset11.Flight);

}

private void button1_Click(object sender, System.EventArgs e)
{

DataRow newrow = dataset11.Tables[0].NewRow();
newrow[0]=this.txtcode.Text;
newrow[1]=this.txtstart.Text;
newrow[2]=this.txtover.Text;
dataset11.Flight.Rows.Add(newrow);
sqlDataAdapter1.Update(this.dataset11.Flight);

}

private void button2_Click(object sender, System.EventArgs e)
{
currentRow.Delete();
sqlDataAdapter1.Update(this.dataset11.Flight);
MessageBox.Show("刪除成功!!!");

}

private void dataGrid1_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
{

}

}
}
----------------------------資料庫--------------------------------
create database Air
go
use Air
go
create table Flight
(
FlightCode varchar(10) primary key,
Source varchar(50),
Destination varchar(50)
)
go

insert into Flight values('AF0001','廈門','上海')
insert into Flight values('BH8888','廈門','北京')
insert into Flight values('DR8988','北京','上海')
insert into Flight values('UI6766','福州','上海')
insert into Flight values('FG5432','北京','西安')
insert into Flight values('QW4555','蘭州','上海')
insert into Flight values('ES4333','北京','成都')
insert into Flight values('NB5666','南昌','上海')

select * from Flight
-----------------------還要建設一個數據集----------------
選擇項目---添加新建項-----數據集(不要改名)---從伺服器資源管理器(左邊的資料庫)把上面的表格拉到裡面搞定!!!

⑸ dw中怎樣刪除與子網站無關的其他mysql數據

1.建立站點
2.設置好資料庫
3.設置好odbc
4.建立dreamweaver與資料庫的連接
5.使用網路伺服器軟體,設置好運行環境,以便以後預覽網頁。
6.建立數據集
完成這些,就可以使用了。

⑹ 怎樣刪除資料庫中的表而不產生日誌

--只能做最小日誌記錄
alter database 庫名 set recovery simple

--然後刪除記錄

--刪除完成後恢復設置
alter database 庫名 set recovery full

⑺ intel快速存儲技術怎麼卸載

intel快速存儲是不能卸載的。

如果不想它啟動,可以到計算機--管理--服務和應用程序--服務,找到英特爾 快速存儲技術,然後右鍵點擊關閉即可。

⑻ 只修改多表連接的數據集中一個表的數據

在 ADO.NET 數據集中瀏覽多個相關表
以下對象用於表達數據集中的關系:

DataSet - 在內存中表示數據,可以包含多個可與 DataRelation 對象相關的 DataTable 對象。有關詳細信息,請參閱 Introction to Datasets。
DataTable - 表示一個完整的數據表。數據表的架構是由構成該表的 DataColumnCollection 定義的。當兩個數據表相關時,DataRelation 對象使用每個表中的 DataColumn 來關聯數據。有關詳細信息,請參閱 Creating and Using DataTables。
DataRelation - 連接多個表,以便瀏覽相關表中的記錄。訪問相關記錄時,DataRelation 對象被傳遞給 GetChildRows 或 GetParentRow 方法。DataRelation 對象確定所要查詢的相關表,以便返回與 GetChildRows 或 GetParentRow 方法調用相關聯的相關數據。有關詳細信息,請參閱 Introction to DataRelation Objects。
DataRow - 表示數據的一個單獨的記錄。用於返回相關數據的 GetChildRows 方法和 GetParentRow 方法是 DataRow 對象的成員。
DataColumn - 表示一個單獨的欄位,結合在一起時將定義 DataTable 的架構。當兩個數據表相關時,DataRelation 對象使用每個表中的數據列來關聯數據。
創建應用程序
本節將建立這一演練的起點。隨後的步驟將創建數據連接、數據適配器和包含相關表的數據集,以及幾個選擇和顯示數據的控制項。

創建新的 Windows 應用程序

從 File(文件)菜單中,指向 New(新建),並選擇 Project(項目)。將顯示 New Project(新建項目)對話框。
在 Project Types(項目類型)窗格中,根據您需要的編程語言,選擇 Visual Basic Projects(Visual Basic 項目)或 Visual C# Projects(Visual C# 項目)。
在 Templates(模板)窗格中,選擇 Windows Application(Windows 應用程序),並將其命名為 DataRelationExample,然後單擊 OK(確定)。
DataRelationExample 項目將添加到 Solution Explorer(解決方案資源管理器)中。

連接到資料庫
此連接允許您與 Visual Studio® 集成開發環境 (IDE) 中的數據源進行通訊。

連接到 Server Explorer(伺服器資源管理器)中的羅斯文示例資料庫

在 Server Explorer(伺服器資源管理器)中,建立連接到羅斯文示例資料庫的數據連接。有關詳細信息,請參閱 Adding New Data Connections in Server Explorer。
在 Server Explorer(伺服器資源管理器)中展開羅斯文數據連接,直到可以看到所有的表。
創建數據適配器和連接
此步驟創建用於在應用程序和數據源之間連接和交換數據的連接和數據適配器。

創建數據適配器和連接

將「客戶」表從 Server Explorer(伺服器資源管理器)中拖到窗體上。組件欄中將顯示連接和數據適配器。
選擇 Connection(連接)並將 Name 屬性設置為 dcNorthwind。
選擇數據適配器並將 Name 屬性設置為 daCustomers。
將「訂單」表從 Server Explorer(伺服器資源管理器)中拖到窗體上。組件欄中將顯示第二個數據適配器。
選擇新的數據適配器並將 Name 屬性設置為 daOrders。
生成數據集
使用剛剛添加到窗體上的數據適配器生成包含客戶表和訂單表的數據集。

生成將包含相關數據表的數據集

從 Data(數據)菜單中,選擇 Generate Dataset(生成數據集)。將顯示 Generate Dataset(生成數據集)對話框。
提示:將游標移到窗體上即可使用 Data(數據)菜單。
單擊 New(新建)並將數據集命名為 dsNorthwind。
選擇客戶表和訂單表。
選擇 Add this dataset to the designer(將此數據集添加到設計器)復選框,然後單擊 OK(確定)。
Solution Explorer(解決方案資源管理器)的項目中將添加一個名為 dsNorthwind.xsd 的文件,並且組件欄中將顯示該數據集的一個實例。

創建關系
生成數據集並不能自動創建數據集中各表之間的關系。關系可以通過編程創建,也可以使用 XML Designer(XML 設計器)直觀地創建。本文使用 XML Designer(XML 設計器)。

創建客戶表和訂單表之間的關系

在 Solution Explorer(解決方案資源管理器)中,雙擊 dsNorthwind.xsd 文件。文件將在 XML Designer(XML 設計器)中打開。
從工具欄的 XML Schema(XML 架構)選項卡中,將 Relation(關系)拖到訂單表上。
在 Edit Relation(編輯關系)對話框中,設置以下屬性:元素 設置
Name CustomersOrders
Parent Customers
Child Orders
Key Fields CustomerID
Foreign Key Fields CustomerID

單擊 OK(確定)以創建關系並關閉對話框。
從 File(文件)菜單中,選擇 Save All(全部保存)以保存該項目。
顯示數據
此應用程序使用組合框、列表框和 RTF 文本框來選擇和顯示數據。

添加選擇和顯示數據的控制項

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1(.cs 或 .vb,取決於應用程序的語言),然後從快捷菜單中選擇 View Designer(視圖設計器)。
在窗體的左半部,添加一個 ListBox 控制項,並將其 Name 屬性設置為 lbOrders。
在窗體的右半部,添加一個 RichTextBox 控制項,並將其 Name 屬性設置為 rtbDetails。
在列表框的上方,添加一個 ComboBox 控制項,並將其 Name 屬性設置為 cbCustomers。
保存項目。

圖 1:建議的窗體控制項布局

現在,可以開始向應用程序添加功能了。

設置顯示公司名稱的組合框

選擇組合框 (cbCustomers) 並設置以下屬性:屬性 設置
DataSource DsNorthwind1
DisplayMember Customers.CompanyName
ValueMember Customers.CustomerID

用數據填充表
要用數據填充表,必須為應用程序添加代碼。

在數據集 (dsNorthwind1) 中的客戶表和訂單表中填充數據

雙擊窗體上的一塊空白區域,為 Form1_Load 事件創建事件處理程序。
添加以下代碼:
' Visual Basic
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
' 關閉數據集中的約束。
DsNorthwind1.EnforceConstraints = False

' 用數據填充表。
daOrders.Fill(DsNorthwind1)
daCustomers.Fill(DsNorthwind1)

' 重新開啟約束。
DsNorthwind1.EnforceConstraints = True
End Sub

// C#
private void Form1_Load(object sender, System.EventArgs e)
{
// 關閉數據集中的約束。
dsNorthwind1.EnforceConstraints = false;

// 用數據填充表。
daOrders.Fill(dsNorthwind1);
daCustomers.Fill(dsNorthwind1);

// 重新開啟約束。
dsNorthwind1.EnforceConstraints = true;
}
保存項目。
按 F5 鍵運行該應用程序。現在組合框中包含一個公司名稱列表。
關閉窗體。
在兩個表中瀏覽相關記錄
這里簡要介紹一下如何在數據集中構成一對多關系的兩個表之間訪問數據。在選擇一個數據行之後,可以通過調用 GetChildRows 或 GetParentRow 方法並向該數據行傳遞適當的數據關系來返回其相關記錄。

注意:GetChildRows 方法將以 DataRow 對象數組的形式返回數據,而 GetParentRow 方法只返回一個單個的數據行。
要演示這一功能,需要給應用程序添加一些代碼,以返回組合框中選定客戶的所有訂單(子行)。更改組合框中的選定客戶會引發 ComboBox.SelectedIndexChanged 事件,列表框中將填充該選定客戶的每個訂單的訂單 ID。

您可以根據組合框中選定的客戶,調用 GetChildRows 方法。訂單表中的所有相關記錄都將分配給名為 draOrders 的數據行數組。

注意:下一節將添加在列表框中顯示相關訂單列表的功能。為確認數組中確實包含相關的記錄,數組的長度(即選定客戶的訂單總數)將顯示為窗體的標題。
創建獲取選定客戶的訂單的事件處理程序

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1 並從快捷菜單中選擇 View Designer(視圖設計器)。
雙擊組合框為 SelectedIndexChanged 事件創建事件處理程序。
添加以下代碼:
' Visual Basic
Private Sub cbCustomers_SelectedIndexChanged _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles cbCustomers.SelectedIndexChanged
' 聲明一個用來保存選定客戶的客戶 ID 的字元串。
Dim SelectedCustomerID As String
SelectedCustomerID = cbCustomers.SelectedValue.ToString()
' 聲明一個用來保存選定客戶的記錄的數據行。
Dim drSelectedCustomer As DataRow
drSelectedCustomer = _
DsNorthwind1.Customers.FindByCustomerID _
(SelectedCustomerID)

' 聲明一個用來保存相關記錄的數據行數組。
Dim draOrders As DataRow()
draOrders = drSelectedCustomer.GetChildRows("CustomersOrders")
' 在窗體標題中顯示數組的長度(訂單數)
' 和客戶 ID。
Me.Text = draOrders.Length.ToString() & " 訂單所有者 " & _
SelectedCustomerID
End Sub

// C#
private void cbCustomers_SelectedIndexChanged
(object sender, System.EventArgs e)
{
// 聲明一個用來保存選定客戶的客戶 ID 的字元串。
String SelectedCustomerID;
SelectedCustomerID = cbCustomers.SelectedValue.ToString();

// 聲明一個用來保存選定客戶的記錄的數據行。
DataRow drSelectedCustomer;
drSelectedCustomer =
dsNorthwind1.Customers.FindByCustomerID(SelectedCustomerID);

// 聲明一個用來保存相關記錄的數據行數組。
DataRow[] draOrders;
draOrders = drSelectedCustomer.GetChildRows("CustomersOrders");

// 在窗體標題中顯示數組的長度(訂單數)
// 和客戶 ID。
this.Text = draOrders.Length.ToString() +
" 訂單所有者 " + SelectedCustomerID;
}
保存項目。
運行應用程序。
選擇另一個客戶,並檢查窗體標題。將顯示選定客戶的訂單總數及其客戶 ID。

關閉窗體。
顯示相關記錄
現在您已經有了選定客戶的相關記錄(存儲在數據行數組中),您可以顯示它們以便與用戶進行交互。應用程序將逐一訪問 GetChildRows 方法返回的數據行數組中的數據,並將每個相關記錄的「訂單 ID」作為單獨的項添加到列表框中。

注意:雖然此示例將逐一訪問相關數據行數組中的數據,但列表框可能已經使用屬性窗口,通過 DataSource 屬性、DataMember 屬性和 ValueMember 屬性被綁定到相關的記錄。
在列表框中顯示相關記錄

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1 並從快捷菜單中選擇 View Code(查看代碼)。
在前面步驟中創建的組合框的 SelectedIndexChanged 事件處理程序中,將以下代碼添加到處理程序中已有代碼之下:
' Visual Basic
' 當更改選定客戶時,清除訂單列表。
lbOrders.Items.Clear()
rtbDetails.Text = ""

' 將每個相關訂單的訂單 ID 添加到列表框中。
Dim drOrder As DataRow
For Each drOrder In draOrders
lbOrders.Items.Add(drOrder("OrderID"))
Next

// C#
// 當更改選定客戶時,清除訂單列表。
lbOrders.Items.Clear();
rtbDetails.Text = "";

// 將每個相關訂單的訂單 ID 添加到列表框中。
foreach(DataRow drOrder in draOrders)
{
lbOrders.Items.Add(drOrder["OrderID"]);
}
保存項目。
運行應用程序。
列表框中將顯示訂單列表。在組合框中選擇另一個客戶,訂單列表將被更新。

關閉窗體。
在三個或更多表中瀏覽相關記錄
瀏覽三個或更多表與處理兩個表一樣簡單。要了解如何處理兩個以上的表,請將訂單明細表和產品表添加到
dsNorthwind
數據集中。在列表框中選定一個訂單後,該訂單的詳細信息即顯示在 RTF 文本框中。

為了滿足約束規則,您需要刪除現有的數據關系,將來再重新創建。

暫時刪除 dsNorthwind 數據集中的 DataRelation

在 Solution Explorer(解決方案資源管理器)中,雙擊 dsNorthwind.xsd 以在 XML Designer(XML 設計器)中打開它。
選擇現有的 CustomersOrders 關系並將其刪除。
保存項目。
現在您需要將另外兩個表添加到現有數據集中,並創建新的 DataRelation 對象以將所有表連在一起。

將訂單明細表和產品表添加到 dsNorthwind 數據集中

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1 並從快捷菜單中選擇 View Designer(視圖設計器)。
將「訂單明細」表從 Server Explorer(伺服器資源管理器)中拖到窗體上。組件欄中將顯示一個新的數據適配器。
選擇該新的數據適配器並將其 Name 屬性設置為 daOrderDetails。
將「產品」表從 Server Explorer(伺服器資源管理器)中拖到窗體上。組件欄中將顯示一個新的數據適配器。
選擇該新的數據適配器並將其 Name 屬性設置為 daProcts。
新表只是被添加到了窗體上,因此每次添加額外的表時,都必須重新生成數據集。

重新生成 dsNorthwind 數據集

從 Data(數據)菜單中,選擇 Generate Dataset(生成數據集)。
提示:將游標移到窗體上即可使用 Data(數據)菜單。
單擊 Existing(現有),然後選擇 dsNorthwind 數據集。
選擇所有四個表(客戶表、訂單表、訂單明細表和產品表)。
清除 Add this dataset to the designer(將此數據集添加到設計器)復選框,然後單擊 OK(確定)。將生成帶有附加表的數據集。
注意:如果出現一個對話框,其中說明「The file has been modified outside of the source editor. Do you want to reload it?」(文件已在源編輯器之外被修改。是否要重新載入?),請單擊 Yes(是)。
請記住,生成數據集並不能自動創建數據集中各表之間的關系。

創建關系

在 Solution Explorer(解決方案資源管理器)中,雙擊 dsNorthwind.xsd 文件。文件將在 XML Designer(XML 設計器)中打開。
從工具欄的 XML Schema(XML 架構)選項卡中,將 Relation(關系)拖到訂單表上。
在 Edit Relation(編輯關系)對話框中,設置以下屬性:元素 設置
Name CustomersOrders
Parent Customers
Child Orders
Key Fields CustomerID
Foreign Key Fields CustomerID

單擊 OK(確定)以創建關系並關閉對話框。
從工具欄的 XML Schema(XML 架構)選項卡中,將 Relation(關系)拖到訂單明細表上。
在 Edit Relation(編輯關系)對話框中,設置以下屬性:元素 設置
Name OrdersOrderDetails
Parent Orders
Child OrderDetails
Key Fields OrderID
Foreign Key Fields OrderID

單擊 OK(確定)以創建關系並關閉對話框。
從工具欄的 XML Schema(XML 架構)選項卡中,將 Relation(關系)拖到訂單明細表上。
在 Edit Relation(編輯關系)對話框中,設置以下屬性:元素 設置
Name ProctsOrderDetails
Parent Procts
Child OrderDetails
Key Fields ProctID
Foreign Key Fields ProctID

單擊 OK(確定)以創建關系並關閉對話框。
保存項目。
訂單明細表和產品表已被添加到數據集中,但是您仍需要添加代碼,以便在運行時用數據來填充它們。

用數據填充表

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1 並從快捷菜單中選擇 View Code(查看代碼)。
在 Form1_Load 事件處理程序中,將以下代碼添加到注釋「
用數據填充表
」與
daOrders.Fill(dsNorthwind1)
行之間:
' Visual Basic
daOrderDetails.Fill(dsNorthwind1)
daProcts.Fill(dsNorthwind1)

// C#
daOrderDetails.Fill(dsNorthwind1);
daProcts.Fill(dsNorthwind1);
用數據填充 RTF 文本框
現在您要為項目添加代碼,以便在列表框中選定某個訂單時,可以在 RTF 文本框中顯示所有訂單明細。

以下代碼將基於列表框中的選定訂單調用 GetChildRows 方法。訂單明細表中的所有相關記錄都將分配給名為
draOrderDetails
的數據行數組。每個數據行的內容將顯示在 RTF 文本框中。

注意:請注意嵌套的 For Each 循環是如何首先選取一個數據行,然後在該數據行的所有列中循環以訪問整個相關記錄的。
設置 RTF 文本框以顯示所有訂單明細

在 Solution Explorer(解決方案資源管理器)中,右鍵單擊 Form1 並從快捷菜單中選擇 View Designer(視圖設計器)。
雙擊列表框為列表框 lbOrders 的 SelectedIndexChanged 事件創建事件處理程序。
添加以下代碼:
' Visual Basic
Private Sub lbOrders_SelectedIndexChanged _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles lbOrders.SelectedIndexChanged
' 選擇新訂單時,清除 RTF 文本框。
rtbDetails.Clear()

' 聲明一個用來保存選定的訂單 ID 的整數。
Dim SelectedOrderID As Integer
' 將選定的項目設置為整數。
SelectedOrderID = CType(lbOrders.SelectedItem, Integer)

' 聲明一個用來保存選定訂單的記錄的數據行。
Dim drSelectedOrder As DataRow
drSelectedOrder = _
DsNorthwind1.Orders.FindByOrderID(SelectedOrderID)

' 聲明一個用來保存相關記錄的數據行數組。
Dim draOrderDetails() As DataRow
draOrderDetails = _
drSelectedOrder.GetChildRows("OrdersOrderDetails")

Dim details As String = ""
Dim drDetails As DataRow
Dim dcDetails As DataColumn
For Each drDetails In draOrderDetails
For Each dcDetails In drDetails.Table.Columns
details &= dcDetails.ColumnName & ": "
details &= drDetails(dcDetails).ToString()
details &= ControlChars.CrLf
Next
details &= ControlChars.CrLf
Next
rtbDetails.Text = details
End Sub

// C#
private void lbOrders_SelectedIndexChanged
(object sender, System.EventArgs e)
{
// 選擇新訂單時,清除 RTF 文本框。
rtbDetails.Clear();

// 聲明一個用來保存選定的訂單 ID 的整數。
int SelectedOrderID;
// 將選定的項目設置為整數。
SelectedOrderID = (int)lbOrders.SelectedItem;

// 聲明一個用來保存選定訂單的記錄的數據行。
DataRow drSelectedOrder;
drSelectedOrder =
dsNorthwind1.Orders.FindByOrderID(SelectedOrderID);

// 聲明一個用來保存相關記錄的數據行數組。
DataRow[] draOrderDetails;
draOrderDetails =
drSelectedOrder.GetChildRows("OrdersOrderDetails");

string details = "";
foreach(DataRow drDetails in draOrderDetails)
{
foreach(DataColumn dcDetails in drDetails.Table.Columns)
{
details += dcDetails.ColumnName + ": ";
details += drDetails[dcDetails].ToString() + "\n";
}
details += "\n";
}
rtbDetails.Text = details;
}
保存項目。
運行應用程序。
在列表框中選擇一個訂單,其訂單明細將顯示在 RTF 文本框中。
在列表框中選擇另一個訂單。RTF 文本框中的訂單明細將被更新。
瀏覽多對多關系
構成多對多關系的表通常通過保證數據完整性的第三方表進行連接。在羅斯文資料庫中,訂單表和產品表就是這樣相關的。因為有些訂單可能包含很多產品,而有些產品又在很多訂單中銷售。這兩個表是通過訂單明細表連接的,訂單明細表利用這兩個表中的列建立自己特定的列,並使這些數據相關。瀏覽構成多對多關系的三個表與處理一對多關系的表並沒有太大區別。

http://www.microsoft.com/china/MSDN/library/archives/library/dv_vstechart/html/.asp

⑼ 如何查看和修改Oracle資料庫伺服器端的字元集

Oracle資料庫查看和修改伺服器端的字元集的方法是本文主要要介紹的內容,接下來救讓我們一起來了解一下這部分內容。

A、oracle server 端字元集查詢

select userenv('language') from al

其中NLS_CHARACTERSET 為server端字元集

NLS_LANGUAGE 為 server端字元顯示形式

B、查詢oracle client端的字元集

$echo $NLS_LANG

如果發現你select 出來的數據是亂碼,請把client端的字元集配置成與linux操作系統相同的字元集。如果還是有亂碼,則有可能是資料庫中的數據存在問題,或者是oracle服務端的配置存在問題。

C、server端字元集修改

將資料庫啟動到RESTRICTED模式下做字元集更改:

SQL> conn /as sysdba Connected.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount ORACLE instance started.

Total System Global Area 236000356 bytes

Fixed Size 451684 bytes

Variable Size 201326592 bytes

Database Buffers 33554432 bytes

Redo Buffers 667648 bytes

Database mounted.

SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

System altered.

SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;

System altered.

SQL> alter database open;

Database altered.

SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;

ALTER DATABASE CHARACTER SET ZHS16GBK ERROR at line 1:

ORA-12712: new character set must be a superset of old character set

提示我們的字元集:新字元集必須為舊字元集的超集,這時我們可以跳過超集的檢查做更改:

SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;

Database altered.

SQL> select * from v$nls_parameters;



19 rows selected.

重啟檢查是否更改完成:

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup ORACLE instance started.

Total System Global Area 236000356 bytes

Fixed Size 451684 bytes

Variable Size 201326592 bytes

Database Buffers 33554432 bytes

Redo Buffers 667648 bytes

Database mounted.

Database opened.

SQL> select * from v$nls_parameters;



19 rows selected.

我們看到這個過程和之前ALTER DATABASE CHARACTER SET操作的內部過程是完全相同的,也就是說INTERNAL_USE提供的幫助就是使Oracle資料庫繞過了子集與超集的校驗。

這一方法在某些方面是有用處的,比如測試;應用於產品環境大家應該格外小心,除了你以外,沒有人會為此帶來的後果負責。

結語(我們不妨再說一次):

對於DBA來說,有一個很重要的原則就是:不要把你的資料庫置於危險的境地!

這就要求我們,在進行任何可能對資料庫結構發生改變的操作之前,先做有效的備份,很多DBA沒有備份的操作中得到了慘痛的教訓。

D、client端字元集修改

在 /home/oracle與 /root用戶目錄下的。bash_profile中

添加或修改 export NLS_LANG="AMERICAN_AMERICA.UTF8" 語句

關閉當前ssh窗口。

注意:NLS_LANG變數一定要配置正確否則會引起sqlplus 失效。

熱點內容
牙髓存儲 發布:2025-05-09 20:50:22 瀏覽:430
安卓如何看自己去過哪裡 發布:2025-05-09 20:37:23 瀏覽:694
電腦怎麼製作手機版的我的世界伺服器 發布:2025-05-09 20:36:45 瀏覽:532
免流腳本破解 發布:2025-05-09 20:33:49 瀏覽:181
微信圖書館源碼 發布:2025-05-09 20:31:40 瀏覽:954
ucos的配置文件有哪些 發布:2025-05-09 20:25:01 瀏覽:480
租用伺服器如何測速 發布:2025-05-09 20:03:39 瀏覽:790
文件夾左邊 發布:2025-05-09 19:59:21 瀏覽:730
wincc腳本從入門到精通 發布:2025-05-09 19:35:39 瀏覽:894
網路電腦配置哪個好 發布:2025-05-09 19:35:02 瀏覽:273