Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a database manually

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to create a database by hand. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Refer Doc:Administrator's Guide- > 2 Creating and Configuring an Oracle Database- > Creating a Database with the CREATE DATABASE Statement

Step 1: Specify an Instance Identifier (SID)

[oracle@OCM ~] $export ORACLE_SID=PROD3

Step 2: Ensure That the Required Environment Variables Are Set

[oracle@OCM ~] $env | grep ORACLE

ORACLE_SID=PROD3

ORACLE_BASE=/u01/app/oracle/product

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

Step 3: Choose a Database Administrator Authentication Method

[oracle@OCM ~] $cd $ORACLE_HOME/dbs

[oracle@OCM dbs] $orapwd file=orapwPROD3 password=oracle entries=30

[oracle@OCM dbs] $ll

Total 12

-rw-r--r-- 1 oracle oinstall 2851 May 15 2009 init.ora

-rw-r- 1 oracle oinstall 5120 Dec 5 07:51 orapwPROD3

Step 4: Create the Initialization Parameter File

[oracle@OCM scripts] $cat initPROD3.ora

Db_name='PROD3'

Db_recovery_file_dest=' / u01According to an oracle, an oracle, a product, a flashback, recovery, recovery, etc.

Db_recovery_file_dest_size=2G

[oracle@OCM product] $mkdir-p / u01/app/oracle/product/flash_recovery_area

Step 5: (Windows Only) Create an Instance

Step 6: Connect to the Instance

[oracle@OCM scripts] $sqlplus / as sysdba

Step 7: Create a Server Parameter File

SQL > CREATE SPFILE FROM PFILE

Step 8: Start the Instance

SQL > startup nomount

ORACLE instance started.

Total System Global Area 217157632 bytes

Fixed Size 2251816 bytes

Variable Size 159384536 bytes

Database Buffers 50331648 bytes

Redo Buffers 5189632 bytes

Step 9: Issue the CREATE DATABASE Statement

[root@OCM] # mkdir-p / u01/app/oracle/oradata/PROD3/redo

[root@OCM] # mkdir-p / u01/logs/PROD3

[root@OCM] # mkdir-p / u02/logs/PROD3

[root@OCM u01] # cat createdb.sql

CREATE DATABASE PROD3

USER SYS IDENTIFIED BY sys_password

USER SYSTEM IDENTIFIED BY system_password

LOGFILE GROUP 1 ('/ u01 BLOCKSIZE BLOCKSIZE SIZE 100m BLOCKSIZE 512)

GROUP 2 ('/ u01 BLOCKSIZE BLOCKSIZE SIZE 100m BLOCKSIZE 512)

GROUP 3 ('/ u01 BLOCKSIZE BLOCKSIZE) SIZE 100m BLOCKSIZE 512

MAXLOGFILES 5

MAXLOGMEMBERS 5

MAXLOGHISTORY 1

MAXDATAFILES 100

CHARACTER SET AL32UTF8

NATIONAL CHARACTER SET AL16UTF16

EXTENT MANAGEMENT LOCAL

DATAFILE'/ u01 SIZE REUSE

SYSAUX DATAFILE'/ u01 SIZE REUSE

DEFAULT TABLESPACE users

DATAFILE'/ u01qqappActionoradataUsers01.dbf'

SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

DEFAULT TEMPORARY TABLESPACE tempts1

TEMPFILE'/ u01qqappActionoradataPlus PROD3andtemp01.dbf'

SIZE 20M REUSE

UNDO TABLESPACE undotbs

DATAFILE'/ u01qapplash oracle.oradata; PROD3; undotbs01.dbf'

SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

SQL > @ / u01/createdb.sql

Database created.

Step 10: Create Additional Tablespaces

Step 11: Run Scripts to Build Data Dictionary Views

SQL > @? / rdbms/admin/catalog.sql

SQL > @? / rdbms/admin/catproc.sql

SQL > @? / rdbms/admin/utlrp.sql

Step 12: (Optional) Run Scripts to Install Additional Options

Step 13: Back Up the Database.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup mount

ORACLE instance started.

Total System Global Area 217157632 bytes

Fixed Size 2251816 bytes

Variable Size 159384536 bytes

Database Buffers 50331648 bytes

Redo Buffers 5189632 bytes

Database mounted.

SQL > alter database archivelog

Database altered.

SQL > alter database open

Database altered.

Step 14: (Optional) Enable Automatic Instance Startup

Thank you for reading! This is the end of the article on "how to create a database by hand". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report