oracle数据库相关

1.新安装的oracle数据库用户设置

1.1使用默认系统用户登陆

sqlplus sys/oracle as sysdba

1.2创建新用户并给予dba权限

create user 【username】identified by 【passwd】
grant dba to admin;

1.3查看数据库名

select name,dbid from v$database;

1.4查看表空间和文件路径

select file_name,tablespace_name from dba_data_files;

           FILE_NAME                              TABLESPACE_NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/DACP/users01.dbf               USERS
/opt/app/oracle/oradata/DACP/undotbs01.dbf            UNDOTBS1
/opt/app/oracle/oradata/DACP/sysaux01.dbf              SYSAUX
/opt/app/oracle/oradata/DACP/system01.dbf              SYSTEM

1.5创建表空间

create tablespace PAAS_DB datafile '/opt/app/oracle/oradata/DACP/paas_db01.dbf' size 10g;

1.6创建用户并指定表空间

create user [username] identified by [passwd] default tablespace [tablespaceName];

你可能感兴趣的:(oracle数据库相关)