时间:2021-07-01 10:21:17 帮助过:4人阅读
vi .bash_profier ORACLE_SID=prod2
$export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 $export ORACLE_SID=prod2
$mkdir -p /u01/app/oracle/oradata/prod2
$cd /u01/app/oracle/product/11.2.0/db_1/dbs $orapwd file=orapwprod2 password=oracle
$vi initprod2.ora 添加: DB_NAME=prod2 sga_target=500M control_files=‘/u01/app/oracle/oradata/prod2/control01.ctl‘
SQL> sqlplus / as sysdba SQL> startup nomount; SQL> create spfile from pfile; SQL> shutdown immediate; SQL> startup nomount; SQL> alter system set db_create_file_dest=‘/u01/app/oracle/oradata/prod2‘; SQL> create database character set AL32UTF8 extent management local; SQL> @?/rdbms/admin/catalog.sql; SQL> @?/rdbms/admin/catproc.sql; SQL> alter user system identified by oracle account unlock; SQL> conn system/oracle SQL> @?/sqlplus/admin/pupbld.sql;
SQL> show parameter name; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string db_name string prod2 db_unique_name string prod2 global_names boolean FALSE instance_name string prod2 lock_name_space string log_file_name_convert string service_names string prod2
[oracle@test ~]$ . oraenv ORACLE_SID = [prod2] ? prod1 The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle
# This file is used by ORACLE utilities. It is created by root.sh # and updated by the Database Configuration Assistant when creating # a database. # A colon, ‘:‘, is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, ‘#‘, are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # prod1:/u01/app/oracle/product/11.2.0/db_1:Y prod2:/u01/app/oracle/product/11.2.0/db_1:Y
[oracle@test ~]$ ps -ef|grep smon oracle 11062 1 0 00:25 ? 00:00:00 ora_smon_prod2 oracle 12799 12285 0 02:12 pts/2 00:00:00 grep smon [oracle@test ~]$ dbshut ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbshut ORACLE_HOME Processing Database instance "prod1": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log Processing Database instance "prod2": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log [oracle@test ~]$ ps -ef|grep smon \oracle 12955 12285 0 02:12 pts/2 00:00:00 grep smon
[oracle@test ~]$ . oraenv ORACLE_SID = [prod2] ? prod1 The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle [oracle@test ~]$ dbstart ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbstart ORACLE_HOME Processing Database instance "prod1": log file /u01/app/oracle/product/11.2.0/db_1/startup.log Processing Database instance "prod2": log file /u01/app/oracle/product/11.2.0/db_1/startup.log [oracle@test ~]$ ps -ef|grep smon oracle 13130 1 0 02:13 ? 00:00:00 ora_smon_prod1 oracle 13239 1 0 02:13 ? 00:00:00 ora_smon_prod2 oracle 13390 12285 0 02:14 pts/2 00:00:00 grep smon [oracle@test ~]$ dbshut ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbshut ORACLE_HOME Processing Database instance "prod1": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log Processing Database instance "prod2": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log [oracle@test ~]$ ps -ef|grep smon oracle 13550 12285 0 02:14 pts/2 00:00:00 grep smon
[oracle@test ~]$ ps -ef|grep lsnr oracle 13609 1 0 02:18 ? 00:00:00 /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit oracle 13621 12285 0 02:19 pts/2 00:00:00 grep lsnr
Oracle 用脚本安装第二个数据库
标签:target param 配置环境 roc pwd 无法 led media dmi