Create database manually
As a DBA, you must always remember what to use or prohibit the use of RM commands. If you are never able to use them, you must be careful and careful when you press Enter!
Red Hat Enterprise 3 + Oracle 10g Release 2
$ Su-Oracle
1 --- set system environment variables:
ORACLE_HOME =/opt/Oracle/product/10.2
Oracle_base =/opt/Oracle
Oracle_sid = dbtest
......
2 --- system planning:
Instance name oracle_sid = dbtest
Database Name db_name = dbtest
3 --- manually create the following directory:
/Opt/Oracle/admin/dbtest/cdump
/Opt/Oracle/admin/dbtest/bdump
/Opt/Oracle/admin/dbtest/udump
/Opt/Oracle/admin/dbtest/pfile
/Opt/Oracle/oradata/dbtest/
/Opt/Oracle/oradata/dbtest/archive
4 --- create a password file:
Orapwd file =/opt/Oracle/product/10.2/dbs/orapwd_dbtest Password = Superman
5 --- modify the parameter file:
Format:/opt/Oracle/product/10.2/dbs/init. ora
Instance:/opt/Oracle/product/10.2/dbs/initdbtest. ora
The content is as follows:
---------------------------------------------------
Dbtest. _ db_cache_size = 331350016
Dbtest. _ java_pool_size = 4194304
Dbtest. _ large_pool_size = 8388608
Dbtest. _ shared_pool_size = 138412032
Dbtest. _ streams_pool_size = 0
*. _ Kgl_large_heap_warning_threshold = 8388608
*. Audit_file_dest = '/opt/Oracle/admin/dbtest/adump'
*. Background_dump_dest = '/opt/Oracle/admin/dbtest/bdump'
*. Compatible = '10. 2.0.1.0'
*. Control_files = '/opt/Oracle/oradata/dbtest/control01.ctl', '/opt/Oracle/oradata/dbtest/control02.ctl', '/opt/Oracle/oradata/dbtest/control03.ctl'
*. Core_dump_dest = '/opt/Oracle/admin/dbtest/cdump'
*. Db_2k_cache_size = 33554432
*. Db_block_size = 8192
*. Db_domain =''
*. Db_file_multiblock_read_count = 128
*. Db_files = 4000
*. Db_name = 'dbtest'
*. Db_recovery_file_dest_size = 4294967296
*. Db_recovery_file_dest =''
*. Log_archive_dest = '/opt/Oracle/oradata/dbtest/archive'
*. Log_checkpoints_to_alert = false
*. Open_cursors = 300
*. Parallel_execution_message_size = 65535
*. Parallel_max_servers = 128
*. Pga_aggregate_target = 209715200
*. Processses = 150
*. Recyclebin = 'off'
*. Remote_login_passwordfile = 'clusive'
*. Replication_dependency_tracking = false
*. Session_cached_cursors = 100
*. Sga_target = 500 m
*. Shared_pool_size = 100 m
*. Undo_management = 'auto'
*. Undo_retention = 0
*. Undo_tablespace = 'undots'
*. User_dump_dest = '/opt/Oracle/admin/dbtest/udump'
*. Workarea_size_policy = 'auto'
_ Allow_resetlogs_upload uption = true
---------------------------------------------------
Copy this file to:/opt/Oracle/admin/dbtest/pfile/init. ora
6 --- log on to Oracle:
> Sqlplus "/As sysdba"
7 --- start the instance:
SQL> startup nomount pfile =/opt/Oracle/admin/dbtest/pfile/init. ora
8 --- database creation script:
-----------------------------------------------------------
Create Database dbtest
Logfile
Group 1 ('/opt/Oracle/oradata/dbtest/redo01.log', '/opt/Oracle/oradata/dbtest/redo01_1.log') size 100 m reuse,
Group 2 ('/opt/Oracle/oradata/dbtest/redo02.log', '/opt/Oracle/oradata/dbtest/redo02_1.log') size 100 m reuse,
Group 3 ('/opt/Oracle/oradata/dbtest/redo03.log', '/opt/Oracle/oradata/dbtest/redo03_1.log') size 100 m Reuse
Maxlogfiles 50
Maxlogmembers 5
# Maxloghistory 200
Maxdatafiles 500
Maxinstances 5
Archivelog
Character Set utf8
National Character Set utf8
Datafile '/opt/Oracle/oradata/dbtest/system01.dbf' size 1000 m extent management local
Sysaux datafile '/opt/Oracle/oradata/dbtest/sysaux01.dbf' size 1000 m
Undo tablespace undots datafile '/opt/Oracle/oradata/dbtest/undo. dbf' size 500 m
Default temporary tablespace temp tempfile '/opt/Oracle/oradata/dbtest/temp. dbf' size 500 m
9 --- run the following files (the following installation sequence ):
/Opt/Oracle/product/10.2/rdbms/admin/CATALOG. SQL
/Opt/Oracle/product/10.2/rdbms/admin/catproc. SQL
10 --- create related tablespaces and users:
Create tablespace users datafile '/opt/Oracle/oradata/dbtest/users01.dbf' size 1000 m; --- data table space
Create tablespace indx datafile '/opt/Oracle/oradata/dbtest/indx01.dbf' size 1000 m; --- use this tablespace as a storage space when creating an index, that is to say, using a tablespace to store indexes is a good habit, although we cannot create a default index tablespace!
Create user test identified by test default tablespace users; --- test user
Grant connect, resource to test;
11 --- notes:
1> set the directories of relevant files, including data files, control files, parameter files, and so on. They must be in the same position as those specified in the control file.
2> the name of undo_tablespace in. init. ora must be the same as that of create database, including case sensitivity. Otherwise it will be very troublesome. You don't know if you are fooling around with the errors! In a word, the content in the control file must be the same as the content in the init file and the actual situation of the actual file.
3> if an error occurs in the analysis database, you can find it in/opt/Oracle/admin/dbtest/bdump/alert_dbtest.log.
Reminder again: As a DBA, RM commands are used.