Oracle高级操作:启停服务,开启PDB,创建表空间、用户、导入导出用户数据等
sqlplus system/orcl_123456@orcl //sqlplus连接 select name from v$database; //查询当前数据库名 select instance_name from v$instance; // 查询当前数据库实例名 //创建临时表空间 CREATE TEMPORARY TABLESPACE OX_TEMP TEMPFILE '/opt/oracle/oradata/orcl/OX_TEMP.DBF' SIZE 64M AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL; //创建数据表空间 CREATE TABLESPACE OX_DATA LOGGING DATAFILE '/opt/oracle/oradata/orcl/OX_DATA.DBF' SIZE 64M AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL; //创建用户(方案) 并指定表空间 CREATE USER OX IDENTIFIED BY ox_123456 ACCOUNT UNLOCK DEFAULT TABLESPACE OX_DATA TEMPORARY TABLESPACE OX_TEMP;