CentOS 静默安装Oracle( 三 )

Oracle客户端安装[root@moke-2 home]# yum install oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm[root@moke-2 lib]# pwd/usr/lib/oracle/11.2/client64/libmkdir -p /usr/lib/oracle/11.2/client64/lib/network/adminexport LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATHexport ORACLE_HOME=/usr/lib/oracle/11.2export TNS_ADMIN=/usr/lib/oracle/11.2/client64/lib/network/adminexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBKsqlplus scott/4900@qaz@192.168.1.16:1521/qhzncs as sysdbaexport PATH=/usr/lib/oracle/11.2/client64/bin:$PATH1 # .bash_profile23 # Get the aliases and functions4 if [ -f ~/.bashrc ]; then5         . ~/.bashrc6 fi78 # User specific environment and startup programs910 PATH=$PATH:$HOME/.local/bin:$HOME/bin1112 export PATH1314 # oracle database profile15 export ORACLE_HOSTNAME=moke-1.novalocal16 export ORACLE_BASE=/data/oracle17 export ORACLE_HOME=/data/oracle/product/11.2.0/db_118 export ORACLE_SID=orcl19 export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin20 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib2122 export LC_ALL=en_US23 export LANG=en_US24 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK数据库命令记录一下,备查:1.查看所有用户:select * from dba_users;select * from all_users;select * from user_users;2.查看用户或角色系统权限(直接赋值给用户或角色的系统权限):select * from dba_sys_privs;select * from user_sys_privs;3.查看角色(只能查看登陆用户拥有的角色)所包含的权限sql>select * from role_sys_privs;4.查看用户对象权限:select * from dba_tab_privs;select * from all_tab_privs;select * from user_tab_privs;5.查看所有角色:select * from dba_roles;6.查看用户或角色所拥有的角色:select * from dba_role_privs;select * from user_role_privs;7.查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)select * from V$PWFILE_USERS比如我要查看用户 wzsb的拥有的权限:SQL> select * from dba_sys_privs where grantee='WZSB';GRANTEE PRIVILEGE ADMIN_OPTION------------------------------ ---------------------------------------- ------------WZSB CREATE TRIGGER NOWZSB UNLIMITED TABLESPACE NO比如我要查看用户 wzsb的拥有的角色:SQL> select * from dba_role_privs where grantee='WZSB';GRANTEE GRANTED_ROLE ADMIN_OPTION DEFAULT_ROLE------------------------------ ------------------------------ ------------ ------------WZSB DBA NO YES查看一个用户所有的权限及角色select privilege from dba_sys_privs where grantee='WZSB'unionselect privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='WZSB' );sqlplus64 scott/tiger@192.168.1.16:1521/QHZNCSsqlplus PARA_USER/un1ware$WPM@192.168.1.16:1521/QHZNCSsys/manager as sysdba;sqlplus64  / as sysdba@192.168.1.16:1521/QHZNCSalter system set sec_case_sensitive_logon=false;<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />sqlplus64 sys/tiger@192.168.1.16:1522/QHZNCSgrant connect,resource to PARA_USER;select username from all_users;sqlplus scott/tigersqlplus PARA_USER/un1ware$WPM@192.168.1.16:1521/QHZNCSconn PARA_USER/un1ware$WPM//激活scott用户alter user PARA_USER account unlock;commit;alter user PARA_USER identified by un1ware$WPM;sqlplus PARA_USER/Orcl123456@192.168.1.16:1521/QHZNCSalter system set sec_case_sensitive_logon=false;grant all on *.* to PARA_USER@'%' identified by 'un1ware$WPM';grant all on *.* to PARA_USER@'%' identified by 'un1ware$WPM';grant connect, resource to PARA_USER;GRANT CONNECT TO PARA_USER;ALTER USER PARA_USER DEFAULT ROLE NONE;SQLLDR命令配置// 从Oracle数据库服务端拷贝,文件来源于oracle完全安装版本里面的件 。[root@moke-1 rdbms]# pwd/data1/db_ora/oracle/product/11.2.0/db_1/rdbms[root@moke-1 mesg]# pwd/data1/db_ora/oracle/product/11.2.0/db_1/network/mesg#准备文件(数据库服务器操作)scp -r rdbms root@192.168.1.15:/usr/lib/oracle/11.2/client64/lib/networkscp -r mesg root@192.168.1.15:/usr/lib/oracle/11.2/client64/lib/networkscp sqlldr root@192.168.1.15:/usr/lib/oracle/11.2/client64/lib/network#文件导入(客户端服务器操作)将rdbms文件导入到/usr/lib/oracle/11.2/client64mesg文件夹导入到/usr/lib/oracle/11.2/client64/networksqlldr 文件导入到/usr/lib/oracle/11.2/client64/binscp sqlldr /usr/lib/oracle/11.2/client64/binscp -r rdbms /usr/lib/oracle/11.2/client64SQLLDR测试命令sqlldr

CentOS 静默安装Oracle

文章插图
 
错误处理:
[FATAL] [INS-32037] The operating system group specified for central inventory (oraInventory) ownership is invalid.
处理方法:root用户
vim /etc/oraInst.loc
inventory_loc=/mnt/sdb1/oraInventory
inst_group=oinstall
  • 报错“[INS-08109]
报错“[INS-08109] Unexpected error occurred while validating inputs at state 'inventoryPage‘”


推荐阅读