Oracle Database creation process
Since there is already a database instance in the current environment, this does not affect the creation of a new instance sun
Current System instance
[oracle@DBA2 dbs]$ env |grep ORACLEORACLE_SID=orcl1ORACLE_BASE=/u/oracleORACLE_HOME=/u/oracle/product/11.2[oracle@DBA2 dbs]$
1. First, set the ORACLE_SID of the database to be created.
Export $ ORACLE_SID = sun
2. Create a password file for the new instance
Orapwd file = $ ORACLE_HOME/dbs/orapwsun password = oracle entries = 10
3. Create an initialization parameter file (pfile)
[oracle@DBA2 dbs]$ vi initsun.oradb_name=suncontrol_files='/oradata/sun/control01.ctl'sga_target=250Mundo_management=autoundo_tablespace=undotbs
The main parameters are db_name, control_files, and sga_target.
4. Create instance-related directories (data files, log files, control files, etc)
I put the data files, log files, and control files in a directory. I only use one control file here. Of course, it is recommended that two or three control files be stored in different paths to ensure data file redundancy.
[oracle@DBA2 ~]$ mkdir /oradata/sun[oracle@DBA2 admin]$ mkdir /u/oracle/admin/adump[oracle@DBA2 admin]$ mkdir /u/oracle/admin/bdump[oracle@DBA2 admin]$ mkdir /u/oracle/admin/pfile
5. Create a spfile file and start the database to nomount.
SQL> create spfile from pfile;File created.SQL> startup nomountORACLE instance started.Total System Global Area 418484224 bytesFixed Size 1336932 bytesVariable Size 281020828 bytesDatabase Buffers 130023424 bytesRedo Buffers 6103040 bytesSQL>
6. Create a database (with scripts)
CREATE DATABASE sunUSER SYS IDENTIFIED BY oracleUSER SYSTEM IDENTIFIED BY oracleLOGFILE GROUP 1 ('/oradata/sun/redo01a.log') SIZE 20M,GROUP 2 ('/oradata/sun/redo02a.log') SIZE 20M,GROUP 3 ('/oradata/sun/redo03a.log') SIZE 20MMAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100MAXINSTANCES 2CHARACTER SET AL32UTF8DATAFILE '/oradata/sun/system01.dbf' SIZE 400M REUSEEXTENT MANAGEMENT LOCALSYSAUX DATAFILE '/oradata/sun/sysaux01.dbf' SIZE 400M REUSEDEFAULT TABLESPACE usersDATAFILE '/oradata/sun/users01.dbf' SIZE 20M REUSE AUTOEXTEND ON MAXSIZE UNLIMITEDDEFAULT TEMPORARY TABLESPACE tempts01TEMPFILE '/oradata/sun/tempts01.dbf' SIZE 20M REUSEUNDO TABLESPACE undotbsDATAFILE '/oradata/sun/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED/
7. Execute relevant data dictionary attempts
@? /Rdbms/admin/catalog. SQL
@? /Rdbms/admin/catproc. SQL
@? /Sqlplus/admin/pupbld. SQL
OK. Now the manual creation of the Oracle database is complete. The experiment proves that manual database creation is easier and faster than DBCA database creation, and the basic process is divided into the above steps.