Archive for the 'Databases' Category档案中'数据库'类别

How to Rename or Move Oracle Tablespace Datafile to Another Location如何重命名或移动甲骨文表空间数据文件到另一个位置

Saturday, August 4th, 2007 星期六, 07年八月四日

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.甲骨文公司的数据库没有提供一种简单的用户界面,重新命名数据文件的表空间,也不数据库管理员可以轻松地移动或迁移数据文件到另一个位置或目录,不同的从原来的位置上建立数据库。 The rename or move place task has to be performed via Oracle SQLPlus command line interface.在重命名或移动位置的任务是通过Oracle履行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 » » »继续阅读如何重命名或移动甲骨文表空间数据文件到另一个位置» » »


How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile如何减少表空间和恢复Oracle数据库时,意外地删除数据文件

Saturday, August 4th, 2007 星期六, 07年八月四日

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.特别是在甲骨文数据库,这个数据库存储的数据库对象身体中的数据文件的硬盘。 Fast hand administrators may accidentally delete some of the datafiles, or the datafiles may get corrupted or unreadable on hard disk failure.快速另一方面管理员可能意外地删除一些数据文件,或数据文件可能会损坏或无法读取硬盘的失败。 You may get also some missing datafiles after database recovery process.您可能还得到一些失踪后,数据库的数据文件恢复过程。 In any case, missing a or a few datafiles will cause Oracle database to fail to startup, rendering the whole DB inaccessible.在任何情况下,缺少了或几个数据文件会导致数据库无法启动,使整个数据库无法使用。

Continue reading How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile » » »继续阅读如何降表空间和恢复Oracle数据库时意外地删除数据文件» » »

How to Remove and Drop Datafiles from Tablespace in Oracle Database如何删除和丢弃数据文件从表空间在Oracle数据库

Saturday, August 4th, 2007 星期六, 07年八月四日

Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files.甲骨文公司的数据库管理系统的数据库存储数据的逻辑形式的表空间和肉体形式的数据文件。 The datafiles are added to the tablespaces as database space requirement grows bigger.该数据文件被添加到该表空间数据库空间要求越来越大。 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.如不小心误新增中型或无用数据文件的表空间,或数据空间的使用已成为一些较小的数据文件要被删除,或企图收回甲骨文数据库无法启动因丢失或损坏的数据文件,消除他们甲骨文没有提供一种简单的方法或用户界面删除或减少数据文件从表空间。 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.一旦数据文件提出的一部分,表空间,它可以不再是单独或删除表空间,尽管有一些变通。

Continue reading How to Remove and Drop Datafiles from Tablespace in Oracle Database » » »继续阅读如何删除和丢弃数据文件从表空间在Oracle数据库» » »

How to Backup and Restore (Export and Import) MySQL Databases Tutorial如何备份和恢复(出口和进口) MySQL数据库教程

Saturday, July 21st, 2007 星期六, 07年七月二十一日

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的缺乏,缓慢的服务器和可能只是坠毁的阿帕奇的httpd服务器,如果太多的传入网络连接占用系统的资源。

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:当创建一个新表或修改现有的表,主键,独特的制约因素和指标,或者当确定一个新的指数与ALTER TABLE操纵声明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 星期一, 07年四月二十三日

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的参考函数返回字符串海峡与所有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 星期一, 07年四月二十三日

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如何转义字符在甲骨文特等/ SQL查询

Saturday, March 24th, 2007 星期六, 2007年三月二十四日

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查询建立在甲骨文,并可能造成错误的结果返回尤其是当表演字符串搜索类的关键字。 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 » » »继续阅读如何转义字符在甲骨文特等/ SQL查询» » »