Oracle 10g CREATE Database manually

Source: Internet
Author: User
Tags exit character set manual mkdir create database sqlplus

1, create a directory

mkdir D:oracleproduct10.1.0database

mkdir E:oracleadminora10gdump

mkdir E:oracleadminora10gcdump

mkdir e:oracleadminora10gcreate

mkdir E:oracleadminora10gpfile

mkdir E:oracleadminora10gudump

mkdir E:oracleflash_recovery_area

mkdir E:oracleoradata

mkdir e:oracleoradataora10g

2. Generate Windows Service, create password file, run under cmd command

Set ORACLE_SID=DBCA-Green section sets the ORACLE instance name to ora10g

D:oracleproduct10.1.0db_1inoradim.exe-new-sid Ora10g-startmode Manual-spfile d:oracleproduct10.1.0db_ 1inoradim.exe-edit-sid Ora10g-startmode A-spfile

--Create an instance named DBCA and have a manual start to start automatically

D:oracleproduct10.1.0db_1inorapwd.exe File=d:oracleproduct10.1.0db_1pwdora10g.ora Password=sysPassword Force=y

--Create a default password for the SYS user with the Oracle orapwd Syspassword

3. Execute CREATE DATABASE Script

D:oracleora92insqlplus/nolog @d:oracleadmindbcascriptscreatedb.sql

D:oracleora92insqlplus/nolog @d:oracleadmindbcascriptscreatedbfiles.sql

D:oracleora92insqlplus/nolog @d:oracleadmindbcascriptscreatedbcatalog.sql

D:oracleora92insqlplus/nolog @d:oracleadmindbcascriptspostdbcreation.sql

--The bold part is the script that creates the database to invoke

First Createdb.sql

Connect Sys/change_on_install as SYSDBA--this is just the password we set up to connect to the database SYSDBA identity

Connect Sys/change_on_install as SYSDBA--this is just the password we set up to connect to the database SYSDBA identity

Set echo on

Spool D:oracleora92assistantsdbcalogscreatedb.log Write Log

Startup Nomount pfile= "D:oracleadmindbcascriptsinit.ora"; Call parameter file start database to load instance phase

CREATE DATABASE DBCA

Maxinstances 1

Maxloghistory 1

Maxlogfiles 5

Maxlogmembers 3

Maxdatafiles 100-Control the maximum number of log records, log group, maximum number of data files, and other restrictions

DataFile ' d:oracleoradatadbcasystem01.dbf ' SIZE 250M reuse autoextend on NEXT 10240K MAXSIZE Unlimited

EXTENT MANAGEMENT Local

DEFAULT temporary tablespace TEMP tempfile ' d:oracleoradatadbca emp01.dbf ' SIZE 40M reuse autoextend on NEXT 640K MAXSIZE Unlimited

