Oracle 10g fast hand-built library steps

Source: Internet
Author: User

1. Modify the login identifier and default editor (not required)
Modify $oracle_home/sqlplus/admin/glogin.sql to add the following at the end of the file:
set sqlprompt ' _user ' @ ' _connect_identifier> 'define _EDITOR=VI 2. Create initialization parameters (to start a DB instance)[Email protected] dbs]$cat init.ora|grep-v ^$|grep-v ^# > Initprod.ora[[email protected] dbs]$ lltotal 32-rw-r-----1 Oracle Oinstall 12920 May 3 2001 INITDW.ORA-RW-R-----1 Oracle Oinstall 8385 SEP 1998 init.ora-rw-r--r--1 Oracle oinstall 738 Jan 10 19:18Initprod.ora[Email protected] dbs]$ VI Initprod.oraDb_name=prodDb_files = # Smalldb_file_multiblock_read_count = 8 # SMALL#db_block_buffers =# SMALL#shared_pool_size = 3500000# smalllog_checkpoint_interval = 10000processes = Smallparalle                                                    L_max_servers = 5 # Smalllog_buffer = 32768 # smallmax_dump_file_size = 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=autosga_max_size=300msga_target=300m
Note: The red part is where you need to add or modify
3. Create a password file
[Email protected] dbs]$orapwd file=orapwprod password=oracle entries=5[[email protected] dbs]$ lltotal 36-rw-r-----1 Oracle Oinstall 12920 May 3 2001 INITDW.ORA-RW-R-----1 Oracle Oinstall 8385 SEP 1998 init.ora-rw-r--r--1 Oracle oinstall 914 Jan 19:21 initprod.ora-rw-r-----1 Oracle Oinstall 2048 Jan 10 19:24Orapwprod
4. Create a related directory[Email protected] dbs]$ mkdir/u01/app/oracle/admin/prod/{a,b,c,u}dump-p[[email protected] dbs]$ cd/u01/app/oracle/admin/prod[[email protected] prod]$ lltotal 16drwxr-xr-x 2 Oracle Oinstall 4 096 Jan 19:23 adumpdrwxr-xr-x 2 Oracle oinstall 4096 Jan 19:23 bdumpdrwxr-xr-x 2 Oracle oinstall 4096 Jan 19:23 C Dumpdrwxr-xr-x 2 Oracle Oinstall 4096 Jan 19:23 udump[[email protected] prod]$ cd/u01/app/oracle
[Email protected] oracle]$ mkdir oradata/prod/disk{1,2,3,4,5}-P
[[Email protected] oracle]$ CD Oradata/prod/[[email protected] prod]$ lltotal 20drwxr-xr-x 2 Oracle oinstall 4096 Jan 10 1 9:22 disk1drwxr-xr-x 2 Oracle oinstall 4096 Jan 19:22 disk2drwxr-xr-x 2 Oracle oinstall 4096 Jan 19:22 DISK3DRWXR-XR -X 2 Oracle Oinstall 4096 Jan 19:22 disk4drwxr-xr-x 2 Oracle oinstall 4096 Jan 19:22 Disk5
5. Create SPFile
[Email protected] prod]$ Sqlplus/as SYSDBA
Sql*plus:release 10.2.0.1.0-production on Sat Jan 10 19:25:04 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
[Email protected]> startup Nomountoracle instance started.
Total System Global area 314572800 bytesfixed size 1219184 bytesvariable size 96470416 byte Sdatabase buffers 213909504 Bytesredo buffers 2973696 bytes[email protected]>create SPFile from Pfile;
File created.
After creating the SPFile and using it to start, it is possible to modify the required parameters dynamically by alter SYSEM set XXX, which can be used to get unfamiliar parameter names by using Fuzzy Lookup.
6. Create a Build library 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 the Oracle user SYSTEM identified by Oracle GROUP 1 ('/u01/app/oracl E/oradata/prod/disk1/redo01_a.log ') Size 100M GROUP 2 ('/u01/app/oracle/oradata/prod/disk1/redo02_a.log ') size 1 00M GROUP 3 ('/u01/app/oracle/oradata/prod/disk1/redo03_a.log ') SIZE 100M maxlogfiles 5 maxlogmembers 5 MA Xloghistory 1 maxdatafiles maxinstances 1 CHARACTER set US7ASCII national CHARACTER set AL16UTF16 datafile ' /U01/APP/ORACLE/ORADATA/PROD/DISK1/SYSTEM01.DBF ' SIZE 325M reuse EXTENT MANAGEMENT LOCAL sysaux datafile '/u01/app/ora CLE/ORADATA/PROD/DISK1/SYSAUX01.DBF ' size 325M reuse SIZE 20M reuse size 200M reuse autoextend on MAXSIZE Unlimi TED;
You can replace accelerated modifications with%s, notice that you modify the instance name and the appropriate path to ensure that the directory exists
6. Start Run Script Build library (approx. 2 min)[Email protected] prod]$ Sqlplus/as SYSDBA
Sql*plus:release 10.2.0.1.0-production on Sat Jan 10 19:51:10 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:oracle Database 10g Enterprise Edition Release 10.2.0.1.0-productionwith The partitioning, OLAP and Data Mi Ning Options
[Email protected]>@/home/oracle/crdb.sql
Database created.
At this point, has basically completed the manual construction of the library steps, but this library is still not used, because there is no data dictionary and other system objects
7. Run Catalog.sql and Catproc.sql scripts separately (note the sequencing)
[Email protected]> @?/rdbms/admin/Catalog[Email protected]> @?/rdbms/admin/Catproc

[Email protected]> Select COUNT (*) from dba_objects;
COUNT (*)----------9373
Run the script to execute the query for each system table and view, you can see that the default manually built library after running the script system object is 9,373 (10g)
There is also a quicker way to set up Db_create_file_dest and Db_create_online_logfile_dest1, then run create DB directly, and then adjust the specific path or parameter as needed
Friendly reminder:
After the library, remember to shut down the database with tar for cold backup, mainly prod and DBS these 2 directories, so it is not afraid of accidental deletion, with tar after the attention of the decompression and compression of the command parameters do not use the wrong, otherwise inadvertently will be the current directory irrelevant content into backup content, overwriting the original backup content , which is very bad, by default if the generated tar file has the same name, it will be overwritten directly instead of being appended to the original compressed file.






Oracle 10g fast hand-built library steps

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.