Oracle identifiers :Database Name
All mounted databases in a network must have a unique database name. This name is specified at the time of the creation of the database and burned into the control files.The name of the database must correspond to the db_name parameter.The database name (as well as the database id) can be changed with the nid (DBNEWID) tool.[@more@]
Oracle identifiers :Global database name
A database is uniquely identified by a global database name.Usually, a global database name has the form somename.domain.The global database name is the composit of db_domain and db_name.[@more@]
Oracle identifiers :SID (System Identifier)
A SID (almost) uniquely identifies an instance. Actually, $ORACLE_HOME, ORACLE_SID and $HOSTNAME identify an instance uniquely.The SID is 64 characters, or less; at least on Oracle 9i.The system identifier is included in the CONNECT_DATA parts of the connect descriptors in a tnsnames.ora file.The SID defaults to the database name.[@more@]
当我们... ...
当我们读小学的时候,读大学不要钱;当我们读大学的时候,读小学不要钱;当我们还没能工作的时候,工作也是分配的;当我们可以工作的时候,撞得头破血流才勉强找份饿不死人的工作做;当我们不能挣钱的时候,房子是分配的;当我们能挣钱的时候,却发现房子已经买不起了;当我们没有进入股市的时候,傻瓜都在赚钱;当我们兴冲冲地闯进去的时候,才发现自己成了傻瓜.[@more@]
v$transportable_platform.endian_format
Platform endian format:■ Big■ Little■ UNKNOWN FORMATendian的意思可参见 :http://www.eygle.com/digest/2007/01/whats_mean_endian.html[@more@]
ALTER TABLESPACE RENAME Clause
Use this clause to rename tablespace. This clause is valid only if tablespace andall its datafiles are online and the COMPATIBLE parameter is set to 10.0.0 or greater.You can rename both permanent and temporary tablespaces.表空间的数据文件都需要online , 并且初始化参数COMPATIBLE需要设置>=10.0.0 .永久性和临时性的表空间都可以重命名。If tablespace is read only, then Oracle Database does not update the datafileheaders to reflect the new name. The alert log will indicate that the datafile headersha
ALTER SESSION ADVISE Clause
The ADVISE clause sends advice to a remote database to force a distributedtransaction. The advice appears in the ADVICE column of the DBA_2PC_PENDINGview on the remote database (the values are 'C' for COMMIT, 'R' for ROLLBACK, and ' 'for NOTHING). If the transaction becomes in doubt, then the administrator of thatdatabase can use this advice to decide whether to commit or roll back the transaction.You can send different advice to different remote databases by issuing multiple ALTERSESSION statem
FUNCTION : vsize
VSIZE returns the number of bytes in the internal representation of expr. If expr isnull, then this function returns null.This function does not support CLOB data directly. However, CLOBs can be passed inas arguments through implicit data conversion.ExamplesThe following example returns the number of bytes in the last_name column of theemployees in department 10:SELECT last_name, VSIZE (last_name) "BYTES"FROM employeesWHERE department_id = 10;LAST_NAME BYTES--------------- ----------Wh
NOTE OF ANALYZE
Do not use the COMPUTE and ESTIMATE clauses ofANALYZE to collect optimizer statistics. These clauses are supportedfor backward compatibility. Instead, use the DBMS_STATS package,which lets you collect statistics in parallel, collect global statisticsfor partitioned objects, and fine tune your statistics collection inother ways. The optimizer, which depends upon statistics, willeventually use only statistics that have been collected by DBMS_STATS.You must use the ANALYZE statement (rather than DB
DELETE STATISTICS
Specify DELETE STATISTICS to delete any statistics about the analyzed object that arecurrently stored in the data dictionary. Use this statement when you no longer wantOracle Database to use the statistics.When you use this clause on a table, the database also automatically removes statisticsfor all the indexes defined on the table. When you use this clause on a cluster, thedatabase also automatically removes statistics for all the cluster tables and all theirindexes, including the cluster index
VALIDATE STRUCTURE
Specify VALIDATE STRUCTURE to validate the structure of the analyzed object. Thestatistics collected by this clause are not used by the Oracle Database optimizer, as arestatistics collected by the COMPUTE STATISTICS and ESTIMATE STATISTICSclauses.■ For a table, Oracle Database verifies the integrity of each of the data blocks androws. For an index-organized table, the database also generates compressionstatistics (optimal prefix compression count) for the primary key index on thetable.■ For a
Restrictions on Analyzing Tables
Analyzing tables is subject to the following restrictions:■ You cannot use ANALYZE to collect statistics on data dictionary tables.■ You cannot use ANALYZE to collect statistics on an external table. Instead, youmust use the DBMS_STATS package.■ You cannot use ANALYZE to collect default statistics on a temporary table.However, if you have already created an association between one or more columnsof a temporary table and a user-defined statistics type, then you can use ANALYZEto collect the us
ANALYZE TABLE
Oracle Database collects the following statistics for a table. Statistics marked with anasterisk are always computed exactly. Table statistics, including the status of domainindexes, appear in the data dictionary views USER_TABLES, ALL_TABLES, and DBA_TABLES in the columns shown in parentheses.■ Number of rows (NUM_ROWS)■ * Number of data blocks below the high water mark--that is, the number of datablocks that have been formatted to receive data, regardless whether they currentlycontain data o
QUESTION :What kind of shared storage do you use for Oracle RAC?
1. ASM - Automatic storage management2. Third party cluster filesystem3. NFS4. OCFS5. Raw devices6. We don't have any Real Application Cluster[@more@]
UTL_RECOMP
The UTL_RECOMP package contains two procedures used to recompile invalid objects. As the names suggest, the RECOMP_SERIAL procedure recompiles all the invalid objects one at a time, while the RECOMP_PARALLEL procedure performs the same task in parallel using the specified number of threads. Their definitions are listed below: PROCEDURE RECOMP_SERIAL( schema IN VARCHAR2 DEFAULT NULL, flags IN PLS_INTEGER DEFAULT 0); PROCEDURE RECOMP_PARALLEL( threads IN PLS
DBMS_UTILITY.COMPILE_SCHEMA
The COMPILE_SCHEMA procedure in the DBMS_UTILITY package compiles all procedures, functions, packages, and triggers in the specified schema. The example below shows how it is called from SQL*Plus: EXEC DBMS_UTILITY.compile_schema(schema => 'SCOTT');[@more@]
utlrp.sql and utlprp.sql
The utlrp.sql and utlprp.sql scripts are provided by Oracle to recompile all invalid objects in the database. They are typically run after major database changes such as upgrades or patches. They are located in the $ORACLE_HOME/rdbms/admin directory and provide a wrapper on the UTL_RECOMP package. The utlrp.sql script simply calls the utlprp.sql script with a command line parameter of "0". The utlprp.sql accepts a single integer parameter that indicates the level of parallelism as foll
select_catalog_role vs select any dictionary
Roles need relogin or explicit set role from a session to take affectwhereas the granting of privileges take immediate affect.select_catalog_role allows you to select on the catalog views (dba%, v$%...).select any dictionary allows you to select the dictionary tables that is sys tables. You can't select sys tables with only select_catalog_role role.Users with Sysdba privileges can access the sys schema, another method ofgiving system privileges without giving Sysdba privilege Is giving theSELECT
ROLE:*CATALOG_ROLE
DELETE_CATALOG_ROLE角色:是Oracle8新增加的,如果授予用户这个角色,用户就可以从表 sys.aud$中删除记录,sys.aud$表中记录着审计后的记录, 使用这个角色可以简化审计踪迹管理。SELECT_CATALOG_ROLE角色:具有从数据字典查询的权利,EXECUTE_CATALOG_ROLE角色:具有从数据字典中执行部分过程和函数的权利。[@more@]
Accessing Frequently Used Dictionary Objects
Users with explicit object privileges and the SYSDBA can access dictionary objects. If, however, you need access to dictionary objects and do not have explicit object privileges, you can be granted the following roles: * SELECT_CATALOG_ROLE Enables users to SELECT all exported catalog views and tables granted to this role. Grant this role to users who must access all exported views and tables in the data dictionary. * EXECUTE_CATALOG_ROLE Provides EXECUTE priv