Archive for the 'Databases' Category存檔為'數據庫'類別

How to Rename or Move Oracle Tablespace Datafile to Another Location如何重新命名或移動甲骨文表datafile到另一個位置

Saturday, August 4th, 2007 週六, 2007年8月4日

Oracle database does not provide an easy user interface to rename a datafile of tablespace, nor database administrator can easily move or relocate the datafile to another location or directory that different from original location on creation of database. Oracle數據庫不提供一種簡單的用戶界面,來重新命名datafile的表,也不是數據庫管理員可以輕鬆地移動或遷移datafile到另一個位置或目錄不同,從原來的位置上建立數據庫。 The rename or move place task has to be performed via Oracle SQLPlus command line interface.該重新命名或移動的地方,任務是要通過演出,甲骨文sqlplus命令行界面。 However, if the operation is performed when the tablespace which owns the datefile is online, error will occur.不過,如果運作時執行表,其中擁有datefile是在線,錯誤會發生。

Continue reading How to Rename or Move Oracle Tablespace Datafile to Another Location » » »繼續閱讀如何重新命名或移動甲骨文表datafile到另一個位置» » »


How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile如何下拉表和恢復Oracle數據庫時,不小心刪除datafile

Saturday, August 4th, 2007 週六, 2007年8月4日

Accident may happens, even though it’s costly one.意外可能發生,即使它的代價之一。 This is especially the case in Oracle database, which stores the database objects physically in data files on hard disk.這是個案,尤其是在Oracle數據庫中,存儲數據庫對象身在數據文件的硬盤。 Fast hand administrators may accidentally delete some of the datafiles, or the datafiles may get corrupted or unreadable on hard disk failure.快速,一方面管理員可能會不小心刪除部分的datafiles ,或datafiles可能損壞或無法讀取的硬盤失敗。 You may get also some missing datafiles after database recovery process.您可能會收到也有一些失踪datafiles後,數據庫恢復的過程。 In any case, missing a or a few datafiles will cause Oracle database to fail to startup, rendering the whole DB inaccessible.在任何情況下,缺少一個或少數幾個datafiles會導致Oracle數據庫無法啟動,使整個分貝無法使用。

Continue reading How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile » » »繼續閱讀如何下拉表和恢復Oracle數據庫時,不小心刪除datafile » » »

How to Remove and Drop Datafiles from Tablespace in Oracle Database如何刪除和下拉datafiles從表在Oracle數據庫

Saturday, August 4th, 2007 週六, 2007年8月4日

Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files.甲骨文RDBMS的數據庫存儲數據,在邏輯上的形式,表及身體,在形式的數據文件。 The datafiles are added to the tablespaces as database space requirement grows bigger.該datafiles被添加到該表作為數據庫空間的要求,更大的增長。 However, there are several reasons you may want to remove or delete data files from a tablespace.不過,有幾個原因,您可能會想要移除或刪除數據文件從表。 Such as accidentally add a wrongly sized or unwanted datafile to a tablespace, or the data space usage has became smaller and some data files want to be removed, or attempt to recover Oracle database which fails to start due to missing or corrupted datafiles by removing them, Oracle does not provide an easy way or user interface to delete or drop datafiles from a tablespace.如不小心添加一個錯誤的大中型或有害datafile一個表,或數據空間的使用已成為規模較小的一些數據文件要被刪除,或企圖以收回Oracle數據庫,其中無法啟動,因丟失或損壞的datafiles消除他們,甲骨文公司並沒有提供一個簡單的方法或用戶界面,刪除或下降datafiles從表。 Once a datafile is made part of a tablespace, it can no longer be detached or removed from the tablespace, albeit there are several workarounds.一旦datafile作出的一個組成部分,表,它再也不能超脫或刪除表,雖然有幾個變通辦法。

Continue reading How to Remove and Drop Datafiles from Tablespace in Oracle Database » » »繼續閱讀如何刪除和下拉datafiles從表在Oracle數據庫» » »

How to Backup and Restore (Export and Import) MySQL Databases Tutorial如何備份和恢復(出口和進口)的MySQL數據庫補習

Saturday, July 21st, 2007 週六, 2007年7月21日

phpMyAdmin can be used to export or backup MySQL databases easily. phpmyadmin可以用來出口或備份的MySQL數據庫容易。 However, if the database size is very big, it probably won’t be a good idea.不過,如果數據庫大小是非常大的,它可能不會是一個好主意。 phpMyAdmin allows users to save database dump as file or display on screen, which involves exporting SQL statements from the server, and transmitting the data across slower network connection or Internet to user’s computer. phpmyadmin允許用戶保存數據庫轉儲文件或顯示在屏幕上,其中涉及出口的SQL語句,從服務器,並轉遞數據慢,網絡連接或互聯網用戶的計算機上。 This process slow the exporting process, increase database locking time and thus MySQL unavailability, slow the server and may simply crash the Apache HTTPD server if too many incoming web connections hogging the system’s resources.這個過程緩慢,出口過程中,增加數據庫鎖定時間,從而MySQL的欠缺,緩慢服務器和可能只是墜毀的Apache的httpd服務器如果有太多傳入的Web連接荒加工系統的資源。

