1.使用DBCA创建或删除数据库
2.启动PlSqlDev(PL/SQL
Developer)程序,用system帐号登陆到第1步创建的数据库,并创建回滚表空间,用户空间,临时表空间,用户及权限等.
3.若启动PlSqlDev后无法连接到DBCA创建的数据库,请使用Net Manager程序配置一下IP及端口.
4.用第2步中创建的用户重新登陆PlSqlDev后创建表,即可.
5.Oracle的C#连接串是:Data
Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.17.208)
(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=数据库名称)));Persist Security
Info=True;User Id=用户名; Password=密码
6.在第2步中创建回滚表空间,用户空间,临时表空间,用户及权限等用到的脚本如下:
--创建回滚表空间
create tablespace NppsisRbs
datafile 'D:\Oracle11g\OracleData\NPPSIS\NppsisRbs.dbf' size 256M
reuse
autoextend on next 512K
minimum extent 1024K
default storage (initial 1024K next 512K minextents 8 maxextents
4096);
--创建用户表空间
create tablespace NppsisUsers
datafile
'D:\Oracle11g\OracleData\NPPSIS\NppsisUsers01.dbf' size 1024M
reuse
autoextend on next 128M
minimum extent 512M
default storage (initial 512M next 128M
minextents 8 maxextents 4096);
--创建临时表空间
create temporary tablespace Nppsis_temp
tempfile 'D:\Oracle11g\OracleData\NPPSIS\Nppsis_temp01.dbf'
size 8m
autoextend on
next 8m maxsize 64m
extent management local;
--创建工具表空间
create tablespace NppsisTools
datafile 'D:\Oracle11g\OracleData\NPPSIS\NppsisTools01.dbf' size
32M reuse
autoextend on next 320K
minimum extent 32K
default storage (initial 32K next 32K minextents 1
maxextents 4096 pctincrease 0);
--创建用户并指定相应的表空间
create user Nppsis
identified by tsnppsisadmin
default tablespace NppsisUsers
temporary tablespace Nppsis_temp
profile DEFAULT
password expire;
-- Grant/Revoke role privileges
grant dba to NPPSIS with admin option;
-- Grant/Revoke system privileges
grant alter any procedure to NPPSIS with admin option;
grant alter any sequence to NPPSIS with admin option;
grant alter any table to NPPSIS with admin option;
grant alter any trigger to NPPSIS with admin option;
grant create any procedure to NPPSIS with admin option;
grant create any sequence to NPPSIS with admin option;
grant create any table to NPPSIS with admin option;
grant create any trigger to NPPSIS with admin option;
grant create any view to NPPSIS with admin option;
grant unlimited tablespace to NPPSIS with admin option;