?
? ????? PHP ??? ???? ??? ?? ??
修改ORACLE7數(shù)據(jù)庫maxdatafiles參數(shù)的方法
2000/04/13?
|
? |
在安裝ORACLE7時,一般對maxdatafiles(數(shù)據(jù)文件的最大個數(shù))參數(shù)值不加修改或未意識到對
其修改,而使用其默認值(往往比需要值要?。?。但隨著數(shù)據(jù)量的增多,需要不斷地往表空間內(nèi)增加數(shù)據(jù)文件,但是maxd
atafiles的值限定了數(shù)據(jù)文件的最大個數(shù),數(shù)據(jù)文件個數(shù)增加到最大值后,若再繼續(xù)追加,就會導致“數(shù)據(jù)文件個數(shù)
超過了最大值”的錯誤,以至后邊的數(shù)據(jù)無法存入。 數(shù)據(jù)文件的最大個數(shù)因操作系統(tǒng)的不同而不同,但是,現(xiàn)在運行著的ORACLE7數(shù)據(jù)庫中,數(shù)據(jù)文件的最大個數(shù)
可以達到1000個以上,即maxdatafiles的參數(shù)值可設為1000或更大,遠遠大于其安裝時的默認值(本系
統(tǒng)安裝時的默認值為30),如果遇到了“數(shù)據(jù)文件個數(shù)超過了最大值”的問題時,可通過修改maxdatafiles參
數(shù)來解決,下面就介紹一下具體的修改方法: 1.實驗環(huán)境 ALPHA8200服務器,操作系統(tǒng)Digial UNIX V3.2C,Oracle7.2數(shù)據(jù)庫。 2.準備工作 啟動ORACLE數(shù)據(jù)庫,進行下列操作: $sqldba mode=line(回車) SQLDBA>connect internal(回車) SQLDBA>alter database backup controlfile to trace;(
回車) SQLDBA>show parameter user_dump_dest(回車) 可以看到trace文件“ora_3044.trc”在/volora/oracle/rdbms/log目
錄下。 將trace文件/volora/oracle/rdbms/log/ora_3044.trc拷貝成 df
ileadd.sql。 用vi編輯dfileadd.sql文件,修改maxdatafiles參數(shù)(由原來的30改為300)。 Dfileadd.sql文件如下: Dump file/volora/oracle/rdbms/log/ora_3044.trc Oracle7 Server Release7.2.2.3.0 with the64-bit opti
on- Production Release With the distributed and parallel query options PL/SQL Release2.2.2.3.0- Production ORACLE_HOME=/volora/oracle ORACLE_SID= ora72 Oracle process number:8 Unix process id:3044 System name: OSF1 Node name: slserver.sl.cnpc.co.cn Release: V3.2 Version:148 Machine: alpha Wed Apr2315:54:281997 Wed Apr2315:54:281997 *** SESSION ID:(9.1455)1997.04.23.15.54.28.359 # The following commands will create a new control
file and use it # to open the database. # No data other than log history will be lost. Addi
tional logs may # be required for media recovery of offline data fi
les. Use this # only if the current version of all online logs ar
e available. STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE"ORA72" NORESETLOG
S NOARCHIVELOG MAXLOGFILES32 MAXLOGMEMBERS2 MAXDATAFILES300 MAXINSTANCES8 MAXLOGHISTORY800 LOGFILE GROUP1'/volora/oracle/dbs/log1ora72.dbf' SIZE500K, GROUP2'/volora/oracle/dbs/log2ora72.dbf' SIZE500K, GROUP3'/volora/oracle/dbs/log3ora72.dbf' SIZE500K DATAFILE '/volora/oracle/dbs/systora72.dbf', '/volora/oracle/dbs/rbsora72.dbf', '/volora/oracle/dbs/tempora72.dbf', '/volora/oracle/dbs/toolora72.dbf', '/volora/oracle/dbs/usrora72.dbf', '/volora/oracle/dbs/jhc.dbf', '/volora/oracle/dbs/useradd.dbf' ; # Recovery is required if any of the datafiles are
restored backups, # or if the last shutdown was not normal or immedia
te. RECOVER DATABASE # Database can now be opened normally. ALTER DATABASE OPEN; 將以上dfileadd.sql文件中橫線上沒用的斜體部分行刪掉,存盤。 最后關閉數(shù)據(jù)庫,并做好數(shù)據(jù)庫的備份,包括數(shù)據(jù)和控制文件的備份,起碼要用export將數(shù)據(jù)全部卸出。有條
件的話,盡量做全備份,預防在數(shù)據(jù)庫重建失敗后癱瘓,因為下一步工作牽扯到對數(shù)據(jù)庫的破壞和重新生成工作。 3.修改maxdatafiles參數(shù)的過程 3.1刪除/volora/oracle/dbs目錄下面所有的控制文件(共3個): $rm*.ctl(回車) 3.2重新生成數(shù)據(jù)庫(生成新的控制文件、數(shù)據(jù)文件等) $sqldba mode=line(回車) SQLDBA>connect internal(回車) 運行dfileadd.sql: SQLDBA>@dfileadd.sql(回車) ORACLE instance started. Statement processed. Media recovery complete. Statement processed. SQLDBA>alter database open noresetlogs;(回車) 至此,數(shù)據(jù)庫的刷新工作已完成,可以投入正常運行了,目前運行著的ORACLE7數(shù)據(jù)庫,數(shù)據(jù)文件最多可建立
到300個。 在Windows 95下有一個任務欄可隨時用鼠標單擊任務欄上的應用程序圖標切換到相應的程序,在Wind
ows 3.X下要切換應用程序使用的方法有兩種,一種是用ALT+TAB切換,另一種是用CTRL+ESC(或在桌
面的空白處雙擊鼠標)打開任務列表從中選擇切換,筆者在使用中總感到不如在Windows 95下那樣方便。本文提供
一個用VB 3.0專業(yè)版在Windows 3.2中文版下編寫的程序,可實現(xiàn)將任務列表一直顯示在屏幕上,隨時可用
鼠標雙擊任務列表中的程序名字切換,類似與Windows 95下的任務欄,使用很方便。 實現(xiàn)方法:在窗體中加入一列表框,將檢測到的所有已打開的應用程序加入其中,用戶就可以雙擊應用程序名字來切
換了。這里還有一個將其常居頂端的問題,這方面的實現(xiàn)方法在許多報刊雜志上都可以看到,本文不再敘述,本文只給出其余
功能的實現(xiàn)程序。 本程序在開始運行時檢測已運行的應用程序并將它們加入到任務列表框中,當此后再有新的應用程序打開時,需要將
其添加到列表框中,所以設計了一個刷新按鈕,如果有新的應用程序打開,可點一下它。 另外類似與Windows 本身
的任務列表功能,加入了一個切換按鈕,當用戶在任務列表中單擊選擇任務后,單擊切換按鈕也可切換,此外還有一個退出按
鈕用來關閉任務列表。 程序如下: 在窗體中加入如下對象并設置屬性: 按鈕1 Caption="刷新" name=cmdrefresh 按鈕2 Caption="切換" name=cmdswitch 按鈕3 Caption="退出" name=cmdexit 列表框list name=lstApp 將窗體形狀拉成長條狀,安排好對象位置,以便減少屏幕占用空間,將其邊框屬性改為固定邊框,不允許改變大小。
在總體聲明部分寫如下代碼: '聲明用到的API函數(shù)和常量 Option Explicit Declare Function ShowWindow Lib"User"(ByVal hWnd As
Integer, ByVal flgs As Integer) As Integer Declare Function GetWindow Lib"User"(ByVal hWnd As
Integer, ByVal wCmd As Integer) As Integer Declare Function GetWindowWord Lib"User"(ByVal hWnd
As Integer, ByVal wIndx As Integer) As Integer Declare Function GetWindowLong Lib"User"(ByVal hWnd
As Integer, ByVal wIndx As Integer) As Long Declare Function GetWindowText Lib"User"(ByVal hWnd
As Integer, ByVal lpSting As String, ByVal nMaxCount As
Integer) As Integer Declare Function GetWindowTextLength Lib"User"(ByVa
l hWnd As Integer) As Integer Declare Function SetWindowPos Lib"User"(ByVal hWnd
As Integer, ByVal insaft As Integer, ByVal x%, ByVal y%
, ByVal cx%, ByVal cy%, ByVal flgs As Integer) As Integ
er '注:上面的API函數(shù)要寫在一行中 Const WS_MINIMIZE=&H20000000 Const HWND_TOP=0 Const SWP_NOSIZE=&H1 Const SWP_NOMOVE=&H2 Const SWP_SHOWWINDOW=&H40 Const GW_HWNDFIRST=0 Const GW_HWNDNEXT=2 Const GWL_STYLE=(-16) Const SW_RESTORE=9 Const WS_VISIBLE=&H10000000 Const WS_BORDER=&H800000 Const WS_CLIPSIBLINGS=&H4000000 Const WS_THICKFRAME=&H40000 Const WS_GROUP=&H20000 Const WS_TABSTOP=&H10000 Dim IsTask As Long '尋找已打開的應用程序函數(shù) Sub FindAllApps() Dim hwCurr As Long Dim intLen As Long Dim strTitle As String lstApp.Clear hwCurr= GetWindow(Me.hWnd, GW_HWNDFIRST) Do While hwCurr If hwCurr Me.hWnd And TaskWindow(hwCurr) Then intLen= GetWindowTextLength(hwCurr)+1 strTitle= Space$(intLen) intLen= GetWindowText(hwCurr, strTitle, intLen) If intLen>0 Then lstApp.AddItem strTitle lstApp.ItemData(lstApp.NewIndex)= hwCurr End If End If hwCurr= GetWindow(hwCurr, GW_HWNDNEXT) Loop End Sub Function TaskWindow(hwCurr As Long) As Long Dim lngStyle As Long lngStyle= GetWindowLong(hwCurr, GWL_STYLE) If(lngStyle And IsTask)= IsTask Then TaskWindow= Tr
ue End Function 雙擊“退出”按鈕,寫如下代碼: Sub Cmdexit_Click() Unload Me End Sub 雙擊“刷新”按鈕,寫如下代碼: Sub Cmdrefresh_Click() FindAllApps'刷新任務列表 End Sub 雙擊“切換”按鈕,寫如下代碼: Sub Cmdswitch_Click() Dim hWnd As Long Dim x As Long Dim lngWW As Long If lstApp.ListIndex
hWnd= lstApp.ItemData(lstApp.ListIndex) lngWW= GetWindowLong(hWnd, GWL_STYLE) If lngWW And WS_MINIMIZE Then x= ShowWindow(hWnd, SW_RESTORE) End If x= SetWindowPos(hWnd, HWND_TOP,0,0,0,0, SWP_NOMOVE
Or SWP_NOSIZE Or SWP_SHOWWINDOW) End Sub 雙擊窗體,寫如下代碼: Sub Form_Load() IsTask= WS_VISIBLE Or WS_BORDER FindAllApps End Sub 窗體更新時刷新任務列表: Sub Form_Paint() FindAllApps End Sub雙擊列表框寫如下代碼: Sub lstApp_DblClick() Switch.Value= True End Sub
|