Create a database manually
1. Create a folder. (according to just/u01 / app/oracle/admin/in the former, We also create) the mkdir -p/u01 / app/oracle/admin/mydb/adumpmkdir – p / u01 / app/oracle/admin/mydb/adumpmkdir -p/u01 / app/oracle/admin/mydb/adump mkdir -p/u01 / app/oracle/admin/mydb/bdump The mkdir -p/u01 / app/oracle/admin/mydb/udumpmkdir -p/u01 / app/oracle/admin/mydb/udumpmkdir -p/u01 / app/oracle/admin/mydb/udump The mkdir -p/u01 / app/oracle/admin/mydb/cdump mkdir -p/u01 / app/oracle/admin/mydb/pfilemkdir – p / u01 / app/oracle/admin/mydb/pfilemkdir -p/u01 / app/oracle/admin/mydb/pfile mkdir -p/u01 / app/oracle/admin/mydb/script $ Mkdir/u01 / app/oracle/oradata/mydb including: three must: Bdump (backup_dump_list) Udump (user_dump_list) Cdump (core_dump_list) Core tracing files, system processes, and kernel tracing files Other options are optional. Adump (audit_dump_list) Audits files
2, create a parameter file, in fact, the content of the parameter file is similar to each database, we only need to change some content in the middle, so we Copy the orCL parameter file and change it to what we need. cp/u01/app/oracle/admin/orcl/scripts/init.ora/u01/app/oracle/admin/mydb/pfilecp /u01/app/oracle/admin/orcl/scripts/init.ora /u01/app/oracle/admin/mydb/pfilecp/u01/app/oracle/admin/orcl/scripts/init.ora/u01/app/oracle/admin/mydb/pfile vi / u01 / app/oracle/admin/mydb/pfile/init. Ora according to the above we can see the init. Ora to carry on the following changes:
Copyright (c) 1991, 2001, 2002 by Oracle Corporation
Cache and I/O
db_block_size=8192 db_file_multiblock_read_count=16
Cursors and Library Cache
open_cursors=300
Database Identification
db_domain=”” db_name=mydb
Diagnostics and Statistics
background_dump_dest=/u01/app/oracle/oradata/mydb/bdump core_dump_dest=/u01/app/oracle/oradata/mydb/cdump user_dump_dest=/u01/app/oracle/oradata/mydb/udump
File Configuration
control_files=(“/u01/app/oracle/oradata/mydb/control01.ctl”, “/u01/app/oracle/oradata/mydb/control02.ctl”, “/u01/app/oracle/oradata/mydb/control03.ctl”) db_recovery_file_dest=/u01/app/oracle/flash_recovery_area db_recovery_file_dest_size=2147483648
Job Queues
job_queue_processes=10
Miscellaneous
Compatible = 10.2.0.1.0
Processes and Sessions
processes=150
SGA Memory
sga_target=262144000
Security and Auditing
audit_file_dest=/u01/app/oracle/admin/mydb/adump remote_login_passwordfile=EXCLUSIVE
Sort, Hash Joins, Bitmap Indexes
pga_aggregate_target=87031808
System Managed Undo and Rollback Segments
undo_management=AUTO undo_tablespace=UNDOTBS1
3. If the instance is started when the computer starts, close it. If not, skip this step. If relative electron has more intuitive understanding, it can also refer to its format as follows:
Game Agent: www.walajiao.com
$ sqlplus
Oracle Database Release 10.2.0.1.0 – Production on Mon Sep 15 21:47:07 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: / as sysdba Connected to an idle instance.
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit
4. Set the environment variable SID to the current mydb. $ export ORACLE_SID=mydb
5. Create a password file. $orapwd file = / u01 / app/oracle/product / 10.2 / DBS/orapwmydb ora password = oracle force = y entries = n file naming rules: Orapw + instance name, so here we have orapwMydb.ora. Entries: The maximum number of users that can be stored in the password file, corresponding to the maximum number of users that are allowed to access the game agent database with sysdba/Syso per permission, if this limit is exceeded, the password file must be rebuilt. Used when the administrator remotely logs in
6. Now that everything is done, let’s start the example. [Copy to clipboard]View Code SQL $ sqlplus /nolog
Oracle Database Release 10.2.0.1.0 – Production on Mon Sep 15 22:23:32 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba Connected to an idle instance.
SQL> startup nomount pfile=”/u01/app/oracle/admin/mydb/pfile/init.ora” ORACLE instance started.
Total System Global Area 264241152 bytes Fixed Size 1218868 bytes Variable Size 88082124 bytes Database Buffers 171966464 bytes Redo Buffers 2973696 bytes
Create database scripts. $vi/u01 / app/oracle/admin/mydb/script/createdb. SQL create an empty creawww.walajiao.com tedb. SQL file, write. create database mydb maxlogfiles 5 maxlogmembers 5 maxloghistory 1 maxdatafiles 100 maxinstances 1 user sys identified by oracle user system identified by oracle logfile group 1 (‘/u01/app/oracle/oradata/mydb/redo01.log’) size 10m reuse,
group 2 ('/u01/app/oracle /oradata/mydb/redo02.log') size 10m reuse,
group 3 ('/u01/app/oracle /oradata/mydb/redo03.log') size 10m reuse
Copy the code
datafile ‘/u01/app/oracle/oradata/mydb/system01.dbf’ size 325m reuse
extent management local sysaux datafile ‘/u01/app/oracle/oradata/mydb/sysaux01.dbf’ size 325m reuse default temporary tablespace temp
tempfile ‘/u01/app/oraclehttp://www.walajiao.com//oradata/mydb/temp01.dbf’ size 20m reuse undo tablespace undotbs1
datafile ‘/u01/app/oracle/oradata/mydb/undo01.dbf’ size 200m reuse character set zhs16gbk national character set al16utf16;
8. Execute the script to create the database. SQL> /u01/app/oracle/admin/mydb/script/createdb.sql
Execute catalog.sql to create a data dictionary view for the database. SQL > / u01 / app/oracle/product / 10.2 / RDBMS/admin/catalog. The SQL
SQL to create all the packages needed to execute the PL/SQL program. SQL > / u01 / app/oracle/product / 10.2 / RDBMS/admin/catproc SQL
11 generate SPFILE files Create SPFILE FROM pfile = ‘/ u01 / app/oracle/admin/mydb/pfile/init. Ora “; shutdown immediate; connect SYS/oracle as SYSDBA startup ;