VMware12-Centos7-Oracle12C(三)--完结,接一、二
[[email protected] ~]$xhost +
access controldisabled, clients can connect from any host
配置监听端口:
[[email protected] ~]$ netca
$dbca
这张图是后补的,总之出现这样的界面就是ok啦
Oracle数据操作
[[email protected]~]#xhost +
问题:bash:xhost: 未找到命令
解决:http://blog.****.net/****ones/article/details/51513163
vncserver:commandnot found----yum install tigervnc-server?-y
1、su – oracle 不是必需,适合于没有DBA密码时使用,可以不用密码来进入sqlplus界面。
2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus ;
3、SQL>connect /as sysdba ;(as sysoper)或connectinternal/oracle AS SYSDBA ;(scott/tiger)conn sys/change_on_install as sysdba;
Connected to an idle instance.
4、SQL>startup; 启动数据库实例
SQL>startup ////有错
ORA-00845:MEMORY_TARGET not supported on this system
解决:
[[email protected] oracle]# vim /etc/fstab
添加:tmpfs /dev/shm tmpfs defaults,size=6G 0 0
[[email protected] oracle]# mount -o remount/dev/shm
[[email protected] oracle]# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.0G 945M 5.1G 16% /dev/shm ////*************
重试
SQL>startup
ORA-01078:failure in processing system parameters
LRM-00109:could not open parameter file'/oracl/app/oracle/product/12.1.0/db_1/dbs/initheyajing2.ora'
解决:
[[email protected] oracle]# find /oracl/ -nameinit.ora*
/oracl/app/oracle/product/12.1.0/db_1/srvm/admin/init.ora
/oracl/app/oracle/product/12.1.0/db_1/dbs/init.ora
[[email protected] dbs]# mv/oracl/app/oracle/product/12.1.0/db_1/srvm/admin/init.ora/oracl/app/oracle/product/12.1.0/db_1/dbs/initheyajing2.ora
5、 查看当前的所有数据库:select * from v$database;
select name from v$database;
desc v$database; 查看数据库结构字段
7、怎样查看哪些用户拥有SYSDBA、SYSOPER权限:
SQL>select * from V_$PWFILE_USERS;
Show user;查看当前数据库连接用户
8、进入test数据库:database test;
9、查看所有的数据库实例:select* from v$instance;
如:ora9i
10、查看当前库的所有数据表:
SQL> select TABLE_NAME from all_tables;
select * from all_tables;
SQL> select table_name from all_tableswhere table_name like ‘u’;
TABLE_NAME———————————————default_auditing_options
11、查看表结构:desc all_tables;
12、显示CQI.T_BBS_XUSER的所有字段结构:
desc CQI.T_BBS_XUSER;
13、获得CQI.T_BBS_XUSER表中的记录:
select * from CQI.T_BBS_XUSER;
14、增加数据库用户:(test11/test)
create user test11 identified by testdefault tablespace users Temporary TABLESPACE Temp;
15、用户授权:
grant connect,resource,dba to test11;
grant sysdba to test11;
commit;
16、更改数据库用户的密码:(将sys与system的密码改为test.)
alter user sys indentified by test;
alter user system indentified by test;