Continue reading How to Backup and Restore (Export and Import) MySQL Databases Tutorial » » »繼續閱讀如何備份和恢復(出口和進口)的MySQL數據庫補習» » »


MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL的錯誤1170 ( 42000 ) : BLOB的/文本列中使用的主要規格,沒有一個密鑰長度

Monday, July 9th, 2007 週一, 2007年7月9日

When creating a new table or altering an existing table with primary keys, unique constraints and indexes, or when defining a new index with Alter Table manipulation statement in MySQL database, the following error may occur and prohibit the the command from completing:當創建一個新表或改變現有的資料表與主鍵,獨特的制約因素和指標,或當確定一個新的指數與改變表操縱的聲明在MySQL數據庫,下面的錯誤,可能會出現和禁止命令完成:

ERROR 1170 (42000): BLOB/TEXT column ‘field_name’ used in key specification without a key length錯誤1170 ( 42000 ) : BLOB的/純文字欄' field_name '用在關鍵的規格沒有一個密鑰長度

Continue reading MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length » » »繼續閱讀MySQL的錯誤1170 ( 42000 ) : BLOB的/文本列中使用的主要規格,沒有一個密鑰長度» » »

Remove or Trim First or Last Few Characters in MySQL Database with SQL刪除或修剪第一或過去數字符在MySQL數據庫與SQL

Monday, April 23rd, 2007 週一, 2007年4月23日

Another useful string function in MySQL database is TRIM() which will return a text string after removing the matching leading or trailing characters, also known as prefixes or suffixes.另一個有用的字符串函數在MySQL數據庫是修剪( )將返回一個文本字符串後,刪除匹配前導或尾隨字符,也稱為前綴或後綴。 It’s been described by MySQL reference as function that returns the string str with all remstr prefixes or suffixes removed.它的被稱為由MySQL參考函數返回字符串個STR與所有remstr前綴或後綴刪除。 If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed.如果沒有該說明兩者,領導,或尾隨,給出了兩種假設。 remstr is optional and, if not specified, spaces are removed. remstr是可選的,如果沒有指定,空間都將被刪除。

Continue reading Remove or Trim First or Last Few Characters in MySQL Database with SQL » » »繼續讀刪除或修剪第一或過去數字符在MySQL數據庫與SQL » » »

How to Find and Replace Text in MySQL Database using SQL如何查找和替換文本在MySQL數據庫中使用SQL

Monday, April 23rd, 2007 週一, 2007年4月23日

MySQL database has a handy and simple string function REPLACE() that allows table data with the matching string (from_string) to be replaced by new string (to_string). MySQL數據庫有一個方便簡單的字符串函數取代( ) ,允許表中的數據與匹配字符串( from_string ) ,以取代新的字符串( to_string ) 。 This is useful if there is need to search and replace a text string which affects many records or rows, such as change of company name, postcode, URL or spelling mistake.這是非常有用的,如果有需要的搜索和替換文本字符串的影響,許多紀錄或行,如更改公司名稱,郵政編碼,網址或拼寫錯誤。

Continue reading How to Find and Replace Text in MySQL Database using SQL » » »繼續閱讀如何查找和替換文本在MySQL數據庫使用SQL » » »

How to Escape Characters in Oracle PL/SQL Queries如何轉義字符在Oracle PL / SQL的疑問

Saturday, March 24th, 2007 週六, 2007年3月24日

Oracle databases reserve some special characters with specific meaning and purpose within Oracle environment. Oracle數據庫儲備一些特殊字符與特定的含義和目的內部的Oracle環境。 These reserved characters include _ (underscore) wild card character which used to match exactly one character, % (percentage) which used to match zero or more occurrences of any characters and ‘ (apostrophe or quotation mark) which used to mark the value supplied.這些保留字符,包括_ (下劃線)外卡的特點,其中,用於匹配,正是一個字符, % (百分比) ,其中用於匹配零個或多個發生的任何字符和' (單引號或引號) ,用來標誌提供的值。 These special characters will not be interpreted literally when building SQL query in Oracle, and may caused error in results returned especially when performing string search with LIKE keyword.這些特殊字符將不會字面解釋時,建設SQL查詢在Oracle中,並可能造成的錯誤,在返回的結果,尤其是當表演字符串搜索與關鍵字一樣。 To use these characters so that Oracle can interpret them literally as a part of string value instead of preset mean, escape character has to be assigned.使用這些字符,使甲骨文公司可以解釋他們在字面上的一個組成部分字符串值,而不是預設的意思是,轉義字符已經被指派。

Continue reading How to Escape Characters in Oracle PL/SQL Queries » » »繼續閱讀如何轉義字符在Oracle PL / SQL的查詢» » »