您的位置:首页 > 数据库 > Oracle

Manually Creating an Oracle Database

2013-12-29 00:13 162 查看

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/dbs
cat init.ora | grep -v ^# | grep -v ^$ > initWOO.ora


三、The first time start database

sqlplus / as sysdba

SQL> startup nomount;
ORA-00371: not enough shared pool memory, should be atleast 62198988 bytes

The 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 bytes
Fixed Size                  1217884 bytes
Variable Size              88083108 bytes
Database Buffers            4194304 bytes
Redo Buffers                2973696 bytes

alter 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 WOO
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE 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 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/DBSoft/oradata/WOO/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/DBSoft/oradata/WOO/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE tbs_1
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/DBSoft/oradata/WOO/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE UNDOTBS1
DATAFILE '/DBSoft/oradata/WOO/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Database created.


SQL> select instance_name,status from v$instance

INSTANCE_NAME                                    STATU
------------------------------------------------ -----
WOO                                              OPEN

SQL> select name,CREATED,LOG_MODE,OPEN_MODE,PROTECTION_MODE from v$database

NAME     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 create

STARTED EMCA at Dec 29, 2013 8:00:17 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: WOO
Listener port number: 1521
Password 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 settings

Database ORACLE_HOME ................ /DBSoft/Product/10.2.0/db_1

Database hostname ................ woo
Listener port number ................ 1521
Database SID ................ WOO
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Dec 29, 2013 8:01:09 AM oracle.sysman.emcp.EMConfig perform
INFO: 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 createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 29, 2013 8:04:04 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Dec 29, 2013 8:04:12 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Dec 29, 2013 8:05:50 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Dec 29, 2013 8:05:50 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://woo:5500/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED 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)
    )
  )
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: