Oracle 10g quick manual database creation steps, oracle10 g manual database creation steps

Source: Internet
Author: User

Oracle 10g quick manual database creation steps, oracle10 g manual database creation steps
0. Modify Environment Variables
[Oracle @ ocm1 ~] $ Vi. bash_profile

Add the following content: export ORACLE_SID = PROD
Export ORACLE_BASE =/u01/app/oracleexport ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1export PATH = $ ORACLE_HOME/bin: $ ORACLE_HOME/jdk/bin: $ PATH

1. Modify the logon identifier and Default Editor (optional)
Modify $ ORACLE_HOME/sqlplus/admin/glogin. SQL and add the following content at the end of the file:
Set sqlprompt '_ user'' @ ''_ connect_identifier> 'fine _ editor = vi2. Create initialization parameters (used to start database instances)[Oracle @ ocm1 dbs] $ cat init. ora | grep-v ^ $ | grep-v ^ #> initPROD. ora [oracle @ ocm1 dbs] $ lltotal 32-rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora-rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora-rw-r -- 1 oracle oinstall 738 Jan 10 initPROD. ora [oracle @ ocm1 dbs] $ vi initPROD. ora db_name = PRODdb_files = 80 # buckets = 8 # SMALL # db_block_buffers = 100 # SMALL # shared_pool_size = 3500000 # SMALLlog_checkpoint_interval = 10000 processes = 50 # buckets = 5 # SMALLlog_buffer = 32768 # Buffers 10240 # limit trace file size to 5 Meg eachglobal_names = FALSEcontrol_files = (/u01/app/oacle/oradata/PROD/Disk1/control01.ctl, /u01/app/oacle/oradata/PROD/Disk1/control02.ctl,/u01/app/oacle/oradata/PROD/Disk1/control03.ctl) undo_management = warning = 300Msga_target = 300 M
Note: The red part is the place to be added or modified.
3. Create a password file
[Oracle @ ocm1 dbs] $ orapwd file = orapwPROD password = oracle entries = 5 [oracle @ ocm1 dbs] $ lltotal 36-rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora-rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora-rw-r -- 1 oracle oinstall 914 Jan 10 initPROD. ora-rw-r ----- 1 oracle oinstall 2048 Jan 10 orapwPROD
4. Create related directories[Oracle @ ocm1 dbs] $ mkdir/u01/app/oracle/admin/PROD/{a, B, c, u} dump-p [oracle @ ocm1 dbs] $ cd/u01/app/oracle/admin/PROD [oracle @ ocm1 PROD] $ lltotal 16drwxr-xr-x 2 oracle oinstall 4096 Jan 10 adumpdrwxr -xr-x 2 oracle oinstall 4096 Jan 10 bdumpdrwxr-xr-x 2 oracle oinstall 4096 Jan 10 cdumpdrwxr-xr-x 2 oracle oinstall 4096 Jan 10 udump [oracle @ ocm1 PROD] $ cd/u01/app/oracle
[Oracle @ ocm1 oracle] $ mkdir oradata/PROD/Disk {1, 2, 4, 5}-p
[Oracle @ ocm1 oracle] $ cd oradata/PROD/[oracle @ ocm1 PROD] $ lltotal 20drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk1drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk2drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk3drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk4drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk5
5. Create a spfile
[Oracle @ ocm1 PROD] $ sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Sat Jan 10 19:25:04 2015
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to an idle instance.
SYS @ PROD> startup nomountORACLE instance started.
Total System Global Area 314572800 bytesFixed Size 1219184 bytesVariable Size 96470416 bytesDatabase Buffers 213909504 bytesRedo Buffers 2973696 bytesSYS @ PROD> create spfile from pfile;
File created.
After you create a spfile and start it, you can use alter sysem set xxx to dynamically modify the required parameters. You can use fuzzy search to obtain the names of unfamiliar parameters.
6. Create a database creation script crdb. SQL
Reffer: Administration-> Database Administrator's Guide-> 2 Creating an Oracle Database-> Manually Creating an Oracle Database-> Step 7: Issue the create database StatementCreate database prod user sys identified by oracle user system identified by oracle GROUP 1 ('/u01/app/oracle/oradata/PROD/Disk1/redo01_a.log ') SIZE 100 m group 2 ('/u01/app/oracle/oradata/PROD/Disk1/redo02_a.log ') SIZE 100 m group 3 ('/u01/app/oracle/oradata/PROD/Disk1/redo03_a.log ') SIZE 100 m maxlogfiles 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 MAXINSTANCES 1 character set US7ASCII national character set character datafile '/u01/app/oracle/oradata/PROD/Disk1/system01.dbf' SIZE 325 M reuse extent management local sysaux datafile '/u01/app/oracle/oradata/PROD/Disk1/sysaux01.dbf' SIZE 325 m reuse size 20 m reuse size 200 m reuse autoextend on maxsize unlimited;
You can replace the acceleration modification with % s. Pay attention to modifying the Instance name and corresponding path to ensure that the directory exists.
6. Start running script database creation (about 2 minutes)[Oracle @ ocm1 PROD] $ sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Sat Jan 10 19:51:10 2015
Copyright (c) 1982,200 5, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, OLAP and Data Mining options
SYS @ PROD> @/home/oracle/crdb. SQL
Database created.
At this point, the steps for creating a manual database have been basically completed, but this database is not used yet, because there are no system objects such as data dictionaries
7. Run the catalog. SQL and catproc. SQL scripts respectively (pay attention to the sequence)
SYS @ PROD> @? /Rdbms/admin/catalogSYS @ PROD> @? /Rdbms/admin/catproc

SYS @ PROD> select count (*) from dba_objects;
COUNT (*) ---------- 9373
After the script is run, you can query the tables and views of each system. By default, 9373 System Objects (10 Gb) are created after the script is run)
Another faster method is to set db_create_file_dest and db_create_online_logfile_dest1, run create database xxx directly, and then adjust the specific path or parameters as needed.
Reminder:
After creating the database, remember to close the database and use tar for cold backup, mainly the two directories PROD and dbs, so you are not afraid of accidental deletion, after using tar, do not use the command parameters for decompression and compression. Otherwise, you may accidentally change irrelevant content in the current directory into backup content, overwriting the original backup content, it is very bad. By default, if the generated tar file has the same name, it will be overwritten rather than appended to the original compressed file.






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.