3. Connect to source database using sys user and run emremove.sql
[oracle@ol7-dev admin]$ sqlplus
SQL*Plus: Release 11.2.0.4.0 Production on Sat Nov 7 22:53:58 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @$ORACLE_BASE/product/11.2.0/db_1/rdbms/admin/emremove.sql
old 70: IF (upper('&LOGGING') = 'VERBOSE')
new 70: IF (upper('VERBOSE') = 'VERBOSE')
PL/SQL procedure successfully completed.
SQL>
We may need to upgrade database timezone file during database upgrade from 11g to 19c. Below recommend action is from preupgrade.jar information tool.
Upgrade the database time zone file using the DBMS_DST package.
The database is using time zone file version 14 and the target 19 release ships with time zone file version 32.
Oracle recommends upgrading to the desired (latest) version of the time zone file. For more information, refer to "Upgrading the Time Zone File and Timestamp with Time Zone Data" in the 19 Oracle Database Globalization Support Guide.
Below are the steps to Upgrade the database timezone file
Connect to sqlplus and start the database in upgrade mode
sqlplus / as sysdba
shutdown immediate;
startup upgrade;
Check the current timezone file version
SELECT * FROM v$timezone_file;
--output:
SQL> SELECT * FROM v$timezone_file;
FILENAME VERSION CON_ID
-------------------- ---------- ----------
timezlrg_14.dat 14 0
Start the upgrade window
SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;
DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;
--output
SQL> SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;
DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;
/SQL> 2 3 4 5 6 7 8
l_tz_version=32
An upgrade window has been successfully started.
PL/SQL procedure successfully completed.
Start the database in normal mode
shutdown immediate;
startup;
Do the upgrade
SET SERVEROUTPUT ON
DECLARE
l_failures PLS_INTEGER;
BEGIN
DBMS_DST.upgrade_database(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
DBMS_DST.end_upgrade(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
--output
SQL> SET SERVEROUTPUT ON
DECLARE
l_failures PLS_INTEGER;
BEGIN
DBMS_DST.upgrade_database(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
DBMS_DST.end_upgrade(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/SQL> 2 3 4 5 6 7 8 9
Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
Number of failures: 0
.
.
<output truncated>
.
.
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
DBMS_DST.upgrade_database : l_failures=0
An upgrade window has been successfully ended.
DBMS_DST.end_upgrade : l_failures=0
PL/SQL procedure successfully completed.
SQL>
Check the new timezone settings
SELECT * FROM v$timezone_file;
--output
SQL> SELECT * FROM v$timezone_file;
FILENAME VERSION CON_ID
-------------------- ---------- ----------
timezlrg_32.dat 32 0
Copy the VNC configuration file /lib/systemd/system/vncserver@.service to /etc/systemd/system directory and mention the port which has to connect. By default VNC will listen to port 5900.
Here I have mentioned port 2, so that the VNC Desktop will be accessible on port 5902.
Manually edit the copied file /etc/systemd/system/vncserver@:2.service and replace <USER> to your username In the below example I have replaced <USER> with oracle
# sed -i 's/<USER>/oracle/g' /etc/systemd/system/vncserver@:2.service
3. Start the VNC Service
Switch to Oracle user and start the VNC Service
# vncserver
Output:
[oracle@ol7-dev ~]$ vncserver
Warning: ol7-dev:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server ol7-dev:1
xauth: file /home/oracle/.Xauthority does not exist
New 'ol7-dev:2 (oracle)' desktop is ol7-dev:2
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/ol7-dev:2.log
[oracle@ol7-dev ~]$
4. Enable the VNC Service
Switch to root user and enable the vncserver service for oracle user on port 5902. This will also enable autostart on system boot.
Switch to root user:
# su -
Reload systemd’s configuration
# systemctl daemon-reload
Configure the VNC password for user oracle
# vncpasswd oracle
Start and enable the VNC Server service. This will enable the auto start on system boot
In this post I will describe the step by step installation of Oracle database 19c 64-bit on Oracle Linux 7 64-bit and creation of a single instance 19c database.
3. Creation of single instance database using DBCA
Login to oracle user run dbca. The dbca utility is typically located in ORACLE_HOME/bin directory.
Choose Create a database
Select Advance configuration, In Advanced configuration, you can customize storage locations, management database options, and different passwords for Admin user accounts.
Choose Database type: Oracle single instance database and General Purpose or Transaction Processing template
Provide the Global database name & SID Enable Create as Container database and provide the PDB name
Choose File System and Provide the Database files location details
Enable Specify Fast Recovery Area and provide the location and size
If no listener is available, create a new one
Data Vault Option,
Choose Automatic Memory Management (if your physical memory is less than 4 GB) and Provide the Memory Target.
Note: If the total physical memory of your database instance is greater than 4 GB, then you cannot select the Use Automatic Memory Management option. Instead, use automatic shared memory management.
Specify the Processes count, This will be the maximum number of processes that can simultaneously connect to the database.
Use Unicode (AL32UTF8) Select this option to support multiple languages for your database users and database applications
Management Option
specify the passwords for the administrative accounts such as SYS, SYSTEM, and PDBADMIN.
Choose Create database and and click on Next
Review the summary information and click on Finish
Database created successfully..
[oracle@ol7-dev software]$ export ORACLE_SID=db19c
[oracle@ol7-dev software]$ sqlplus
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 10 23:45:18 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select name, open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
DB19C READ WRITE
In this article I will describe how to detach a block volume from an Oracle cloud Linux instance We will be covering the following steps:
Unmount the mount-point from the Linux Instance
Disconnect the Block volume from the instance
Detach the Block volume from the Instance
Delete the volume from Cloud console
1. Unmount the disk from the Linux Instance
Connect to the linux instance and run the umount command to unmount the filesystem with has to be deleted umount /oracle
2. Disconnect the Block volume from the instance
Once the disk is unmounted, access the cloud console and copy the commands to disconnect the block volume from the instance: Goto Attached block volumes > Click on ellipsis(…) and select iSCSI Commands & Information
Copy the COMMANDS FOR DISCONNECTING
Connect the VM as root user and run the commands
3. Detach the Block volume from the Instance
Once the Block volume is detached. Access the cloud console, navigate to Instances page and click on Instance name (oc-ol7 here)
Under Resources select Attached Block Volumes and click on the ellipsis(…) then select Detach
Click on Continue Detachment
Click ok
Now we can see the Volume State is Detaching.
4. Delete the volume from Cloud console
Once the volume is Detached, Open the navigation menu. Under Core Infrastructure, goto Block Storage and Click on Block Volumes
In the block volume section click on the ellipsis(…) on which the volume you want to delete, then click Terminate and confirm the selection when prompted.
In this article I will describe how to create a block volume and attaching it to an instance in Oracle cloud. We will be covering the following sections:
Creating Block Volume
Attaching the Block Volume to the Linux VM Instance
Format and Mount the volume on the instance
1. Creating Block Volume
Open the navigation menu. Under Core Infrastructure, go to Block Storage and click Block Volumes
Select the root compartment and click on Create Block Volume
Provide the Name and Volume size and Performance, then click on Create Block Volume
The Block volume is successfully created
2. Attaching the Block Volume to the Linux VM Instance
Open the navigation menu. Under Core Infrastructure, go to Compute and click Instances
Click on the instance name
Under Resources select Attached Block Volumes and click on Attach Block Volume
Choose Volume attachment type: ISCSI Select the volume which created in the previous section Select the Device Path, then click on Attach
Block Volume is successfully attached
Click on the ellipsis(…) and select iSCSI Commands & Information
Click on copy to copy the COMMANDS FOR CONNECTING
Connect the Linux VM instance as root user and run the iSCSI commands to connect the block volumes
3. Format and Mount the volume on the instance
Verify the newly added disk using fdisk command
Format the newly added Disk /dev/sdb
Verify the new partitioned disk /dev/sdb1
Format and Mount the disk
Create directory “oracle” and mount the newly created disk
This is my first blog post and I hope you will ignore mistakes. Thank you in advance.
Description:
In this blog post I will describe the step by step creation of Oracle cloud always free account and creating a Linux Virtual Machine.
Oracle Cloud Free Tier will allows you to sign up for an Oracle Cloud account which provides a number of Always Free services and a free credit of 300$ which can be use on all eligible Oracle cloud Infrastructure services for up to 30 days. The Always Free services are available for an unlimited period of time. Kindly click here to know more in detail.
Choose your country and enter your name and email address Once provided the details, check your email. You will see an account validation email from Oracle.
Enter the account information. Note: Home Region cannot be changed once you sign-up.
Enter the address information, mobile details & Payment details and verify the same Note: You need to provide the credit card details and 1$ will be charged for the verification and the same will be reserved. You will not be charged unless you elect to upgrade the account.
Enter you cloud account name and click next. This is the name we choose during the account creation
Enter the cloud account credentials and click next. Username is your email address.
You are now login to your cloud account
3. Network Configuration
Create Virtual Cloud Network (VCN)
Open the navigation menu. Under Core Infrastructure, go to Networking and click Virtual Cloud Networks
Select the compartment you want to create the network. Then click on Create VCN
Enter a name for the VCN For CIDR Block, I choose IP 192.168.10.0/24, so that I can use the private IP range b/w 192.168.10.1 to 192.168.10.254.
Now the VCN status is available
Click on VCN Name (ocvcn) and you will be redirected to VCN Details page. Under Resource select Subnets and then click Create Subnet
Enter the information as per the below screenshot and click on Create Subnet. Note: Public subnet has selected to access the instance in public n/w.
The subnet is now created
Configure Internet Gateway
From VCN Details page under Resources, click on Internet Gateways
Give it a name and choose the compartment, then click on Create Internet Gateway
Your internet gateway is created. but you still need to add a route rule that allows traffic to flow to the gateway.
Adding Route table
From VNC Details page, Under Resources –> Route Tables, click on the route table associated with your public subnet.
Click on Add Route Rules
This is for the public subnet. select Target Type as Internet gateway Destination CIDR Block: 0.0.0.0/0 (This means all the internet) Once ready, click on Add Route Rules
Now you can see the Internet gateway route has been successfully added
Adding Security lists
Check your public IP using the URL and whitelist it to access the cloud VM which you will be creating in the next steps
From Subnet Details page, Under Resources, select Security Lists and click on the Default Security List as shown below
Click on Add Ingress Rules
Source Type: CIDR Source CIDR: <Your Public IP>/32 IP Protocol: TCP; Source Port Range: All; Destination Port Range: All Once ready, Click on Add Ingress Rules
Now you can see your my Public IP is whitelisted
Creation of Oracle Linux Virtual Machine Instance
Open the navigation menu. Under Core Infrastructure, go to Compute and click Instances.
Click on create instance
Name: Enter the name for the instance Create in Compartment: Select the compartment to create the instance in Availablilty Zone: Select the Availability domain that you want to create the instance Image: Select the image, by default Oracle Linux 7.x is used to boot the instance Shape: Select VM.Standard.E2.1.Micro, which is eligible for always free Add SSH keys: select Generate SSH Key pair; Click Save Private Key and Save Public key on your computer.
In Management section leave the setting as default
In Networking section enter the private IP and Hostname of the VM. Then click on Create
Wait for the instance creation to complete
After a couple of minutes you can see your Instance is in running state