优秀网站建设哪家好,广州seo和网络推广,怎么注册亚马逊跨境电商,兰州市做网站的安装第二个数据库#xff1a;登录oracle用户进入家目录#xff0c;添加配置环境变量#xff1a;vi .bash_profier
ORACLE_SIDprod2临时环境变量#xff1a;$export ORACLE_HOME/u01/app/oracle/product/11.2.0/db_1
$export ORACLE_SIDprod2创建第二个数据库文件目录#… 安装第二个数据库 登录oracle用户进入家目录添加配置环境变量 vi .bash_profier
ORACLE_SIDprod2临时环境变量 $export ORACLE_HOME/u01/app/oracle/product/11.2.0/db_1
$export ORACLE_SIDprod2创建第二个数据库文件目录 $mkdir -p /u01/app/oracle/oradata/prod2创建sys用户密码文件 $cd /u01/app/oracle/product/11.2.0/db_1/dbs
$orapwd fileorapwprod2 passwordoracle 创建一个可读参数文件 $vi initprod2.ora
添加
DB_NAMEprod2
sga_target500M
control_files/u01/app/oracle/oradata/prod2/control01.ctl打开实例进入nomount模式创建数据库系统procview …… 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 多个数据库切换. oraenv [oracletest ~]$ . 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家目录需手动输入地址解决方法如下 vi /etc/oratab当用dbca窗口删库时添加oratab文件后dbca数据库列表会显示数据库名 添加到最后一行参数Y代表支持dbstart和dbshut启停数据库 prod2:/u01/app/oracle/product/11.2.0/db_1:Y # 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演示1 [oracletest ~]$ 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
[oracletest ~]$ 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
[oracletest ~]$ ps -ef|grep smon
\oracle 12955 12285 0 02:12 pts/2 00:00:00 grep smon演示2 [oracletest ~]$ . oraenv
ORACLE_SID [prod2] ? prod1
The Oracle base for ORACLE_HOME/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle
[oracletest ~]$ 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
[oracletest ~]$ 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
[oracletest ~]$ 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
[oracletest ~]$ ps -ef|grep smon
oracle 13550 12285 0 02:14 pts/2 00:00:00 grep smon 监听器没有受到快捷启停命令的影响 [oracletest ~]$ 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 转载于:https://www.cnblogs.com/kingwwz/p/10759817.html