UNDO tablespace "UNDOTBS1" datafile ' d:oracleoradatadbcaundotbs01.dbf ' SIZE 200M reuse autoextend on NEXT 5120K MAXSIZE UN LIMITED-Create system, temporary, rollback tablespace itpub personal space!dj5l {!i4w R f

CHARACTER SET ZHS16GBK

National CHARACTER set AL16UTF16--character Set

LOGFILE GROUP 1 (' D:ORACLEORADATADBCA edo01.log ') SIZE 102400K,

GROUP 2 (' D:ORACLEORADATADBCA edo02.log ') SIZE 102400K,

GROUP 3 (' D:ORACLEORADATADBCA edo03.log ') SIZE 102400K; --Create log file leases and members

Spool off

Exit

Second. Createdbfiles.sql

Connect Sys/change_on_install as SYSDBA

Set echo on

Spool D:oracleora92assistantsdbcalogscreatedbfiles.log

CREATE tablespace "INDX" LOGGING datafile ' d:oracleoradatadbcaindx01.dbf ' SIZE 25M reuse autoextend on NEXT 1280K MAXSIZE Unlimited EXTENT MANAGEMENT local SEGMENT space MANAGEMENT AUTO;

CREATE tablespace "TOOLS" LOGGING datafile ' d:oracleoradatadbca ools01.dbf ' SIZE 10M reuse autoextend on NEXT 320K MAXSIZE Unlimited EXTENT MANAGEMENT local SEGMENT space MANAGEMENT AUTO;

CREATE tablespace "USERS" LOGGING datafile ' d:oracleoradatadbcausers01.dbf ' SIZE 25M reuse autoextend on NEXT 1280K maxsiz E Unlimited EXTENT MANAGEMENT SEGMENT space MANAGEMENT AUTO; --Create a table space for related users

Spool off

Exit

Third: Createdbcatalog.sql

--Create the System data dictionary, store in the system table space, related tables, views, etc.

Connect Sys/change_on_install as SYSDBA

Set echo on

Spool D:oracleora92assistantsdbcalogscreatedbcatalog.log

@d:oracleora92 Dbmsadmincatalog.sql;

@d:oracleora92 Dbmsadmincatexp7.sql;

@d:oracleora92 Dbmsadmincatblock.sql;

@d:oracleora92 Dbmsadmincatproc.sql;

@d:oracleora92 Dbmsadmincatoctk.sql;

@d:oracleora92 DBMSADMINOWMINST.PLB;

Connect System/manager

@d:oracleora92sqlplusadminpupbld.sql;

Connect System/manager

Set echo on

Spool D:oracleora92assistantsdbcalogssqlplushelp.log

@d:oracleora92sqlplusadminhelphlpbld.sql Helpus.sql;

Spool off

Spool off

Exit

IV: Postdbcreation.sql

Connect Sys/change_on_install as SYSDBA

Set echo on

Spool D:oracleora92assistantsdbcalogspostdbcreation.log

@d:oracleora92 Dbmsadminutlrp.sql; --Compile related views, package objects, etc.

shutdown; --Close the database

Connect Sys/change_on_install as SYSDBA

Set echo on

Spool D:oracleora92assistantsdbcalogspostdbcreation.log

Create spfile= ' D:oracleora92databasespfiledbca.ora ' from pfile= ' D:oracleadmindbcascriptsinit.ora ';

--Create a server parameter file instead of a file initialization parameter file, to facilitate the sometimes without restarting the database can make parameters effective

From above you can see where the spfile files are stored

startup; --Start the database, create the database complete

Exit

As you can see from the above, creating a database has the following 10 steps

Step 1: Create the related trace directory folder

Step 2: Create the instance, the password starts the way

Step 3: Create initialization parameter Files Init.ora

Step 4: Connecting to an instance

Step 5: Start instance to Nomount state

Step 6: Create a database

Step 7: Create a table space

Step 8: Run the script to create the data dictionary

Step 9: Create a Server parameter file (this is not necessary, but Oracle recommends doing this) the benefits will be listed in a later summary

Below also posted Linux under the script, and Windows almost nearly

#!/bin/sh

Mkdir/oradata/ora9i

Mkdir/oradata/ora9i/controlfile

Mkdir/oradata/ora9i/redofile

Mkdir/orasys/oracle/admin

Mkdir/orasys/oracle/admin/ora9i

Mkdir/orasys/oracle/admin/ora9i/bdump

Mkdir/orasys/oracle/admin/ora9i/cdump

Mkdir/orasys/oracle/admin/ora9i/create

Mkdir/orasys/oracle/admin/ora9i/udump

Mkdir/orasys/oracle/admin/ora9i/pfile

CP init.ora/orasys/oracle/product/9.2.0/dbs/.

Export Oracle_base=/orasys/oracle

Export Oracle_home= $ORACLE _base/product/9.2.0

Export oracle_sid=ora9i

Export ora_nls33= $ORACLE _home/ocommon/nls/admin/data

Ld_library_path= $ORACLE _home/lib:/lib:/usr/lib

Ld_library_path= $LD _library_path:/usr/local/lib

Export Ld_library_path

Export path= $PATH: $ORACLE _home/bin

echo ADD This entry in the Oratab:ora9i:/orasys/oracle/product/9.2.0:y

/orasys/oracle/product/9.2.0/bin/orapwd file=/orasys/oracle/product/9.2.0/dbs/orapwora9i Password=change_on_ Install

/orasys/oracle/product/9.2.0/bin/sqlplus/nolog @/home/oracle/create_script/createdb.sql

/orasys/oracle/product/9.2.0/bin/sqlplus/nolog @/home/oracle/create_script/createdbfiles.sql

/orasys/oracle/product/9.2.0/bin/sqlplus/nolog @/home/oracle/create_script/createdbcatalog.sql

/orasys/oracle/product/9.2.0/bin/sqlplus/nolog @/home/oracle/create_script/postdbcreation.sql

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.