Oracle10g manual database creation (non-OMF)

Source: Internet
Author: User


Platform: RHEL4.8, Oracle10.2.0.1
Plan: db_name = dndn, db_unique_name/ORACLE_SID = dndn
The above two parameters can also be set to different.


$ Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
$ Export ORACLE_SID = dndn




2. Create an initialization parameter file
$ Vi $ ORACLE_HOME/dbs/init $ ORACLE_SID.ora
# The following are required parameters for creating a database:
Control_files = (/u01/app/oracle/oradata/control1.ctl,/u01/app/oracle/oradata/control2.ctl,/u01/app/oracle/oradata/control3.ctl)
Undo_management = AUTO
Undo_tablespace = UNDOTBS1
Db_name = dndn
Db_unique_name = dndn
DB _ block_size = 8192
Sga_max_size = 320 M
Sga_target = 320 M


# The following are the parameters that need to be set for the general database creation. If this parameter is not set, the default value is used.
Audit_file_dest =/u01/app/oracle/admin/dndn/adump # default $ ORACLE_HOME/rdbms/adump is not set
Background_dump_dest =/u01/app/oracle/admin/dndn/bdump # default $ ORACLE_HOME/rdbms/log is not set
Core_dump_dest =/u01/app/oracle/admin/dndn/cdump # default $ ORACLE_HOME/rdbms/dbs is not set
User_dump_dest =/u01/app/oracle/admin/dndn/udump # default $ ORACLE_HOME/rdbms/log is not set
Db_domain = jsu.com # The default value is null if this parameter is not set.
Open_cursors = 1500 # do not set the default value of 50
Processes = 500 # default 40 is not set
Log_archive_dest_1 = 'location =/u01/app/oracle/arch/dndn' # If this parameter is not set, the default value is null. the archive is stored in $ ORACLE_HOME/rdbms/dbs/arch.
Log_archive_format = 'Log _ % t _ % s _ % r. arc' # The default value % t _ % s _ % r. dbf is not set.
Job_queue_processes = 10 # do not set the default value to 0
Undo_retention = 10800 # default 900 is not set


# To enable the audit function, set the following parameters:
Audit_sys_operations = TRUE
Audit_trail = db, extended # Note: if it is converted to a physical standby database in the future, the database cannot be set here; otherwise, the read only mode cannot be enabled for the physical standby database in the future.




3. Create a password file
$ ORACLE_HOME/bin/orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = runner force = y
-- Force -- specifies whether to overwrite existing files (optional)


4. Create a directory
$ Rm-rf $ ORACLE_BASE/admin/$ ORACLE_SID
$ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/adump
Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/bdump
Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/cdump
Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/dpdump
Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/udump
Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/pfile




# If you use OMF to manage database files, you do not need to create the following directory
$ Rm-rf $ ORACLE_BASE/oradata/dndn
Mkdir-p $ ORACLE_BASE/oradata/dndn
$ Rm-rf $ ORACLE_BASE/arch/dndn
Mkdir-p $ ORACLE_BASE/arch/dndn




5. Start the instance and create the database after creating the spfile.
$ Sqlplus '/as sysdba'
SQL> create spfile from pfile; (pfile: $ ORACLE_HOME/dbs/init $ ORACLE_SID.ora is automatically read)
SQL> startup nomount
SQL> create database dndn CONTROLFILE REUSE
MAXINSTANCES 8 MAXDATAFILES 100
MAXLOGHISTORY 1 MAXLOGFILES 16 MAXLOGMEMBERS 5
Character set ZHS16GBK national character set AL16UTF16
Logfile group 1 ('/u01/app/oracle/oradata/dndn/redo1.log') size 50 M reuse,
Group 2 ('/u01/app/oracle/oradata/dndn/redo2.log') size 50 M reuse,
Group 3 ('/u01/app/oracle/oradata/dndn/redo3.log') size 50 M reuse
Datafile '/u01/app/oracle/oradata/dndn/system. dbf' size 500 M reuse autoextend on next 10 M maxsize unlimited extent management local
Sysaux datafile '/u01/app/oracle/oradata/dndn/sysaux. dbf' size 100 M autoextend on next 10 M maxsize unlimited
Default temporary tablespace temp tempfile '/u01/app/oracle/oradata/dndn/temp01.dbf' size 100 M reuse autoextend on next 10 M maxsize unlimited
Undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/dndn/undotbs1.dbf' size 100 M reuse autoextend on next 10 M maxsize unlimited
User sys identified by "runner" user system identified by "runner ";


You can also consider the following parameters for creating a database:
Set timezone = 'time _ zone_region'
Set timezone = '{+ |-} hh: mm'
FORCE LOGGING


After the database is created, the database is automatically open.
Note: MAXLOGFILES indicates the number of logfile groups that can be created, and MAXLOGMEMBERS indicates the number of members in each group. If the control file exceeded before 10.2, it is unnecessary in 10.2. Oracle automatically updates the two parameter values in the control file and does not need to recreate the control file! In oracle10g, the default value of MAXLOGFILES is 16, MAXLOGMEMBERS is 3, but cannot exceed 5 when new, or a ORA-02249 error occurs.
In addition, if you want to obtain the specified MAXxxx parameters in the future, you can use the dump control file to obtain: alter database backup controlfile to trace;




7. Run the data dictionary script, where catalog and catproc are required. Other options are as follows:
SQL> spool/u01/app/oracle/cat. log
SQL> @? /Rdbms/admin/catalog. SQL (create data dictionary view)
SQL> @? /Rdbms/admin/catproc. SQL (create a stored procedure package)
SQL> @? /Rdbms/admin/catblock. SQL (several lock-related views)
SQL> @? /Rdbms/admin/catoctk. SQL (password creation toolkit dbms_crypto_toolkit)
SQL> @? /Rdbms/admin/owminst. plb (create a workspace management object, such as dmbs_wm)
SQL> spool off
Check/u01/app/oracle/cat. log to see if there are any unacceptable errors.




8. Create sqlplus attributes and help and USERS tablespace
SQL> connect system/iamwangnc
SQL> @? /Sqlplus/admin/pupbld. SQL
SQL> @? /Sqlplus/admin/help/hlpbld. SQL helpus. SQL
SQL> connect/as sysdba
SQL> CREATE TABLESPACE USERS LOGGING DATAFILE '/u01/app/oracle/oradata/dndn/users01.dbf' SIZE 100 M REUSE AUTOEXTEND ON NEXT 10 m MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
SQL> ALTER DATABASE DEFAULT TABLESPACE USERS;




9. Change to archive mode and restart
SQL> shutdown immediate;
SQL> connect/as sysdba
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
Recompile all failed processes:
SQL> execute utl_recomp.recomp_serial ();




10. Create and configure EM (optional ):
SQL> @? /Sysman/admin/emdrep/SQL/emreposcre/u01/app/oracle/product/10.2.0/db_1 SYSMAN iamwangnc TEMP ON;
SQL> alter user SYSMAN identified by "runner" account unlock;
SQL> alter user DBSNMP identified by "runner" account unlock;
SQL> host emca-config dbcontrol db-silent-DB_UNIQUE_NAME dndn-PORT 1521-EM_HOME/u01/app/oracle/product/10.2.0/db_1-LISTENER-SERVICE_NAME dndn. LK-SYS_PWD "runner"-SID dndn-ORACLE_HOME/u01/app/oracle/product/10.2.0/db_1-DBSNMP_PWD "runner"-HOST "vmone"-LISTENER_OH/u01/app/ oracle/product/10.2.0/db_1-LOG_FILE/u01/app/oracle/emConfig. log-SYSMAN_PWD "runner ";


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.