Manually Creating an Oracle Database

来源:互联网 发布:搜狗输入法网络不可用 编辑:程序博客网 时间:2024/05/22 00:30


Manually Creating an Oracle Database

一、Set environment variables

export ORACLE_SID=WOO


一、Create corresponding directory

mkdir -p $ORACLE_BASE/{{admin/WOO/{a,b,c,u}dump},oradata/WOO}


二、Create simplest parameter file

cd $ORACLE_HOME/dbscat init.ora | grep -v ^# | grep -v ^$ > initWOO.ora



三、The first time start database

sqlplus / as sysdbaSQL> startup nomount;ORA-00371: not enough shared pool memory, should be atleast 62198988 bytesThe wrong solution:change init.ora file values >=62198988 shared_pool_size = 62198988




四、create spfile,and change other others parameters;

SQL> create spfile from pfile='?/dbs/initWOO.ora';File created.


五、reboot database,and change other parameters;

SQL> startup force nomount; ORACLE instance started.Total System Global Area   96468992 bytesFixed Size                  1217884 bytesVariable Size              88083108 bytesDatabase Buffers            4194304 bytesRedo Buffers                2973696 bytesalter system set background_dump_dest="/DBSoft/admin/Woo/bdump";alter system set core_dump_dest="/DBSoft/admin/Woo/cdump";alter system set user_dump_dest="/DBSoft/admin/Woo/udump";alter system set db_create_file_dest ="/DBSoft/oradata/WOO";alter system set db_create_online_log_dest_1 ="/DBSoft/oradata/WOO";alter system set undo_management=auto scope=spfile;alter system set undo_tablespace=undotbs1 scope=spfile;alter system set job_queue_processes=5;


六、Restart the database again,Began to create the database

SQL> CREATE DATABASE WOOUSER SYS IDENTIFIED BY oracleUSER SYSTEM IDENTIFIED BY oracleLOGFILE GROUP 1 ('/DBSoft/oradata/WOO/redo01.log') SIZE 100M,GROUP 2 ('/DBSoft/oradata/WOO/redo02.log') SIZE 100M,GROUP 3 ('/DBSoft/oradata/WOO/redo03.log') SIZE 100MMAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100MAXINSTANCES 1CHARACTER SET US7ASCIINATIONAL CHARACTER SET AL16UTF16DATAFILE '/DBSoft/oradata/WOO/system01.dbf' SIZE 325M REUSEEXTENT MANAGEMENT LOCALSYSAUX DATAFILE '/DBSoft/oradata/WOO/sysaux01.dbf' SIZE 325M REUSEDEFAULT TABLESPACE tbs_1DEFAULT TEMPORARY TABLESPACE tempts1TEMPFILE '/DBSoft/oradata/WOO/temp01.dbf'SIZE 20M REUSEUNDO TABLESPACE UNDOTBS1DATAFILE '/DBSoft/oradata/WOO/undotbs01.dbf'SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;Database created.

SQL> select instance_name,status from v$instanceINSTANCE_NAME                                    STATU------------------------------------------------ -----WOO                                              OPENSQL> select name,CREATED,LOG_MODE,OPEN_MODE,PROTECTION_MODE from v$databaseNAME     CREATED            LOG_MODE             OPEN_MODE    PROTECTION_MODE-------- ------------------ -------------------- ------------ --------------------WOO      29-DEC-13          NOARCHIVELOG         READ WRITE   MAXIMUM PERFORMANCE

七、Run Scripts to Build Data Dictionary Views

@?/rdbms/admin/catalog.sql@?/rdbms/admin/catproc.sql


八、create password file

[oracle@woo dbs]$ orapwd file=$ORACLE_HOME/dbs/orapwWOO password=oracle entries=5;

九、create em

[oracle@woo dbs]$ emca -config dbcontrol db -repos createSTARTED EMCA at Dec 29, 2013 8:00:17 AMEM Configuration Assistant, Version 10.2.0.1.0 ProductionCopyright (c) 2003, 2005, Oracle.  All rights reserved.Enter the following information:Database SID: WOOListener port number: 1521Password for SYS user: Password for DBSNMP user: Password for SYSMAN user: Email address for notifications (optional):Outgoing Mail (SMTP) server for notifications (optional):-----------------------------------------------------------------You have specified the following settingsDatabase ORACLE_HOME ................ /DBSoft/Product/10.2.0/db_1Database hostname ................ wooListener port number ................ 1521Database SID ................ WOOEmail address for notifications ...............Outgoing Mail (SMTP) server for notifications ...............-----------------------------------------------------------------Do you wish to continue? [yes(Y)/no(N)]: YDec 29, 2013 8:01:09 AM oracle.sysman.emcp.EMConfig performINFO: This operation is being logged at /DBSoft/Product/10.2.0/db_1/cfgtoollogs/emca/WOO/emca_2013-12-29_08-00-17-AM.log.Dec 29, 2013 8:01:12 AM oracle.sysman.emcp.EMReposConfig createRepositoryINFO: Creating the EM repository (this may take a while) ...Dec 29, 2013 8:04:04 AM oracle.sysman.emcp.EMReposConfig invokeINFO: Repository successfully createdDec 29, 2013 8:04:12 AM oracle.sysman.emcp.util.DBControlUtil startOMSINFO: Starting Database Control (this may take a while) ...Dec 29, 2013 8:05:50 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: Database Control started successfullyDec 29, 2013 8:05:50 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: >>>>>>>>>>> The Database Control URL is http://woo:5500/em <<<<<<<<<<<Enterprise Manager configuration completed successfullyFINISHED EMCA at Dec 29, 2013 8:05:50 AM


九、Create listener

WOO =  (DESCRIPTION =    (ADDRESS = (PROTOCOL = TCP)(HOST = woo)(PORT = 1521))    (CONNECT_DATA =      (SERVER = DEDICATED)      (SERVICE_NAME = WOO)    )  )






0 0
原创粉丝点击