Great New Features of Oracle10g(3)
Oracle Database Implementation of Regular Expressions
Oracle Database implements regular expression support with a set of Oracle Database SQL functions and conditions that enable you to search and manipulate string data. You can use these functions in any environment that supports Oracle Database SQL. You can use these functions on a text literal, bind variable, or any column that holds character data such as CHAR, NCHAR, CLOB, NCLOB, NVARCHAR2, and VARCHAR2 (but not LONG).
1:REGEXP_LIKE(condition)
Searches a character column for a pattern. Use this function in the WHERE clause of a query to return rows matching a regular expression. The condition is also valid in a constraint or as a PL/SQL function returning a boolean. The following WHERE clause filters employees with a first name of Steven or Stephen:
WHERE REGEXP_LIKE(first_name, '^Ste(v|ph)en$')
2:REGEXP_REPLACE(function)
Searches for a pattern in a character column and replaces each occurrence of tha pattern with the specified string. The following function puts a space after each character in the country_name column:
REGEXP_REPLACE(country_name, '(.)', '\1 ')
3:REGEXP_INSTR(function)
Searches a string for a given occurrence of a regular expression pattern and returns an integer indicating the position in the string where the match is found. You specify which occurrence you want to find and the start position. For example, the following performs a boolean test for a valid email address inthe email column:
REGEXP_INSTR(email, '\w+@\w+(\.\w+)+') > 0
4:REGEXP_SUBSTR(function)
Returns the substring matching the regular expression pattern that you specify. The following function uses the x flag to match the first string by ignoring spaces in the regular expression:
REGEXP_SUBSTR('oracle', 'o r a c l e', 1, 1, 'x')
Migrating a Database to Automatic Storage Management
With a new installation of Oracle Database and Automatic Storage Management (ASM), you initially create your database in ASM. If you have an existing Oracle database that stores database files in the operating system file system or on raw devices, you can migrate some or all of these database files to ASM.
There are two ways to migrate database files to ASM:
■ Manually, using RMAN
For detailed instructions on migrating a database to ASM using RMAN, see Oracle Database Backup and Recovery Advanced User's Guide. You can also use RMAN to migrate a single tablespace or datafile to ASM.
■ With the Migrate Database To ASM wizard in Enterprise Manager You access the wizard from the Administration page, under the Change Database heading. Refer to the Enterprise Manager online help for instructions on using the wizard.
Oracle Database implements regular expression support with a set of Oracle Database SQL functions and conditions that enable you to search and manipulate string data. You can use these functions in any environment that supports Oracle Database SQL. You can use these functions on a text literal, bind variable, or any column that holds character data such as CHAR, NCHAR, CLOB, NCLOB, NVARCHAR2, and VARCHAR2 (but not LONG).
1:REGEXP_LIKE(condition)
Searches a character column for a pattern. Use this function in the WHERE clause of a query to return rows matching a regular expression. The condition is also valid in a constraint or as a PL/SQL function returning a boolean. The following WHERE clause filters employees with a first name of Steven or Stephen:
WHERE REGEXP_LIKE(first_name, '^Ste(v|ph)en$')
2:REGEXP_REPLACE(function)
Searches for a pattern in a character column and replaces each occurrence of tha pattern with the specified string. The following function puts a space after each character in the country_name column:
REGEXP_REPLACE(country_name, '(.)', '\1 ')
3:REGEXP_INSTR(function)
Searches a string for a given occurrence of a regular expression pattern and returns an integer indicating the position in the string where the match is found. You specify which occurrence you want to find and the start position. For example, the following performs a boolean test for a valid email address inthe email column:
REGEXP_INSTR(email, '\w+@\w+(\.\w+)+') > 0
4:REGEXP_SUBSTR(function)
Returns the substring matching the regular expression pattern that you specify. The following function uses the x flag to match the first string by ignoring spaces in the regular expression:
REGEXP_SUBSTR('oracle', 'o r a c l e', 1, 1, 'x')
Migrating a Database to Automatic Storage Management
With a new installation of Oracle Database and Automatic Storage Management (ASM), you initially create your database in ASM. If you have an existing Oracle database that stores database files in the operating system file system or on raw devices, you can migrate some or all of these database files to ASM.
There are two ways to migrate database files to ASM:
■ Manually, using RMAN
For detailed instructions on migrating a database to ASM using RMAN, see Oracle Database Backup and Recovery Advanced User's Guide. You can also use RMAN to migrate a single tablespace or datafile to ASM.
■ With the Migrate Database To ASM wizard in Enterprise Manager You access the wizard from the Administration page, under the Change Database heading. Refer to the Enterprise Manager online help for instructions on using the wizard.
Labels: software_oracle
0 Comments:
Post a Comment
<< Home