legacy-wiki
Lab oracle 11g
Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.
http://www.oracle-base.com/articles/11g/OracleDB11gR2InstallationOnFedora12.php
http://blog.craigpoma.com/2010/07/installing-oracle-11gr2-on-fedora-13.html
#/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk
#Search for the line
$(MK_EMAGENT_NMECTL)
#Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
Database Creation
#Create a listener
netca
#Start database control assistant
dbca
Starting Instance
# Start the instance
sqlplus /nolog
CONNECT sys/redhat as SYSDBA
STARTUP
exit
#Start enterprise manager
emctl start dbconsole
- RemoteOperationException: ERROR: NMO not setuid-root (Unix-only)
- [root@db ~]# bash /u01/app/oracle/product/11.1.0/db_1/root.sh
Shutdown Instance
[oracle@db ~]$ echo $ORACLE_SID
orcl
[oracle@db ~]$ sqlplus /nolog
SQL CONNECT sys/redhat as SYSDBA
SQL shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Checking SGA Size
[oracle@db ~]$ export ORACLE_SID=deadmau5
[oracle@db ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 1 09:06:58 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL CONNECT sys/redhat as SYSDBA
Connected.
SQL SHOW SGA;
Total System Global Area 534462464 bytes
Fixed Size 2215064 bytes
Variable Size 348128104 bytes
Database Buffers 176160768 bytes
Redo Buffers 7958528 bytes
Creating rhnsat user
- http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/5.3/html/Installation_Guide/s1-requirements-database.html
- You can’t really grant DDL on one table because if the table does not exist yet, you need to have general CREATE TABLE.
- You can grant DML (grant select on table to user, for example) on per-table basis.
- [DDL can not be granted] on [a] tablespace, it’s per schema. grant create table to user.
- You always have DML access rights to objects that you own (objects in the same schema as the user name).
SQL create user rhnsat identified by rhnsat;
User created.
SQL grant connect to rhnsat;
Grant succeeded.
SQL GRANT UNLIMITED TABLESPACE TO rhnsat;
Grant succeeded.
SQL grant create any table to rhnsat;
Grant succeeded.
SQL grant create table to rhnsat;
Grant succeeded.
SQL grant alter session to rhnsat;
Grant succeeded.
SQL grant create sequence to rhnsat;
Grant succeeded.
SQL grant create synonym to rhnsat;
Grant succeeded.
SQL grant create view to rhnsat;
Grant succeeded.
SQL grant create procedure to rhnsat;
Grant succeeded.
SQL grant create trigger to rhnsat;
Grant succeeded.
SQL grant create type to rhnsat;
Grant succeeded.
SQL grant create session to rhnsat;
Grant succeeded.
Showing Tablespaces
SQL select TABLESPACE_NAME from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
SQL select TABLESPACE_NAME from user_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
RHNSAT exernal 11gR2 setup
Invalid DB Version
** Database: Setting up database connection.
DB User? rhnsat
DB Password?
DB SID? deadmau5
DB hostname? db.dj.edm
DB port [1521]?
DB protocol [TCP]?
** Database: Testing database connection.
Invalid db version: (11.2.0.1.0, 11.2.0.0.0)
[root@deadmau5 ~]# diff /usr/lib/perl5/vendor_perl/5.8.8/Spacewalk/Setup.pm /usr/lib/perl5/vendor_perl/5.8.8/Spacewalk/Setup.pm.orig
903c903
my @allowed_db_versions = qw/1120 1110 1020 920/;
---
my @allowed_db_versions = qw/1110 1020 920/;
Could not populate database
** Database: Testing database connection.
** Database: Populating database.
*** Progress: ###################################################
Could not populate database.
# /var/log/rhn/populate_db.log
SQL_FILE
----------------------------------------
rhnsat/tables/rhn_schedule_days_data.sql
insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
*
ERROR at line 1:
ORA-02291: integrity constraint (RHNSAT.RHN_SCHDY_SCHED_SCHEDULE_ID_FK)
violated - parent key not found
# sqlplus /nolog
# CONNECT rhnsat/rhnsat
SQL select RECID from rhn_schedules;
RECID
----------
2
SQL update rhn_schedules set RECID='1';
1 row updated.
- rhn_schedule_days_data.sql is not a real file, it’s contents are in /etc/sysconfig/rhn/universe.deploy.sql
[root@deadmau5 ~]# cat 59* | tail -n1
open(/etc/sysconfig/rhn/universe.deploy.sql, O_RDONLY) = 5
35787 -- SQL relevant contents from file rhnsat/tables/rhn_schedules_data.sql
35788 insert into rhn_schedules(recid,schedule_type_id,description,last_update_user,
35789 last_update_date,customer_id)
35790 values ( rhn_schedules_recid_seq.nextval,1,'24x7','system',sysdate,NULL);
35791 commit;
35793 select 'rhnsat/tables/rhn_schedule_days_data.sql' sql_file from dual;
35794 -- SQL relevant contents from file rhnsat/tables/rhn_schedule_days_data.sql
35795 insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
35796 end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
35797 values ( rhn_schedule_days_recid_seq.nextval,1,0,
35798 to_date('08-SEP-2000 12:00:02 AM','DD-MON-YYYY HH:MI:SS AM'),
35799 to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
35800 null,null,null,null,null,null,'system',null);
35801 insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
35802 end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
35803 values ( rhn_schedule_days_recid_seq.nextval,1,1,
35804 to_date('08-SEP-2000 12:00:09 AM','DD-MON-YYYY HH:MI:SS AM'),
35805 to_date('09-SEP-2000 12:00:00 AM','DD-MON-YYYY HH:MI:SS AM'),
35806 null,null,null,null,null,null,'system',null);
35807 insert into rhn_schedule_days(recid,schedule_id,ord,start_1,end_1,start_2,
35808 end_2,start_3,end_3,start_4,end_4,last_update_user,last_update_date)
35809 values ( rhn_schedule_days_recid_seq.nextval,1,2,
Unable to clear database
** Database: Testing database connection.
** Database: Populating database.
The Database has schema. Would you like to clear the database [Y]? y
** Database: Clearing database.
** Database: Shutting down services that may be using DB: [tomcat5, taskomatic, httpd, jabberd, osa-dispatcher, tsdb_local_queue].
** Database: Services stopped. Clearing DB.
DBD::Oracle::st execute failed: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired (DBD ERROR: error possibly near * indicator at char 11 in 'drop TABLE *RHN_CONTACT_METHODS cascade constraints') [for Statement drop TABLE RHN_CONTACT_METHODS cascade constraints] at /usr/lib/perl5/vendor_perl/5.8.8/Spacewalk/Setup.pm line 444, STDIN line 7.
Issuing rollback() for database handle being DESTROY'd without explicit disconnect(), STDIN line 7.
- Drop the user
[oracle@db ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 1 13:18:08 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL CONNECT sys/redhat as SYSDBA;
Connected.
SQL drop user rhnsat cascade;
User dropped.
- Readd user
Problem activating
** Loading RHN Satellite Certificate.
** Verifying certificate locally.
** Activating RHN Satellite.
There was a problem activating the satellite: Local activation failure.
ERROR: RHN Entitlement Certificate failed to validate:
Exception reported from deadmau5.dj.edm
Time: Wed Sep 1 11:29:08 2010
Exception type server.rhnSQL.sql_base.SQLError
Exception Handler Information
Traceback (most recent call last):
File /usr/share/rhn/satellite_tools/rhn_satellite_activate.py, line 203, in activateSatellite_local
satCerts.storeRhnCert(cert, check_generation=1, check_version=not(options.ignore_version_mismatch))
File /usr/share/rhn/satellite_tools/satCerts.py, line 236, in storeRhnCert
create_first_org(owner=sc.owner)
File /usr/share/rhn/satellite_tools/satCerts.py, line 102, in create_first_org
p(owner, pword)
File /usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py, line 270, in __call__
raise apply(sql_base.SQLError, [e[0].code, str(e[0])])
SQLError: (6550, ORA-06550: line 1, column 7:\nPLS-00201: identifier 'CREATE_FIRST_ORG' must be declared\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored\n)
spacewalk
- netca
- /u01/app/oracle/product/11.1.0/db_1/bin/lsnrctl start LISTENER2
- dbca