DB INIT IN WINDOWS (FOR 12C)
Uat oracleDB-Uat 192.168.63.121 Windows server 2012 R2 2核12G,硬盘160G
内置用户是oaadmin,(建议将这个账号改称administrator ,然后使用用户来安装数据库)
administrator/
123
With Windows, you log in to a user account with Administrator privileges to install the Oracle Database software. You can also specify an Oracle Home User (standard Windows User Account, not Administrator account) during installation. On Linux and UNIX systems, you must create and use a software owner user account, and this user must belong to the Oracle Inventory group.
oracle 密码与windows 密码一致
编码:AL32UTF8
数据库名unityuat
PDB pdbunityuat
system/oracle123
非归档模式
show con_name
select con_id,dbid,name,open_mode from v$pdbs;
alter pluggable database PDBUNITYUAT open;
CREATE TRIGGER open_all_pdbs AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database all open' ;
END open_all_pdbs ;
alter session set container=pcndba2;
DTARUAT =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = REGISTER_dtaruat))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.27.145)(PORT = 15021))
(ADDRESS = (PROTOCOL = TCPS)(HOST = 192.168.27.145)(PORT = 15022))
)
)
SID_LIST_DTARUAT=
(SID_LIST =
(SID_DESC =
(SID_NAME = dtaruat)
(ORACLE_HOME = /opt/oracle12c/product/12.1.0)
)
(SID_DESC =
(GLOBAL_DBNAME = pdtaruat)
(SID_NAME = dtaruat)
(ORACLE_HOME = /opt/oracle12c/product/12.1.0)
)
(SID_DESC =
(GLOBAL_DBNAME = pTESTtuat)
(SID_NAME = dtaruat)
(ORACLE_HOME = /opt/oracle12c/product/12.1.0)
)
)
SECURE_REGISTER_dtaruat= (IPC)
SECURE_CONTROL_dtaruat=(TCPS,IPC)
ADMIN_RESTRICTIONS_dtaruat= ON
DIAG_ADR_ENABLED_dtaruat= OFF
1、配置监听
首先要明确,所有的PDB都使用1个监听,配置多个实际上启动时也只有第1个有意义。
LISTENER=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =ora12c_A)(PORT = 1521))
)
接下来使用SID_LIST_LISTENER来进行静态注册服务。
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC =
(GLOBAL_DBNAME = ora12c)
(SID_NAME = ora12c)
)
(SID_DESC =
(GLOBAL_DBNAME = pdborcl)#该服务是我配置的pdb信息
(SID_NAME = ora12c)
)
)
ADR_BASE_LISTENER= /opt/oracle
2、tnsnames.ora配置
观察发现,在tnsnames中配置pdb跟CDB,即原来11g的配置完全一样。这里SERVICE_NAME = pdborcl使用得是PDB的名字,可以在v$pdbs中查看。
ORA12C=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =ora12c_A)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora12c)
)
)
pdborcl=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =ora12c_A)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pdborcl)
)
)
3、为了保险,检查下sqlnet.ora
NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)
这一句是为了保证优先使用TNSNAMES解析。
配置完,在PDB启动的情况下(怎么启动这里不多讲了),就可以直接连接到PDB了。(Oracle12c是没有scott用户的,我自己在PDB下面新建的)。
win2012关闭防火墙
- win2012操作系统
百度经验:jingyan.baidu.com
方法/步骤
- 1
点击右下角窗口图标,如图
点击管理工具,如图
点击高级安全windows防火墙,如图
- 4
点击windows防火墙属性,再在防火墙状态选择关闭选项即可,如图
APPLY PSU and OJVM PSU
http://www.cnblogs.com/jyzhao/p/5895617.html
set ORACLE_HOME=C:\app\oracle\product\12.1.0\dbhome_1
set PATH=%ORACLE_HOME%\perl\bin;%ORACLE_HOME%\OPatch;%PATH%
C:\app\oracle\product\12.1.0\dbhome_1\OPatch\opatch apply
设置环境变量:
- 在弹出的窗口中点击顶部的“计算机”标签,然后在出现的菜单中点击“系统属性”选项。
- 在新的页面中,点击左侧导航栏中的“高级系统设置”。
- 在弹出的页面中, 点击下部的“环境变量”按钮。弹出环境变量的管理页面。
- 在环境变量的管理页面中,在下部列表框中找到Path变量, 单击选中, 然后点击下面的“编辑”按钮。
- 弹出的页面有两个输入框, 在“变量值”输入框的末尾添加你要增加的路径,格式为 ;全路径,即分号加路径。注意这里分号必须是英文分号。比如我在安装Python2.7后添加的部分如图所示。
for ojvm only (30 minutes)
Steps |
Single Tenant (non-CDB/PDB) |
Steps |
Multitenant (CDB/PDB) |
1 |
% sqlplus /nolog |
1 |
% sqlplus /nolog |
2 |
SQL> Connect "/as sysdba" |
2 |
SQL> Connect "/as sysdba" |
3 |
SQL> shutdown |
3 |
SQL> shutdown |
4 |
SQL> startup upgradeFoot 1 |
4 |
SQL> startup upgradeFoot 1 |
5 |
SQL> quit |
5 |
SQL> alter pluggable database all open upgrade ;Foot 2 |
6 |
% cd %ORACLE_HOME%\OPatch |
6 |
SQL> quit |
7 |
% datapatch -verbose |
7 |
% cd %ORACLE_HOME%\OPatch |
8 |
% sqlplus /nolog |
8 9 11 12 13 |
% datapatch -verbose SQL> Connect "/as sysdba" SQL> shutdown SQL> startupFoot3 SQL> alter pluggable database all open; |
INIT TABLESPACE AND USERS
ngtest1:/dtaruatdb/change/env [dtaruat] >more initpTESTtuat.sql
spool init_pTESTtuat.log
set echo on time on lines 120 pages 100
@env_pTESTtuat_uat.sql
alter session set container=pTESTtuat;
CREATE OR REPLACE FUNCTION verify_function
(username varchar2,
password varchar2,
old_password varchar2)
RETURN boolean IS
n boolean;
m integer;
differ integer;
isdigit boolean;
ischar boolean;
ispunct boolean;
digitarray varchar2(20);
punctarray varchar2(25);
chararray varchar2(52);
BEGIN
digitarray:= '0123456789';
chararray:= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
punctarray:='!"#$%&()``*+,-/:;<=>?_';
-- Check if the password is same as the username
IF NLS_LOWER(password) = NLS_LOWER(username) THEN
raise_application_error(-20001, 'Password same as or similar to user');
END IF;
-- Check for the minimum length of the password
IF length(password) < 4 THEN
raise_application_error(-20002, 'Password length less than 4');
END IF;
-- Check if the password is too simple. A dictionary of words may be
-- maintained and a check may be made so as not to allow the words
-- that are too simple for the password.
IF NLS_LOWER(password) IN ('welcome', 'database', 'account', 'user', 'password', 'oracle', 'computer', 'abcd') THEN
raise_application_error(-20002, 'Password too simple');
END IF;
-- Check if the password contains at least one letter, one digit and one
-- punctuation mark.
-- 1. Check for the digit
isdigit:=FALSE;
m := length(password);
FOR i IN 1..10 LOOP
FOR j IN 1..m LOOP
IF substr(password,j,1) = substr(digitarray,i,1) THEN
isdigit:=TRUE;
GOTO findchar;
END IF;
END LOOP;
END LOOP;
IF isdigit = FALSE THEN
raise_application_error(-20003, 'Password should contain at least one digit, one character and one punctuation');
END IF;
-- 2. Check for the character
<<findchar>>
ischar:=FALSE;
FOR i IN 1..length(chararray) LOOP
FOR j IN 1..m LOOP
IF substr(password,j,1) = substr(chararray,i,1) THEN
ischar:=TRUE;
GOTO findpunct;
END IF;
END LOOP;
END LOOP;
IF ischar = FALSE THEN
raise_application_error(-20003, 'Password should contain at least one \
digit, one character and one punctuation');
END IF;
-- 3. Check for the punctuation
<<findpunct>>
ispunct:=FALSE;
FOR i IN 1..length(punctarray) LOOP
FOR j IN 1..m LOOP
IF substr(password,j,1) = substr(punctarray,i,1) THEN
ispunct:=TRUE;
GOTO endsearch;
END IF;
END LOOP;
END LOOP;
IF ispunct = FALSE THEN
raise_application_error(-20003, 'Password should contain at least one \
digit, one character and one punctuation');
END IF;
<<endsearch>>
-- Check if the password differs from the previous password by at least
-- 3 letters
IF old_password IS NOT NULL THEN
differ := length(old_password) - length(password);
IF abs(differ) < 3 THEN
IF length(password) < length(old_password) THEN
m := length(password);
ELSE
m := length(old_password);
END IF;
differ := abs(differ);
FOR i IN 1..m LOOP
IF substr(password,i,1) != substr(old_password,i,1) THEN
differ := differ + 1;
END IF;
END LOOP;
IF differ < 3 THEN
raise_application_error(-20004, 'Password should differ by at \
least 3 characters');
END IF;
END IF;
END IF;
-- Everything is fine; return TRUE ;
RETURN(TRUE);
END;
/
GRANT EXECUTE ON verify_function TO PUBLIC;
--CREATE PROFILE APP_PROFILE LIMIT
--COMPOSITE_LIMIT DEFAULT
--SESSIONS_PER_USER DEFAULT
--CPU_PER_SESSION DEFAULT
--CPU_PER_CALL DEFAULT
--LOGICAL_READS_PER_SESSION DEFAULT
--LOGICAL_READS_PER_CALL DEFAULT
--IDLE_TIME DEFAULT
--CONNECT_TIME DEFAULT
--PRIVATE_SGA DEFAULT
--FAILED_LOGIN_ATTEMPTS UNLIMITED
--PASSWORD_LIFE_TIME UNLIMITED
--PASSWORD_REUSE_TIME 1/24
--PASSWORD_REUSE_MAX DEFAULT
--PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION
--PASSWORD_LOCK_TIME DEFAULT
--PASSWORD_GRACE_TIME DEFAULT;
CREATE PROFILE APP_PROFILE LIMIT
COMPOSITE_LIMIT UNLIMITED
SESSIONS_PER_USER UNLIMITED
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
IDLE_TIME UNLIMITED
CONNECT_TIME UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_VERIFY_FUNCTION ORA12C_STRONG_VERIFY_FUNCTION
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 7;
CREATE PROFILE SUP_PROFILE LIMIT
COMPOSITE_LIMIT UNLIMITED
SESSIONS_PER_USER 15
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
IDLE_TIME UNLIMITED
CONNECT_TIME UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS 10
PASSWORD_LIFE_TIME 365
PASSWORD_REUSE_TIME 365
PASSWORD_REUSE_MAX 20
PASSWORD_VERIFY_FUNCTION ORA12C_STRONG_VERIFY_FUNCTION
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 5
CREATE TABLESPACE &TBS_TESTt_DATA LOGGING
DATAFILE '/dtaruatdb/data/dtaruat/pTESTtuat/TESTt_data_f01.dbf' SIZE 2G AUTOEXTEND ON NEXT 100M MAXSIZE 4G EXTENT MANAGEMENT LOC
AL;
CREATE TABLESPACE &TBS_TESTt_IDX LOGGING
DATAFILE '/dtaruatdb/data/dtaruat/pTESTtuat/TESTt_idx_f01.dbf' SIZE 1G AUTOEXTEND ON NEXT 100M MAXSIZE 4G EXTENT MANAGEMENT LOCA
L;
create user &v_TESTtdata_un identified by &v_TESTtdata_pw default tablespace &TBS_TESTt_DATA profile APP_PROFILE;
create user &v_TESTtusr_un identified by &v_TESTtusr_pw default tablespace &TBS_TESTt_DATA profile APP_PROFILE;
create user &v_TESTtquery_un identified by &v_TESTtquery_pw default tablespace &TBS_TESTt_DATA profile APP_PROFILE;
create user &v_TESTtpatch_un identified by &v_TESTtpatch_pw default tablespace &TBS_TESTt_DATA profile APP_PROFILE;
CREATE ROLE DATAROLE;
grant create session, create procedure, create table, create cluster, create sequence, create view, create synonym, create dat
abase link, alter session, create trigger to
DATAROLE;
grant DATAROLE to &v_TESTtdata_un;
CREATE ROLE APPSROLE;
grant create session, create synonym, alter session to APPSROLE;
grant APPSROLE to &v_TESTtusr_un;
grant APPSROLE to &v_TESTtquery_un;
grant APPSROLE to &v_TESTtpatch_un;
alter user &v_TESTtdata_un quota unlimited on &TBS_TESTt_DATA;
alter user &v_TESTtusr_un quota unlimited on &TBS_TESTt_DATA;
alter user &v_TESTtpatch_un quota unlimited on &TBS_TESTt_DATA;
alter user &v_TESTtdata_un quota unlimited on &TBS_TESTt_IDX;
alter user &v_TESTtusr_un quota unlimited on &TBS_TESTt_IDX;
alter user &v_TESTtpatch_un quota unlimited on &TBS_TESTt_IDX;
spool off
DB INIT IN WINDOWS (FOR 12C)的更多相关文章
- flask 运行 flask db init 报错,init-db 命令找不到
flask init-db 结果是 `Error: No such command “init-db”. 那是因为init-db 已经被 flask db init 给代替了 运行 flask db ...
- Flask db init 抛出KeyError: 'migrate’这个问题
问题 目录下执行flask db init 结果 抛出KeyError: 'migrate'这个问题 ## 原因 初始化Migrate对象时没有加db 解决: appfactory.py import ...
- windows deintall 12c client
1.unintall: close all oracle app C:\app\client\CICadmin\product\12.1.0\client_1\deinstall deinstall ...
- 基于windows环境的Flask网站搭建(mysql + conda + redis)
1下载mysql-installer-community-5.7.24.0.msi (https://dev.mysql.com/downloads/windows/installer/8.0.htm ...
- Leanote 二进制版详细安装教程 Windows
https://github.com/leanote/leanote/wiki 本教程适合 Windows 用户的二进制版安装. Windows 用户的源码版安装,参见这里. Mac, Linux 用 ...
- Windows 7 封装篇(一)【母盘定制】[手动制作]定制合适的系统母盘
Windows 7 封装篇(一)[母盘定制][手动制作]定制合适的系统母盘 http://www.win10u.com/article/html/10.html Windows 7 封装篇(一)[母盘 ...
- mongoDB windows安装
http://www.mongodb.org/ mongodb的官方文档. http://www.cnblogs.com/lipan/archive/2011/03/08/1966463.html ...
- JFinal 源码分析 [DB+ActiveRecord]
我记得以前有人跟我说,“面试的时候要看spring的源码,要看ioc.aop的源码"那为什么要看这些开源框架的源码呢,其实很多人都是"应急式"的去读,就像读一篇文章一下, ...
- DB 从zl.xml中导入数据库用户名及密码等!
package com.dy.java; import java.io.FileInputStream; import java.io.FileNotFoundException; import ja ...
随机推荐
- C#使用IHttpModule接口修改http输出的方法浅谈
一.但你每次请求浏览一个页面,比如Login.aspx的时候,都会执行配置文件中system.webserver内的model这个节点的东西(这个是属于遍历的逻辑执行,会将model这个节点的东西全部 ...
- Java中ArrayList的使用
//创建ArrayList ArrayList arr = new ArrayList(); //ArrayList添加数据 arr.add("123"); arr.add(&q ...
- about hibernate lazy load and solution
about hibernate lazy load is that used when loaded again.it can increase efficienty and sava memory. ...
- hdu_5873_Football Games(xjb搞)
题目链接:hdu_5873_Football Games 题意: 有n个队,每个队都会给其他队打一场,赢一场得2分,平局得一分,输了不得分,然后给你全部比赛结束后的得分,问你是否有假分 题解: 可以知 ...
- SSL单向认证和双向认证原理
注:本文为个人学习摘录,原文地址:http://edison0663.iteye.com/blog/996526 为了便于更好的认识和理解 SSL 协议,这里着重介绍 SSL 协议的握手协议.SSL ...
- 再谈Java方法传参那些事
把一个变量带进一个方法,该方法执行结束后,它的值有时会改变,有时不会改变.一开始会觉得--“好神奇呀”.当我们了解java内存分析的知识后,一切都是那么简单明了了--“哦,这么回事呀”.但是今天的上机 ...
- org.apache.commons.lang3.StringUtils类中isBlank和isEmpty方法的区别
相信很多java程序员在写代码的时候遇到判断某字符串是否为空的时候会用到StringUtils类中isBlank和isEmpty方法,这两个方法到底有什么区别呢?我们用一段代码来阐述这个区别吧: @T ...
- Linux的网卡由eth0变成了eth1,如何修复
Linux的网卡由eth0变成了eth1,如何修复 使用wmware安装了linux,安装成功后,使用的网卡是eth0,没有eth1.但是用过一段时间后,不知道为什么eth0无法使用,系统却自动生 ...
- linux下svn用法
linux下svn的一些常用命令: checkout代码到当前目录: svn co svn://192.168.22.23/project ./ swich 切换分支: 先查看当前工作副本:svn ...
- ckeditor 基础
<!DOCTYPE html> <!-- Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights rese ...