ORA-01017:用户名/口令无效,登录被拒绝(ORA-01017: invalid username/password; logon denied)

日萌社

人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)


 

sqlplus
		sqlplus /nolog
		conn /as sysdba
		报错:
			ORA-01017:用户名/口令无效,登录被拒绝
			ORA-01017: invalid username/password; logon denied
		解决:
			1.把当前root用户添加到下面各种组中:
				usermod -a -G oinstall root
				usermod -a -G dba root
				usermod -a -G oper root
				usermod -a -G backupdba root
				usermod -a -G dgdba root
				usermod -a -G kmdba root
				usermod -a -G racdba root

			2.查看root的id:id root 
				打印出信息:uid=0(root) gid=0(root) 组=0(root),54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
		 
			  可用于把当前用户从xx组中移除
				比如把当前root用户从dba组中移除:gpasswd -d root dba
 
			3.使用oracle用户:su - oracle
				1.sqlplus sys/sys as sysdba
				2.创建用户的时候用户名以c##或者C##开头即可。
					create user username
					identified by username
					default tablespace tablespace_name;
					比如:CREATE USER c##rootuser IDENTIFIED BY 123456;
		 
				3.授予权限
					grant connect,resource,create any table,drop any table,create sequence,
					      select any table, create any index, drop any index,
					      alter any trigger, create any trigger, drop any trigger,
					      alter any type, create any type, drop any type,
					      create any view, drop any view, create any directory,
					      create procedure, query rewrite, create session to username;

				4.授予DBA权限
					grant select on sys.v_$process to username;
					grant select on sys.v_$parameter to username;
					grant execute on dbms_lock to username;
					grant select on sys.v_$lock to username;
					grant select on sys.v_$session to username;
					grant select on sys.v_$mystat to username;
					grant select on sys.v_$session_wait to username;
					grant select on dba_kgllock to username;
					grant select on sys.v_$sqltext to username;
					grant select on sys.slog$ to username;
					grant alter session to username;
					grant select on dba_undo_extents to username;
					grant select on dba_tablespaces to username;
					grant select on dba_free_space to username;
					grant select on dba_data_files to username;
		 
				5.sqlplus c##rootuser/123456
					#conn c##rootuser/123456;
					show user;
					#查看当前登录的用户的表
					select table_name from user_tables;
 
		---------------------------------------------------
 
		#超级管理员:sys/change_on_install;
		#普通管理员:system/manager;
		#普通用户:scott/tiger;
		sqlplus sys/change_on_install as sysdba
		sqlplus system/manager as sysdba
		sqlplus scott/tiger as sysdba
		
		sqlplus
			输入用户名:sys
			输入密码:change_on_install as sysdba
添加测试数据
		create table student(
		       sno   varchar2(3) not null,
		       sname varchar2(9) not null,
		       ssex  varchar2(3) not null,
		       sbirthday date,
		       sclass varchar2(5),
		       constraint pk_student primary key(sno)
		);
	
		insert into student(sno,sname,ssex,sbirthday,sclass) values(108,'曾华','男',to_date('1977-09-01','yyyy-mm-dd'),95033);
		insert into student(sno,sname,ssex,sbirthday,sclass) values(105,'匡明','男',to_date('1975-10-02','yyyy-mm-dd'),95031);
		insert into student(sno,sname,ssex,sbirthday,sclass) values(107,'王丽','女',to_date('1976-01-23','yyyy-mm-dd'),95033);
		insert into student(sno,sname,ssex,sbirthday,sclass) values(101,'李军','男',to_date('1976-02-20','yyyy-mm-dd'),95033);
		insert into student(sno,sname,ssex,sbirthday,sclass) values(109,'王芳','女',to_date('1975-02-10','yyyy-mm-dd'),95031);
		insert into student(sno,sname,ssex,sbirthday,sclass) values(103,'陆君','男',to_date('1974-06-03','yyyy-mm-dd'),95031);

		select * from student;

 

你可能感兴趣的:(数据仓库)