Manually add a database to oracle

Source: Internet
Author: User

When oracle manually adds a database and starts the database instance normally, 1. manually delete the old database. Stop the running database www.2cto.com SQL> shutdown immediate; enter the Mount database (load the instance and open the control file, activate some functions, and the user cannot access the database to restore the instance or data) SQL> startup mount; when the silent State is enabled, DBAs can safely perform certain operations, which must be isolated from the current non-DBA users. SQL> alter system enable restricted session; Delete the original database SQL> drop database; 2. manual database creation (1) modify the oracle user's. bash_profile: edit the oracle environment $ source. bash_profile (2) create a new instance library with the pfile $ vi $ ORACLE_HOME/dbs/init $ ORACLE_SID.ora file with the TEST row. Load the original Instance library and delete the four rows, and pga_aggregate_target = users =/oracle/app/admin/TEST/bdumpuser_dump_dest =/oracle/app/admin/TEST/udumpcore_dump_dest =/oracle/app/admin/TEST/cdumpaudit_fil E_dest =/oracle/app/admin/TEST/adump change the TEST in the control_files and db_name lines to the new instance library name (3) create a password file orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = 123456 force = y (4) create the required directory [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/adump [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/bdump [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/pfile [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/cdump [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/dpdump [oracle @ sq ~] $ Mkdir-p $ ORACLE_BASE/admin/$ ORACLE_SID/udump at this time, you should also create a new database directory [oracle @ sq2 dbs] $ mkdir-p/oracle/app/oradata/NIMEIA/ (5) create spfileSQL> startup nomountSQL> create spfile from pfile; (6) create a database vi/home/oracle/createDB for the new instance. SQL content: create database NIMEIAlogfile group 1 ('$ ORACLE_BASE/oradata/NIMEIA/redo01.log') size 100 m, group 2 ('$ ORACLE_BASE/oradata/NIMEIA/redo02.log ') size: 100 m, group 3 ('$ ORACLE_BASE/orada Ta/NIMEIA/redo03.log ') size 100 limit 10 maxlogmembers 5 maxloghistory 5 maxdatafiles 100 maxinstances 1 character set comment '$ ORACLE_BASE/oradata/NIMEIA/comment 'size 350 m reuse autoextend on next 1 m maxsize unlimited extent management localsysaux datafile '$ ORACLE_BASE/oradata/sysaux01.dbf' size 350 m reuse autoextend on next 1 m maxsize unlimitedde Fault temporary tablespace temp01 tempfile '$ ORACLE_BASE/oradata/NIMEIA/comment 'size 50 m reuse autoextend on next 1 m maxsize 500 mundo tablespace undotbs1 datafile' $ ORACLE_BASE/oradata/NIMEIA/comment' size 500 m reuse autoextend on next 1 m maxsize unlimited; www.2cto.com (7) Start database creation SQL> @/home/oracle/createDB. SQL database dictionaries cannot be used at this time. (8) Create a database dictionary view @/$ ORACLE_HOME/rdbms/admin/catalog. SQL (9) create a stored procedure package @/$ ORACLE_HOME/rdbms/admin/catproc. after the SQL statement is successful, PL/SQL procedure successfully completed is displayed. PL/SQL procedure successfully completed. package body created. no errors. package body created. PL/SQL procedure successfully completed.

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.