oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失

时间:2022-04-17 21:33:59

oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失

【转载】http://www.cnblogs.com/endv/p/5587136.html

1 conn / as sysdba
2 alter user system identified by Abcd1234;
 

manual script first -->manual_script_before_install.sql

oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失
 1 -- must connect as sysdba to execute the following script
 2 -- this manual script is to minimize the configuration change on the Oracle database server
 3 
 4 -- we suggest you use the default SYSTEM user during the installation
 5 -- if you choose a user other than SYSTEM during installation, you need change SYSTEM in the script to that username 
 6 
 7 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
 8 GRANT EXECUTE ON sys.DBMS_REPUTIL TO SYSTEM with grant option 
 9 /
10 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
11 GRANT SELECT ON sys.DBA_VIEWS TO SYSTEM with grant option
12 /
13 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
14 GRANT EXECUTE ON sys.DBMS_LOB TO SYSTEM with grant option
15 /
16 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
17 GRANT EXECUTE ON sys.DBMS_SQL TO SYSTEM with grant option
18 /
19 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
20 GRANT EXECUTE ON sys.DBMS_JOB TO SYSTEM with grant option
21 /
22 --METADATA TYPE:GRANT OBJECT:DBMS_JMS_PLSQL PRIVILEGE:EXECUTE GRANTEE:SYSTEM
23 GRANT EXECUTE ON sys.DBMS_RANDOM TO SYSTEM with grant option
24 /
25 --METADATA TYPE:GRANT OBJECT:V_$TRANSACTION PRIVILEGE:EXECUTE GRANTEE:SYSTEM
26 GRANT SELECT ON sys.V_$TRANSACTION TO SYSTEM with grant option 
27 /
28 --METADATA TYPE:GRANT OBJECT:GV_$TRANSACTION PRIVILEGE:EXECUTE GRANTEE:SYSTEM
29 GRANT SELECT ON sys.gv_$TRANSACTION TO SYSTEM with grant option 
30 /
oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失

 

oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失
1 admuser
2 privuser
3 pubuser
4 bgjobuser
5 pxrptuser
6 
7 Abcd1234
oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失

更新 Oracle 主目录用户的口令

oracle 12C SYS,SYSTEM用户的密码都忘记或是丢失
 1 @echo off
 2 
 3 @setlocal
 4 
 5 @set OH=C:\app\b\product\12.1.0\dbhome_1
 6 @set JRE_LOCATION=jdk\jre
 7 @set JLIB_LOCATION=jlib
 8 
 9 @set JRE_DIR=%OH%\%JRE_LOCATION%
10 @set JLIB_DIR=%OH%\%JLIB_LOCATION%
11 
12 @set JRE=%JRE_DIR%\bin\java
13 
14 @set JNDI_JAR=%JLIB_DIR%\jndi.jar
15 @set SRVM_JAR=%JLIB_DIR%\srvm.jar
16 @set SRVMHAS_JAR=%JLIB_DIR%\srvmhas.jar
17 @set HOMEUSERCTL_JAR=%JLIB_DIR%\homeuserctl.jar
18 
19 @set CLASSPATH=%HOMEUSERCTL_JAR%;%JNDI_JAR%;%SRVM_JAR%;%SRVMHAS_JAR%
20 
21 @set PWD=%CD%
22 cd %OH%\bin
23 @set PATH=%OH%\bin;%PATH%
24 
25 if (%OHUC_TRACE%)==() (
26    @set OHUC_TRACE=8
27 )
28 @set OHUC_PROPERTY_DEFS=-DOHUC_TRACE=%OHUC_TRACE%
29 
30 %JRE% -DORACLE_HOME=%OH% -classpath "%CLASSPATH%" %OHUC_PROPERTY_DEFS% oracle.homeuserctl.orahomeuserctl %*
31 @set ORAHOMEUSERCTL_EXIT_STATUS=%ERRORLEVEL%
32 cd %PWD%
33 exit /B %ORAHOMEUSERCTL_EXIT_STATUS%