How to create an Oracle database

Source: Internet
Author: User
<Doctype HTML public-wcdtd XHTML stricten httpwwwworgtrxhtmldtdxhtml-strictdtd>

Three methods for creating an Oracle database:
1. run Oracle Database Configuration assistant to create or delete a database (you can also enter dbca in the command line );
2. Create a database using command line
3. Create or delete a database by running a custom batch processing script (or create_oracle_sid.bat (create_oracle_sid. SQL)
Details:
1. run Oracle Database Configuration assistant to create or delete a database;

It is recommended that DBAs who are not familiar with the creation process use this method. They only need to configure according to the options % 26 #8220; next % 26 #8221; and finally generate the database creation script (we recommend that you keep it ), or directly create a database;
Advantage: the GUI method is easy to use;
Disadvantage: the creation process is slow;

2. Create a database using command line

Connect/As sysdba
Startup pfile = 'C: oracleadmininit_testorcl.ora 'nomount;
Create Database testorcl datafile '/u02/Oracle/testorcl/system01.dbf' size 100 m
Logfile group1 ('/u01/Oracle/testorcl/redo1a. log ',
'/U02/Oracle/testorcl/redo1b. log') size 500 K,
Group2 ('/u01/Oracle/testorcl/redo1a. log ',
'/U02/Oracle/testorcl/redo1b. log') size 500 k
Character Set zhs16cgb231280;

-- Directly convert the database from the never-built status to the open status
Alter database open;

-- Drop a database)
Spool C: drop_database.bat
Select 'del '| Name: deletes database-related data files from V $ datafile;
Select 'del '| member deletes data and restructured the log file from V $ logfile;
Spool off;

Advantage: You can familiarize yourself with the creation instructions and principles;
Disadvantage: the configuration is simple, and the command line commands must be memorized;

3. Run a custom batch processing or SQL script (create_oracle_sid.bat or create_oracle_sid. SQL) to create
-- Create_oracle_sid.bat
Set oracle_sid = oracle_sid.
Del C: oracle8idatabasepwdoracle_sid.ora
C: oracle8ibinoradim-New-Sid oracle_sid.-intpwd Oracle-startmode Manual
-Pfile C: oracle8iadminoracle_sidpfileinit.ora
C: oracle8ibinsvrmgrl @ C: winntprofilesadministratorlboracle_sidrun. SQL
C: oracle8ibinsvrmgrl @ C: winntprofilesadministratorlboracle_sidrun1. SQL
C: oracle8ibinoradim-edit-Sid oracle_sid-startmode auto

-- Oracle_sidrun. SQL
Spool C: oracle8iadminoracle_sidcreatecreatedb
Set echo on
Connect internal/Oracle
Startup nomount pfile = C: oracle8iadminoracle_sidpfileinit.ora
Create Database oracle_sid
Logfile 'C: oracle8ioradataoracle_sidredo01.log 'size 1024 K,
'C: oracle8ioradataoracle_sidredo02.log 'size 1024 K
Maxlogfiles 32
Maxlogmembers 2
Maxloghistory 1
Datafile 'C: oracle8ioradataoracle_sidsystem01.dbf' size 50 m Reuse
Maxdatafiles 254
Maxinstances 1
Character Set zht16big5
National Character Set zht16big5;
Spool off

-- Oracle_sidrun1. SQL
Spool C: oracle8iadminoracle_sidcreatecreatedb1
Set echo on
Connect internal/Oracle
Alter database datafile 'C: oracle8ioradataoracle_sidsystem01.dbf' autoextend on;
Create rollback segment sysrol tablespace "system" Storage (initial 100 K next 100 k );
Alter rollback segment "sysrol" online;

 

 

In addition, after creating a global database:

Sys password: change_on_install

The system password is Manager.

The servers started for the first time include:

Oracleorahome90agent

Oracleorahome90tnslistener

Oracleservice)

 

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.