How to manually create data for oracle10g (linux)

Source: Internet
Author: User


On the oracle10g manual data creation (linux), according to the Convention, we had to say a few times before writing a blog post. I have been not interested in the database. This is my personal weakness, so I am eager to learn it. In the oracle video of instructor Xiao Bu, the structure, startup process, and parameter files mentioned in the previous sections will directly take me away. It is very easy for oracle to create a database automatically by using the Wizard. It is OK Step by step as prompted. Manual creation is essential for professional personnel. This process is also difficult now (because I did not pay attention to the details ). However, I spent three nights preparing for the draft. Here, I declare that this article focuses on the process. Through this process, you will have an understanding of manual creation, so it will be cool. ------------- Local oracle directory structure ------------------------------------------------------------ ora10 folder | -- product | -- admin | -- ora10 adump bdump cdump dpdump pfile udump | -- oradate | -- ora10 | -- 10.2.0 | -- db_1 | -- dbs spfileora10.ora init. ora orapwora10 ..... explain: the first step in oracle Database creation is to specify a sid, which is simple and give a name to our database. ORACLE_SID is 12 characters long and can only contain numbers and letters. It is case sensitive. Step 2: make sure that the required environment variable is set to ORACLE_BASE using ORACLE_HOME ORACLE_SID ORA_NLS33 PATH LD_LIBRARY_PATH to ensure ORACLE_HOME and ORACLE_SID are the [ora10 @ localhost pfile] $ env | grep ORA to view the environment variable ORACLE_SID = ora10ORACLE_BASE =/ora10/productORACLE_HOME =/ora10/product/10.2.0/db_1 [ora10 @ localhost ~] $ Vi. bash_profile view the settings of your local environment #. bash_profile # Get the aliases and functionsif [-f ~ /. Bashrc]; then .~ /. Bashrcfi # User specific environment and startup programsPATH = $ PATH: $ HOME/binexport PATHexport ORACLE_BASE =/ora10/productexport ORACLE_HOME = $ ORACLE_BASE/10.2.0/db_1export ORACLE_SID = ora10export shard = $ ORACLE_HOME/jdk/fre/lib/i386: $ ORACLE_HOME/jdk/jre/lib/i386/server: $ ORACLE_HOME/rdbms/lib: $ ORACLE_HOME/lib: $ LD_LIBRARY_PATHexport PATH = $ ORACLE_HOME/bin: $ PATH export NLS_LANG = American_America. ZHS16GBK [ora10 @ localhost dbs] $ touch chongshi. env creates a chongshi. env file [ora10 @ localhost dbs] $ vi chongshi. env edit ORACLE_BASE =/ora10/productORACLE_HOME = $ ORACLE_BASE/10.2.0/db_1ORACLE_SID = chongshi: The preceding environment is configured based on the original configuration of your machine. In fact, all the other content of ORACLE_SID that you need to modify can be consistent with the previous one. I have also passed the preceding steps. Only the ORACLE_HOME and ORACLE_SID options are required to avoid environment variable settings. The default value is provided here. Therefore, the content above is simplified. [Ora10 @ localhost dbs] $ chmod u + x chongshi. env adds an executable permission to the file [ora10 @ localhost dbs] $ ll total 52-rwxr -- r -- 1 ora10 dba 257 07-17. env [ora10 @ localhost dbs] $ .. /chongshi. env execution file (with spaces in the middle of the first two points) [ora10 @ localhost dbs] $ env | grep ORA check that our environment variable has been modified ORACLE_SID = chongshi www.2cto.com ORACLE_BASE =/ora10/productORACLE_HOME =/ora10/product/10.2.0/dba_1 prompt, you can switch back to another user without using environment variables. The environment variable becomes the default environment variable. Of course, you also need to execute ../chongshi. env to modify it. Step 3: select a database administrator authentication method. Here, we directly add oracle [ora10 @ localhost pfile] $ id to view the local iduid = 501 (ora10) gid = 501 (dba) groups = 501 (dba) Step 4: Create the initialization parameter file. here we need to create the oracle parameter file pfile/spfilepfile/spfile: oracle configures the database through a series of parameters. The parameter file is the place where the parameters are stored. oracle reads the related configuration from the parameters at startup. How can we configure this parameter file? This seems to be something that oracle is very good. After we create a database, oracle will automatically generate these parameters. All we need to do is create a file. [Ora10 @ localhost dbs] $ touch initchongshi. ora according to the naming rules of pfile/spfile, you must add your sid with init. [Ora10 @ localhost dbs] $ vi initchongshi. ora db_name = 'chongshi '----- You only need to create this parameter. You can create a table instance in windows by default in step 5: (windows only, because the local test environment is linux, skip this step. Step 6: connect to the instance. This step is very simple. It is equivalent to entering the database [ora10 @ localhost dbs] $ sqlplus/nologSQL * Plus: release 10.2.0.1.0-Production on Wed Jul 18 00:12:23 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. SQL> connect/as sysdbaConnected to an idle instance. if the preceding environment variable settings are incorrect, errors will occur. I got stuck here. Go back and check the environment variables carefully. Step 7: create a server parameter File. Follow the previous step and enter the database status. Run the following command to create spfileSQL> create spfile from pfile; File created. SQL>! // Exit SQL [ora10 @ localhost dbs] $ ll total 60-rwxr -- r -- 1 ora10 dba 88 07-18 chongshi. env-rw ---- 1 ora10 dba 1544 07-17 hc_ora10.dat-rw-r -- r -- 1 ora10 dba 19 07-17 33 initchongshi. ora-rw-r ----- 1 ora10 dba 12920 initdw. ora-rw-r ----- 1 ora10 dba 8385 init. ora-rw ---- 1 ora10 dba 24 06-18 lkORA10-rw-r ----- 1 ora10 dba 1536 06-18 orapwora10-rw-r ----- 1 or A10 dba 2560 07-16 orapwtest-rw-r ----- 1 ora10 dba 1536 07-18 spfilechongshi. ora-rw-r ----- 1 ora10 dba 3584 07-17 spfileora10.ora through pfile (initchongshi. ora) file generation spfile (spfilechongshi. ora) file! In fact, this step is similar to Step 4 in creating a Startup File. Default. No impact on the future. However, we recommend that you create an oracle database. If you create it here, the newly generated database uses spfile instead of pfile. What is the difference between Spfile and pfile. The difference between the old and the new is better than the old one. Step 8 of www.2cto.com: Start the instance [ora10 @ localhost dbs] $ exit exitSQL> startup nomount to start the database ORACLE instance started. total System Global Area 113246208 bytesFixed Size 1218004 bytesVariable Size 58722860 bytesDatabase Buffers 50331648 bytesRedo Buffers 2973696 bytesSQL> at this time, our background database is not started. The startup nomount command reads the content of the spfilechongshi. ora file. The previous step is required. Haha! Step 9: issue a statement to create a database. Note that the name of the database created here is the same as the name set in the parameter file created in step 4. [Ora10 @ localhost dbs] $ cat initchongshi. ora db_name = 'chongshi '[ora10 @ localhost dbs] $ exitexitSQL> create database chongshi; the file creation process is large and slow. Please wait! [Ora10 @ localhost dbs] $ ll total 188628-rwxr -- r -- 1 ora10 dba 88 07-18 chongshi. env-rw-r ----- 1 ora10 dba 6078464 07-18 cntrlchongshi. dbf-rw-r ----- 1 ora10 dba 81928192 07-18 dbs1chongshi. dbf-rw ---- 1 ora10 dba 1544 07-18 hc_chongshi.dat-rw-rw ---- 1 ora10 dba 1544 07-17 hc_ora10.dat-rw-r -- r -- 1 ora10 dba 19 07-17 initchongshi. ora-rw-r ----- 1 ora10 dba 12920 2001-05 -03 initdw. ora-rw-r ----- 1 ora10 dba 8385 init. ora-rw ---- 1 ora10 dba 24 07-18 lkCHONGSHI-rw ---- 1 ora10 dba 24 06-18 lkORA10-rw-r ----- 1 ora10 dba 52429312 07-18 log1chongshi. dbf-rw-r ----- 1 ora10 dba 52429312 07-18 log2chongshi. dbf-rw-r ----- 1 ora10 dba 1536 06-18 orapwora10-rw-r ----- 1 ora10 dba 2560 07-16 orapwtest-rw-r ----- 1 ora10 dba 1536 07-18 21:10 spfilechongshi. ora-rw-r ----- 1 ora10 dba 3584 07-17 spfileora10.ora the database we created is marked with a red icon in the above list ==================== ========================================== small Separator =============================== OK! After a few simple steps above, we have created a complete database because it is too simple to set up. This database is basically unavailable. Although the sparrow is small, the steps are complete. Steps 4 and 9 are difficult to manually create a database. Step 4, because the above pfile File Settings are too simple. Step 9: create a more practical database. It is not as simple as a command. Www.2cto.com. Haha! Are you angry? Cntrlchongshi. Exceptions. dbflog1chongshi. dbflog2chongshi. dbfinitchongshi. oraspfilechongshi. ora don't get angry. According to the operations above, we probably already know how to manually create a database. Next, we only need to focus on step 4 and Step 9. I will introduce this in the next section. Author wormhole

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.