Another way to rename a column
Another way to rename a column is to use the RENAME statement together with theCREATE TABLE statement with AS subquery. This method is useful if you arechanging the structure of a table rather than only renaming a column. Thefollowing statements re-create the sample table hr.job_history, renaming a column fromdepartment_id to dept_id:CREATE TABLE temporary (employee_id, start_date, end_date, job_id, dept_id)AS SELECT employee_id, start_date, end_date, job_id, department_idFROM job_history;
Initianization Parameter (3) : DB_CACHE_SIZE
Parameter type : Big integerSyntax : DB_CACHE_SIZE = integer [K | M | G]Default value : If SGA_TARGET is set: If the parameter is not specified, then the defaultis 0 (internally determined by the Oracle Database). If the parameter isspecified, then the user-specified value indicates a minimum value forthe memory pool.If SGA_TARGET is not set, then the default is either 48 MB or 4MB *number of CPUs * granule size, whichever is greaterModifiable : ALTER SYSTEMBasic : NoDB_CACHE_SIZE specifies the
Initianization Parameter (2) : DB_BLOCK_BUFFERS
Parameter type : IntegerDefault value : 0Modifiable : No Range of values : 50 to an operating system-specific maximumBasic : NoReal Application Clusters : Multiple instances can have different values, and you can change the values as needed.Note: DB_BLOCK_BUFFERS cannot be combined with the dynamic DB_CACHE_SIZE parameter; combining these parameters in the same parameter file will produce an error.DB_BLOCK_BUFFERS specifies the number of database buffers in the buffer cache. It is one of several
Initianization Parameter (1) : DB_BLOCK_SIZE
Parameter type : IntegerDefault value : 8192Modifiable : NoRange of values : 2048 to 32768, but your operating system may have a narrower rangeBasic : YesReal Application Clusters : You must set this parameter for every instance, and multiple instances must have the same value.DB_BLOCK_SIZE specifies (in bytes) the size of Oracle database blocks. Typical values are 4096 and 8192. The value of this parameter must be a multiple of the physical block size at the device level.The value for DB_BLOCK_
Redo Logfile Size Advisor
摘自orafaqThe Redo Logfile Size Advisor can be used to determine the least optimal online redo log file size based on the current FAST_START_MTTR_TARGET setting and MTTR statistics.Which means that Redo Logfile Size Advisor is enabled only if FAST_START_MTTR_TARGET is set. The Advisor provides a recommended optimal smallest online redo log file size.we can then adjust the online redo log file size to the recommended optimal size ,eliminating the need to manually determine an optimal size.To use
EZCONNECT - Easy Connect String
摘自OracleadviceYou can avoid having to use a TNSNAMES.ORA file by specifying the full connect string at the command prompt. The hostname is the only mandatory piece.sqlplus username/password@ [//] hostname [:port] [/service_name]Eg. sqlplus scott/tiger@moriarty:1521/ORCLSet up EZCONNECT in the sqlnet.ora file as follows:NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)[@more@]
Automatic Checkpoint Tuning
摘自OracleadviceIn Oracle10g, fast_start_mttr_target behaves slightly differently. Specifying any non-zero valuewill tell Oracle to automatically tune checkpointing by optimizing the frequency of dirty bufferwrites. The default is to enable automatic checkpoint tuning. The only way to turn this off is toexplicitly set the parameter to 0.When Automatic Checkpoint Tuning has been disabled you can use the Redo Logfile Size Advisor to tunean optimal size for the online redo logs based on checkpointi
sga contains infomation (71)
The SGA is read/write. All users connected to a multiple-process database instance can read information contained within the instance’s SGA, and several processes write to the SGA during execution of Oracle. The SGA contains the following data structures: ■ Database buffer cache■ Redo log buffer■ Shared pool■ Java pool■ Large pool (optional) ■ Streams pool■ Data dictionary cache ■ Other miscellaneous information Part of the SGA contains general information about the state of the databas
Overview of the System Global Area (70)
A system global area (SGA) is a group of shared memory structures that contain dataand control information for one Oracle database instance. If multiple users areconcurrently connected to the same instance, then the data in the instance’s SGA isshared among the users. Consequently, the SGA is sometimes called the shared globalarea.An SGA and Oracle processes constitute an Oracle instance. Oracle automaticallyallocates memory for an SGA when you start an instance, and the operating systemreclaim
Introduction to Oracle Memory Structures (69)
Oracle uses memory to store information such as the following:■ Program code■ Information about a connected session, even if it is not currently active■ Information needed during program execution (for example, the current state of aquery from which rows are being fetched)■ Information that is shared and communicated among Oracle processes (forexample, locking information)■ Cached data that is also permanently stored on peripheral memory (for example,data blocks and redo log entries)The bas
Oracle存储单位
B--BytesK--KilobytesM--MegabytesG--GigabytesT--TerabytesP--PetabytesE--Exabytes[@more@]
安装Oracle9i出错
出错提示为 :停止安装该组件/停止安装所有组件解决方法 :在注册表中找到HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerPendingFileRenameOperations并删除它。这样就可以清除安装暂挂项目。 以前安装SQL Server2k的时候好像也是这么解决的.[@more@]
Multiplexed Control Files (68)
As with redo log files, Oracle enables multiple, identical control files to be open concurrently and written for the same database. By storing multiple control files for a single database on different disks, you can safeguard against a single point of failure with respect to control files. If a single disk that contained a control file crashes, then the current instance fails when Oracle attempts to access the damaged control file. However, when other copies of the current control file are avail
Control File Contents (67)
A control file contains information about the associated database that is required for access by an instance, both at startup and during normal operation. Control file information can be modified only by Oracle; no database administrator or user can edit a control file. Among other things, a control file contains information such as:1. The database name 2. The timestamp of database creation 3. The names and locations of associated datafiles and redo log files 4. Tablespace informatio
Overview of Control Files (66)
The database control file is a small binary file necessary for the database to start and operate successfully. A control file is updated continuously by Oracle during database use, so it must be available for writing whenever the database is open. If for some reason the control file is not accessible, then the database cannot function properly. Each control file is associated with only one Oracle database. 控制文件1. 二进制文件2. 在数据库使用时 , 不停的被更新 ,不管数据库是否打开 , 都必须
BIGFILE | SMALLFILE
Use this clause to determine whether the tablespace is a bigfile or smallfile tablespace. 1. A bigfile tablespace contains only one datafile or tempfile, which can contain up 32 to approximately 4 billion (2^32 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks. 2. A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 datafiles or tempfiles, each of which can
Offline Datafiles (65)
You can take tablespaces offline or bring them online at any time, except for theSYSTEM tablespace. All of the datafiles of a tablespace are taken offline or broughtonline as a unit when you take the tablespace offline or bring it online, respectively.You can take individual datafiles offline. However, this is usually done only duringsome database recovery procedures.[@more@]
Size of Datafiles (64)
You can alter the size of a datafile after its creation or you can specify that a datafileshould dynamically grow as schema objects in the tablespace grow. This functionalityenables you to have fewer datafiles for each tablespace and can simplifyadministration of datafiles.Note: You need sufficient space on the operating system forexpansion.[@more@]
Datafile Contents (63)
When a datafile is first created, the allocated disk space is formatted but does notcontain any user data. However, Oracle reserves the space to hold the data for futuresegments of the associated tablespace—it is used exclusively by Oracle. As the datagrows in a tablespace, Oracle uses the free space in the associated datafiles to allocateextents for the segment.The data associated with schema objects in a tablespace is physically stored in one ormore of the datafiles that constitute the tables
Overview of Datafiles (62)
A tablespace in an Oracle database consists of one or more physical datafiles. Adatafile can be associated with only one tablespace and only one database.Oracle creates a datafile for a tablespace by allocating the specified amount of diskspace plus the overhead required for the file header. When a datafile is created, theoperating system under which Oracle runs is responsible for clearing old informationand authorizations from a file before allocating it to Oracle. If the file is large, thispro