Pages

Showing posts with label 12c. Show all posts
Showing posts with label 12c. Show all posts

Saturday, September 7, 2013

12c Cannot create service/ sid using ORADIM (DIM-00019: create service error O/S-Error: (OS 5) Access is denied.)

Creating new sid in windows using ORADIM throws the below error. After spending some research found the simple solution. From 12.1 oracle introduced owner for oracle home. See the below description from Doc. When calling oradim it will prompt for that OH owner name.

C:\Users\mmeerha>oradim -new -sid testdb12c
Enter password for Oracle service user:
DIM-00019: create service error
O/S-Error: (OS 5) Access is denied.

Starting with Oracle Database 12c Release 1 (12.1), Oracle Database supports the use of Oracle home user, specified at the time of installation. Oracle home user is the owner of Oracle services that run from Oracle home and cannot be changed post installation. On a system, different Oracle homes can share the same Oracle home user or use different Oracle home user names.

Oracle home user can be a Windows built-in account or a standard Windows user account (not an Administrator account). This account is used for running the Windows services for the Oracle home. For a database server installation, Oracle recommends that you use a standard Windows user account (instead of a Windows built-in account) as the Oracle home user for enhanced security.

For Oracle RAC Database, the Oracle home user must be a Windows domain user account and must be an existing Windows account.

Even when providing the correct password it throws the same error.

Then I realised to run cmd prompt as administrator.

Also Oracle Doc mentioned it
  • Windows Vista, Windows Server 2008, and Windows 7 require Administrator privileges to run ORADIM.



So what if I forget Oracle home user password, the sid will be created but it will not be started. See the below snaps



So how can I find who owns the Oracle home, and how to modify the password of it.

From windows registry HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraDB12Home1


As other windows users, reset password on it and run as administrator to create Sid.

Note :
In 11g We will get different error in oradim when not run cmd prompt as administrator.



Happy reading :), post your comments if anything to improve.

Reference:

Sunday, August 11, 2013

Why CBD_DATA_FILES and V$DATAFILE differs?

Though it is well documented in the Oracle 12c documentation, just to demo I wrote this post.

http://docs.oracle.com/cd/E16655_01/server.121/e17615/refrn009.htm#REFRN009

CDB_* Views

For every DBA_* view, a CDB_* view is defined. In the root of a multitenant container database (CDB), CDB_* views can be used to obtain information about tables, tablespaces, users, privileges, parameters, and so on contained in the root and in pluggable databases (PDBs).
CDB_* views are container data objects. When a user connected to the root queries a CDB_* view, the query results will depend on the CONTAINER_DATA attribute for users for the view. The CONTAINER_DATA clause of the SQL ALTER USER statement is used to set and modify users' CONTAINER_DATA attribute.
The CDB_* views are owned by SYS, regardless of who owns the underlying DBA_* view.
By default, a user connected to the root will only see data pertaining to the root.

In a PDB, the CDB_* views only show objects visible through a corresponding DBA_* view.
In addition to all the columns found in a given DBA_* view, the corresponding CDB_* view also contains the CON_ID column, which identifies a container whose data a given CDB_* row represents. In a non-CDB, the value of a CON_ID column will be 0.
Data returned by these views depends on whether a given PDB is open at the time the query is issued.

In particular, in an Oracle RAC environment, data returned by these view may vary according to the instance to which a session is connected.

List of action performed

  1. Logged into CDB
  2. Queried  both cbd_data_files and v$datafile , CDB_ view has only 7 rows
  3. Queried V$PDBS to know status off PDBs
  4. One PDB is in Mount state
  5. Opened that PDB in read write mode.
  6. Then we could see all the files.

SQL> set time on echo on
22:27:54 SQL> select name,cdb from v$database;

NAME      CDB                                                                  
--------- ---                                                                  
ORCL12C   YES                                                                  

22:28:14 SQL> sho con_name

CON_NAME                                                                       
------------------------------                                                 
CDB$ROOT                                                                       
22:28:20 SQL> set pages 20
22:28:54 SQL> select name from v$datafile;

NAME                                                                           
--------------------------------------------------------------------------------
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSTEM01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSTEM01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSAUX01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSAUX01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\UNDOTBS01.DBF                                   
D:\APP\TWELVEC\ORADATA\ORCL12C\USERS01.DBF                                     
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SYSTEM01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SYSAUX01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SAMPLE_SCHEMA_USERS01.DBF               
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\EXAMPLE01.DBF                           

10 rows selected.

22:29:03 SQL> select file_name from cdb_data_files;

FILE_NAME                                                                      
--------------------------------------------------------------------------------
D:\APP\TWELVEC\ORADATA\ORCL12C\USERS01.DBF                                     
D:\APP\TWELVEC\ORADATA\ORCL12C\UNDOTBS01.DBF                                   
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSAUX01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSTEM01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSTEM01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSAUX01.DBF                            

6 rows selected.

22:29:24 SQL> select con_id,name,open_mode from v$pdbs order by 1;

    CON_ID NAME                           OPEN_MODE                            
---------- ------------------------------ ----------                           
         2 PDB$SEED                       READ ONLY                            
         3 PDBORCL                        MOUNTED                              


22:31:08 SQL> alter pluggable database PDBORCL open read write;

Pluggable database altered.

22:31:25 SQL> select con_id,name,open_mode from v$pdbs order by 1;

    CON_ID NAME                           OPEN_MODE                            
---------- ------------------------------ ----------                           
         2 PDB$SEED                       READ ONLY                            
         3 PDBORCL                        READ WRITE                           

22:31:32 SQL> select file_name from cdb_data_files;

FILE_NAME                                                                      
--------------------------------------------------------------------------------
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSTEM01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBSEED\SYSAUX01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\USERS01.DBF                                     
D:\APP\TWELVEC\ORADATA\ORCL12C\UNDOTBS01.DBF                                   
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSAUX01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\SYSTEM01.DBF                                    
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SYSTEM01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SYSAUX01.DBF                            
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\SAMPLE_SCHEMA_USERS01.DBF               
D:\APP\TWELVEC\ORADATA\ORCL12C\PDBORCL\EXAMPLE01.DBF                           

10 rows selected.

22:31:45 SQL> spool off

Please provide your valuable suggestion/ corrections to improve
Thanks , Happy reading...

Sunday, August 4, 2013

Oracle 12c Database install on Windows 7

Today I have installed 12c database on my laptop to test one issue, just thought to share the steps. Will post all my experiments in this blog soon. Happy learning. :)

1. Configure Security updates.

2. Mention whether software updates needed
3. Install options, select 

4. Install class Desktop or server class

5. Grid installation option
6. Install type
7. Specify Oracle Home user
8. Select home path, provide OS admin user password, whether container/ pluggable DB need to be created
9 & 10 Pre requisite check and Summary Screen ( Forgot to take Snap) sorry

11. Installing database, will invoke DBCA and will create CDB and PDB
12. Finish
Test login


Windows x64 Hardware Requirements
RequirementValue
System Architecture
Processor: AMD64 and Intel EM64T
Physical memory (RAM)
2 GB minimum
Virtual memory (swap)
  • If physical memory is between 2 GB and 16 GB, then set virtual memory to 1 times the size of the RAM
  • If physical memory is more than 16 GB, then set virtual memory to 16 GB
Disk space
  • Typical Install Type total: 10 GB
  • Advanced Install Types total: 10 GB
See Table 2-2 for details.
Video adapter
256 colors
Screen Resolution
1024 X 768 minimum


Reference:

Oracle® Database Installation Guide 12c Release 1 (12.1) for Microsoft Windows
Oracle 12c Download