Create Oracle SID--海外华人
   >  Create Oracle SID< 返回  


Create Oracle SID
 
[2015-05-20]
 
Oracle 12.1 Installation

Create New SID
-- prepare xming and putty
Start xming, check right corner icon is shown
Save the server you want to connect to in Putty in saved sessions
Load the server you want to connect in putty
In the left category pane, click on connections then SSH and then X11
Check “Enable X11 forwarding” box
Enter “localhost:0” in “X display location box”
In the left category pane go to top and select sessions
Save Session
-- linux testing xming
(do not login to oracle yet to setup display)
Set following environment variable on the server (export DISPLAY=localhost:10.0)
Type (xauth list)
Type xclock on the server and see if it appears

Run Oracle Database Configuration Assistant (DBCA) to create new sid
Sudo as Oracle (sudo su - oracle)
xauth add
xclock to test oracle acct ok to display


cd $ORACLE_HOME/bin
./dbca
Select create database select general purpose
Enter global db name dbname.dev.it.company.com (sid=dev)
Deselect configure enterprise manage (can do it late)
Use same password for sys and system
select use common location for all db files /data/oracle
Change Fast Recovery Area size to 2000 MB (for dev)
Set memory size 25%
Change DB character set to AL32UTF8
Create database


Verify DB Creation and Create Tablespaces and Users
Verify process ps -ef | grep pmon
Set Oracle SID export ORACLE_SID=dev
Run sqlplus sys/ as sysdba
Run below scripts to create tablespace and user
Verify Tablespaces and Users created


-- tablespace and users
CREATE TABLESPACE TLS_DEV_DATA
DATAFILE '/data/oracle/dev1/tls_dev_data.dbf'
SIZE 500M AUTOEXTEND ON;


CREATE USER user1
IDENTIFIED BY ...
DEFAULT TABLESPACE TLS_DEV_DATA;


(remember grant privs to user1)


-- create directory
CREATE OR REPLACE DIRECTORY MY_SOFTWARE_DIR AS '/data/appName/softwareName/';


-- setup ACL
DECLARE
v_aclCount NUMBER;
BEGIN
SELECT count(*) into v_aclCount FROM dba_network_acls;
IF v_aclCount = 0 THEN
BEGIN
-- Step 1 - Create an ACL (Access Control List) and grant USER1 the connect privilege.
dbms_network_acl_admin.create_acl (
acl => 'user1_http_access.xml',
description => 'HTTP Access',
principal => 'USER1', -- the user name trying to access the network resource
is_grant => TRUE,
privilege => 'connect',
start_date => null,
end_date => null);
--Step 2 - Add privilege to Access Control List
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'user1_http_access.xml',
principal => 'USER1',
is_grant => true,
privilege => 'connect');
--3 Step 3 - Assign the acl to a specific address
dbms_network_acl_admin.assign_acl (
acl => 'user1_http_access.xml',
host => '*.domain.com' /* can be computer name or IP , wildcards. example - '*.us.oracle.com' */
);
execute immediate 'grant execute on utl_http to USER1';
commit;
--SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.DOMAINS('www.domain.com'));
END;
END IF;
END;


















[说明] Create Oracle SID, tablespaces and users

声明: 海外华人网所有刊载文章仅供参考,不构成投资或行动建议。欢迎免费引用,引用时需注明文章来源:海外华人网(haiwaihuaren.com)